ffmpeg examples

77
rate or flag this page

By rhughes2832

 

ffmpeg is a great command line tool for converting between video and audio formats. But good examples are hard to find.

(more ffmpeg examples on my site www.smallsoftware.co.uk)


My main use of ffmpeg is for converting MPEG2 files (typically recorded from DVB-T/Freeview) either into DivX (to play on an Archos portable video player), or lower bitrate MPEG2. When I was learning to use it, I was constantly frustrated by the lack of good examples for commonly used video format. If you're looking for something similar, hopefully this will be useful to you.

Convert to DivX

This creates a DivX file, 4:3 aspect ratio, 320x240 resolution, bit rate of 690k for video, 128k for audio. The right sort of size for my Archos AV420 player.

ffmpeg -i inputfile.mpg   -vtag DIVX -f avi -vcodec mpeg4 
     -aspect 4:3 -s 320x240  -b 690000 -acodec mp3 
     -ab 128000 -ar 48000 -ac 2  outputfile.avi
 

and the same thing for 16:9 ratio.

ffmpeg -i inputfile.mpg   -vtag DIVX -f avi -vcodec mpeg4 
     -aspect 16:9 -s 320x192 -b 690000 -acodec mp3 
     -ab 128000 -ar 48000 -ac 2  outputfile.avi
 
 

Convert lower-rate MPEG2

I've got a Netgem iPlayer in the kitchen for the children to watch cartoons on. Cartoons don't need a very high bitrate (and the children are too small to care about a bit of pixellation anyway), so I lower the bitrate to save disk space (I've still got more than 200Gb of cartoons though...).

This will lower the bitrate to 1536k... that's equivalent to about 5 hours on a single layer DVD. At that low a rate, it's best to take a little longer doing the encoding, so I do two passes.

ffmpeg -i inputfile.mpg -vcodec  mpeg2video -b 1536000 
     -ab 128000 -ar 48000 -ac 2 -pass 1 outputfile.mpg 
 
rm outputfile.mpg 
 
ffmpeg -i inputfile.mpg -vcodec  mpeg2video -b 1536000 
     -ab 128000 -ar 48000 -ac 2 -pass 2 outputfile.mpg

Print   —   Rate it:  up  down  flag this hub

Comments

RSS for comments on this Hub

tambrab2007 profile image

tambrab2007  says:
14 months ago

Divx works fine for this, but I do think that AVS tools works much better; however, that is just my opinion.

The Bear  says:
10 months ago

tambrab2007, why would you use a jackhammer where a pick is ample?

50 MB vs. 70KB and besides, what's the point of trying to push M$ Windoze software at Linux People.. NOT bloody much, go back to your Virus Ridden, Crash Prone Trojan and let REAL computer users use REAL software NOT useless BLOATWARE.

Just because MS-Window's holds 90% of the market doesn't mean it's superior. Remember 90% of all animals are insects.

dfgdf  says:
5 weeks ago

* Please enter your name before posting.

* Please enter a comment before posting.

Amir  says:
8 days ago

Hi,

How can I download ffmpeg.exe file or how can I produce the file?

Submit a Comment

Members and Guests

Sign in or sign up and post using a hubpages account.


optional


  • No HTML is allowed in comments, but URLs will be hyperlinked
  • Comments are not for promoting your hubs or other sites

working