Basic Commands for Encoding with FFMPEG

Posted by Derrick on September 13, 2010 under Video Streaming and Compression | Be the First to Comment

Here are some basic commands for encoding with FFMPEG.  If you decide to go with encoding via the command line and FFMPEG you’re taking on a very challenging task.  For one-off encodes using FFMPEG is nice and the quality for encoding using the H.264 codec is amazing. If you where able to get FFMPEG installed successfully here are some commands that you can try.  You’ll run the commands below via the command line:

ffmpeg -i samplevideo.mov -s 176×132 -r 15 -vcodec libx264 -fpre “C:\Users\John\local\share\ffmpeg\libx264-default.ffpreset” -fpre “C:\Users\John\local\share\ffmpeg\libx264-ipod320.ffpreset” -b 85000 -level 30 -strict experimental -acodec aac -ab 64k -ac 1 -ar 48000  sample_149k_6.mov

Here’s a little detail about the commands above. Hopefully this will get you up and running quicker than it took me.

-i samplevideo.mov is for the input source you’re encoding.  The sample_149k_6.mov at the end of the commands is your output file name.

-s 176×132 is the frame size

-r 15 is the frame rate

-vcodec libx264 is the video codec being used

-fpre “C:\Users\John\local\share\ffmpeg\libx264-ipod320.ffpreset” refers to the file name of the preset being used. (The path is pointing to where the preset is located.)

-b 85000 is the video datarate

-level 30 is the profile level for H.264.  In this case level 3.0 is being used.

-acodec aac is the audio codec be used.

-ab 64k is the audio datarate

-ac 1 specifies the amount of audio channels being used. In this case it is one for mono.

-ar 48000 is the sample rate.

You can find out more details in the FFMPEG Documentation located on the FFMPEG.org website.

Comments are closed.