FFmpeg / MEncoder commands

FFmpeg is a BIG tool inn video editing. With FFmpeg, you can split / cut / join / convert your videos with just commands in the text console. Many video converting / editing software using FFmpeg and Mencoder in their back-ends. Hers is some useful ffmpeg / mencoder commands which I used so many times earlier.

How to convert avi format to mpg format with mencoder

mencoder input.avi -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy other_options -o output.mpg

How to combine two avi files to single avi file using mencoder

mencoder -forceidx -ovc copy -oac copy -o file.avi p1.avi p2.avi
eg.
mencoder -forceidx -ovc copy -oac copy -o myfilename.avi \home\tom\Documentries\Movies\converted\cvt_VTS_01_1.avi \home\tom\Documentries\Movies\converted\cvt_VTS_01_2.avi

How to cut an avi file using mencoder

mencoder -ss 00:00:20 -endpos 00:00:50 -ovc copy -oac copy bigvideo.avi -o result.avi

To Rip VCD to .avi

ffmpeg, ffmpeg -i yourVCD.dat -y output.avi

To cut an mp3 file

ffmpeg -acodec copy -ss 00:00:31 -t 00:01:00 -i input.mp3 out.mp3

To convert wmv to flv

ffmpeg -i sourceFile.wmv -sameq -acodec libmp3lame -ar 22050 -ab 96000 -deinterlace -nr 500 -s 640x480 -aspect 4:3 -r 20 -g 500 -me_range 20 -b 270k -deinterlace -f flv -y DestinationFile.flv

To split from vob to mp4 without losing quality

ffmpeg -i sourcdFile.vob -sameq -ss 00:00:02 -t 42 DestinationFile.mp4
ffmpeg -i sourcdFile.vob -sameq -ss [start time] -t [total seconds] DestinationFile.mp4
eg: ffmpeg -i \home\tom\TVCs\One.VOB -sameq -ss 00:00:02 -t 32 \home\tom\TVCs\Two.mp4

To convert from mp4 to wmv

ffmpeg -i \home\tom\tomLog4\WEB_0386.MP4 -sameq \home\tom\wmv\WEB_0386.wmv

To convert from mp4 to mpg

ffmpeg -i E:\tomLog4\100VIDEO\WEB_0386.MP4 -sameq \home\tom\movies\WEB_0386.mpg

To convert mp3 file to video with jpg frame

ffmpeg -f image2 -loop_input -i pic.jpg -i pic.mp3 -vcodec mpeg1video -qscale 2 -acodec copy -shortest newvideo.avi

To join three .mp3 files

ffmpeg -i concat:"File1.MP3|File2.MP3" -acodec copy File_Joined1.mp3
ffmpeg -i concat:"File_Joined1.mp3|File3.MP3" -acodec copy File_Joined2.mp3

FFmpeg official site | MEncoder official site

Advertisements