3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Convert video in Linux

Convert video in Linux
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).
 
Remove these adsRemove these ads by Signing Up
 

Step 1Opening the terminal

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.
« Previous StepDownload PDFView All StepsNext Step »
6 comments
May 17, 2010. 5:40 PMinstructables_user_4783 says:
OK, so I had a bit of a problem converting an AVI video from my camera to MP4. I kept getting an error opening output codec error message,so I had to do this:
Convert to VCD format:
ffmpeg -i MVI_1841.AVI -target ntsc-vcd firstoutput.mpg
then I converted it to MP4 format:
ffmpeg -i firstoutput.mpg -s 320x240 video.mp4
**Please note I had to set the size to 320x240 because ntsc-vcd was different and distorted the video**
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 :)
May 25, 2010. 6:39 PMinstructables_user_4783 says:
UPDATE: Here is how I did it with only one conversion.
Find the frame rate of the input video using:
ffmpeg -i MVI_1841.AVI
then convert with the frame rate parameter set to that of the input video. In my case it was 15. Use this command.
ffmpeg -i MVI_1841.AVI -r 15 output.mp4
This way only one conversion is needed.
Mar 18, 2009. 2:02 PMlokisox says:
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
Feb 7, 2009. 6:35 PMstuuf says:
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...

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.
Sep 19, 2008. 6:14 AMDrCoolSanta says:
1) Not all distros come with ffmpeg
2) There is a windows version as well.

To add:

For help on ffmpeg run:
ffmpeg -h

to specify an audio codec add the argument
--acodec codec'

to specify the video codec add the argument
--vcodec codec

to check the codecs that you can use with ffmpeg, check
ffmpeg -formats
Jun 11, 2008. 12:19 PMzupHC says:
Great! Thanks! Is just what I was searching for! :)

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
14
Followers
4
Author:magnus0