FFmpeg is the best open-source video converter out there. It is plain, simple, but very powerful. FFmpeg is a command line program. There are a few graphical frontends too, but they tend to be buggy. So, the easiest way to convert video in Linux is using FFmpeg in the terminal (Linux command line).

Step 1: Opening the Terminal

Terminal is in the applications menu in one of the sub-categories. (Depends on the distribution and the desktop environment). In Ubuntu, it is in Applications->Accessories->Terminal.

First, cd to the directory, where your video file is (cd means change directory)
If the file is on desktop, the command would be: cd Desktop
if it's in the videos folder, it would be: cd /home/$USER/Videos

Now you're virtually inside that folder.

Step 2: Converting Video

The basic command for converting video is: ffmpeg -i inputfile outputfile
The format of the output video comes from the file extension you specify on outputfile.
It can be any video format: flv, avi, mpg...

example: ffmpeg -i input.avi output.mpg

Now we start adding parameters.
parameters are options for converting video. they are in format: ffmpeg -i myfile.avi -parameter output.mpg

There are a number of parameters:
-ab -audio bitrate
-b -video bitrate
-sameq -produces same quality video, as the input
-target -target can be "vcd", "svcd", "dvd", "dv", "pal-vcd" or "ntsc-svcd".
example: ffmpeg -i myfile.avi -target ntsc-dvd mydvdfile.mpg
This makes a dvd video file

I want to convert an mpg file to flv with 350 video bitrate and 64 audio bitrate:
ffmpeg -i mympgfile.mpg -b 350 -ab 64 myflvfile.flv

I want to convert an avi to mpg with the same quality:
ffmpeg -i avifile.avi -sameq output.mpg

Here is a great tutorial on this:
<p>Very informative! Thanks for showing clearly how to download convert videos in linux. I always use Acethinker Video Converter to do the conversion job on my linux laptop, it's a free online app, you don't have to download or install anything. Share it here as an alternative method.</p>
<p>I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! <a href="http://gks.com.ua/" rel="nofollow">http://gks.com.ua/</a> keep up the good work.</p>
<p>The guide will<br>take change MP4 file frame rate as an example and it can also serve to change<br>AVCHD, MTS, M2TS, MXF, XAVC, ProRes, MPG, AVI, FLV, MOV, WMV, MKV and almost<br>all video format frame rates at</p><p><a href="http://www.avdshare.com/change-video-frame-rate" rel="nofollow">http://www.avdshare.com/change-video-frame-rate</a></p>
OK, so I had a bit of a problem converting an AVI&nbsp;video from my camera to MP4. I kept getting an error opening output codec error message,so I&nbsp;had to do this:<br /> Convert to VCD format:<br /> <em>ffmpeg -i MVI_1841.AVI -target ntsc-vcd firstoutput.mpg</em><br /> then I converted it to MP4 format:<br /> <em>ffmpeg -i firstoutput.mpg -s 320x240 video.mp4</em><br /> <strong>**Please note I had to set the size to 320x240 because ntsc-vcd was different and distorted the video**</strong><br /> It worked. Probably not the most efficient way converting the video twice but it does work. Just thought I'd let people know. Perhaps there is a way that works and requires only one conversion :)<br />
<strong>UPDATE: </strong>Here is how I did it with only one conversion.<br /> Find the frame rate of the input video using:<br /> <em>ffmpeg -i MVI_1841.AVI</em><br /> then convert with the frame rate parameter set to that of the input video. In my case it was 15. Use this command.<br /> <em>ffmpeg -i MVI_1841.AVI -r 15 output.mp4</em><br /> This way only one conversion is needed.<br />
devede, makes dvd iso that play on avy dvd player, it can also convert upto 5 full movies to fit on one 4.7 dvd, it lets you resize the input image, get thru internet site or add / remove programs, never had a bad copy in the 3 years of use
It's a start, but you should add some more details about how ffmpeg command line options work (especially how options apply only to files listed *after* them), how to set codecs and formats (containers) including -acodev/vcodec copy, when and when not to use -target, a/v sync, threads, 2-pass video encoding...<br/><br/>There are some other interesting things you can do with ffmpeg beyond simple video encoding, like extracting still frames from a video and adding/extracting an audio track to a video file.<br/>
1) Not all distros come with ffmpeg<br/>2) There is a windows version as well.<br/><br/>To add:<br/><br/>For help on ffmpeg run:<br/>ffmpeg -h<br/><br/>to specify an audio codec add the argument<br/>--acodec <em>codec'</em><br/><br/>to specify the video codec add the argument<br/>--vcodec <em>codec<strong></strong></em><br/><br/>to check the codecs that you can use with ffmpeg, check<br/>ffmpeg -formats<br/>
Great! Thanks! Is just what I was searching for! :)

About This Instructable



More by magnus0:How to open a jammed CD/DVD drive Simple overdrive effect pedal How to install Google Earth in Linux with one command 
Add instructable to: