Useful ffmpeg and mencoder commands on Ubuntu 9.10 Karmic

FFmpeg can be installed easily from synaptic

$ sudo apt-get install ffmpeg

Some useful FFMPEG commands :

1. convert mpeg to flv

ffmpeg -i /path/to/movie.mpeg -ar 22050 -ab 32 -f flv -b 500000 -s 480x360 -y movie.flv

2. convert mp3 to flv

ffmpeg -i /path/to/track.mp3 -f mp3 -ab 64000 -ar 22050 myfile.mp3

3. convert mpeg to flv with mp3

ffmpeg -i /path/to/movie.mpeg -ar 22050 -ab 64000 -acodec libmp3lame -f flv -b 1000000 -s 480x360 -y movie.flv 

4. convert ogv to avi

ffmpeg -i /path/to/movie.ogv output.avi

-i denotes the input file path
-acodec - denotes the audio codec , libmp3lame in this case , can be installed from synaptic
-s the dimension of final movie e.g. 480x360
-ab audio bitrate of output e.g. 64000

FFMpeg Options
FFmpeg Docs

Useful links :
19 ffmpeg commands
19 ffmpeg commands

For help go to irc channel #ffmpeg on freenode.net

Mencoder

1. Convert ogv to wmv (Windows) :

mencoder -idx /path/to/file.ogv -ovc lavc -oac lavc -lavcopts vcodec=wmv2 -of lavf -o outfile.wmv

-ovc : Output Video Codec
-oac - Output Audio Code
lavc - Select from libavcodec (can be installed from synaptic)
-of : output format
Mencoder Usage Guide

libavcodec-extra-52 should also be installed for mp3 support.

//Done







Last Updated On : 25th May 2010

Subscribe to get updates delivered to your inbox

1 Comment + Add Comment

  • … and here how to obtain an AVI film with sound:

    mencoder out.ogv -ovc xvid -oac mp3lame -xvidencopts pass=1 -o out.avi

Leave a comment