Useful video transcoding commands

One of the handiest tools in my Linux toolchest is Ffmpeg, the universal media transcoder. I'm pretty sure this fantasically useful piece of software runs in the background of every service that converts audio or video from one format to another (Google video, YouTube, Archive.org, etc). Over the years I've amassed a small collection of commands that will allow me to take media from one source and convert it for use in another - for example ripping video from a DVD or the web and then editing it and burning it back to DVD. Hopefully these will prove to be of use to you:

1) Converting video to DVD-compatible MPEG2:

ffmpeg -y -i inputfile.xyz -vcodec mpeg2video -target ntsc-dvd -r ntsc -deinterlace -aspect 4:3 outputfile.m2v


2) Converting video for the web (w/o frame size reduction):

ffmpeg -i inputfile.xyz -f avi -vcodec mpeg4 -ab 128 output.avi


3) Convert DVD (MPEG2) files to MPEG4:

ffmpeg -i inputfile.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 outputfile.avi


4) Prepare for Gen5 video podcast:

ffmpeg -i inputfile.xyz -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 192 -s 320x240 -aspect 4:3 outpulfile.m4v

or

ffmpeg -i inputfile.xyz -f mp4 -vcodec mpeg4 -maxrate 2500 -b 1800 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ar 44100 -ab 128 -s 320×240 -aspect 4:3 outputfile.m4v


5) Prepare Cinelerra edited .DV (from Canon GL1*) for Google video upload:

ffmpeg -i inputfile.dv -f avi -vcodec mpeg4 -cropleft 8 -cropright 4 -s 640x480 -b 1200 -g 300 -bf 2 -acodec mp3 -ab 128 outputfile.avi


6) Convert electric sheep for Resiloom:


ffmpeg -i inputfile.mpg -f avi -vcodec mpeg4 -s 640x480 -b 6000 -g 300 -bf 2 -acodec mp3 -ab 128 outputfile.avi


7) Convert to raw DV (eg. for editing in Cinelerra or Apple FCP):


ffmpeg -i inputfile.xyz -target ntsc-dv outputfile.dv

 

* The Canon GL1 does not shoot a full 720x480. This command include the options to remove the black bands that the GL1 adds to the sides of DV video during the transcode.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

oh yeah, one more thing ---do you use cinelerra then? When I first used ubuntu and was trying to encode that Inconvenient Truth  CAM I used it but it fscked up my disk. It seems it was kind of unstable. I haven't used it since but the guy who makes it sure is a character eh?

rusl (not verified) | April 21, 2008 - 7:08am

Greetings Rusl,

So nice to hear from you!  I actually haven't done any video editing lately. The latest one that I've heard good things about is KDEnlive. Ben West was giving it a try but I haven't heard a report back from him on how it's going.

metta.

Scott | April 22, 2008 - 9:07pm

hey, nice blog! But it needs more bikes ;p

have you ever done it with mkv files? I find support for mkv a little thin but the files are usually good quality. It think its more popular format in japan.

anyway the dvd compatable one I am going to use. I allways find dvd authoring stuff too confusing so I don't bother and just burn it as avi and tell people to get a dvd player with better software :D

Steal this film 2 is out now http://isohunt.com/torrent_details/31007092/steal+this+film+ii?tab=summary have you seen the first one? That one is about the piratebay raid and stuff. This new one is more philosophical.

I just installed ubuntu 8 on my computer at home because ubuntu 7 was crashing a lot!! Its an amd64 version bug but it sucks. I just installed it and didn't use it yet though as we are right now in victoria with finnegann.

 

see you soon!

 

rusl (not verified) | April 21, 2008 - 7:05am

Hey,

It'll have more bikes soon as I'm working on something geeky and fun for Car Free Day on June 15.

I picked up a new laptop and I'm runing the AMD64 version of Hardy and it's pretty good for me. Getlibs is a great way to bridge the gap to older 32 bit program versions while we wait for the the 64 bit version to come out.

hugs (and to jane and finnegan),

~s

 

 

Scott | April 22, 2008 - 9:11pm

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]

More information about formatting options