Nytro Posted October 20, 2011 Report Posted October 20, 2011 19 ffmpeg commands for all needsffmpeg is a multiplatform, open-source library for video and audio files. I have compiled 19 useful and amazing commands covering almost all needs: video conversion, sound extraction, encoding file for iPod or PSP, and more.Getting infos from a video fileffmpeg -i video.aviTurn X images to a video sequenceffmpeg -f image2 -i image%d.jpg video.mpgThis command will transform all the images from the current directory (named image1.jpg, image2.jpg, etc…) to a video file named video.mpg.Turn a video to X imagesffmpeg -i video.mpg image%d.jpgThis command will generate the files named image1.jpg, image2.jpg, …The following image formats are also availables : PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI.Encode a video sequence for the iPpod/iPhoneffmpeg -i source_video.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X final_video.mp4Explanations :Source : source_video.aviAudio codec : aacAudio bitrate : 128kb/sVideo codec : mpeg4Video bitrate : 1200kb/sVideo size : 320px par 180pxGenerated video : final_video.mp4Encode video for the PSPffmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4Explanations :Source : source_video.aviAudio codec : aacAudio bitrate : 32kb/sVideo codec : xvidVideo bitrate : 1200kb/sVideo size : 320px par 180pxGenerated video : final_video.mp4Extracting sound from a video, and save it as Mp3ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3Explanations :Source video : source_video.aviAudio bitrate : 192kb/soutput format : mp3Generated sound : sound.mp3Convert a wav file to Mp3ffmpeg -i son_origine.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3Convert .avi video to .mpgffmpeg -i video_origine.avi video_finale.mpgConvert .mpg to .aviffmpeg -i video_origine.mpg video_finale.aviConvert .avi to animated gif(uncompressed)ffmpeg -i video_origine.avi gif_anime.gifMix a video with a sound fileffmpeg -i son.wav -i video_origine.avi video_finale.mpgConvert .avi to .flvffmpeg -i video_origine.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_finale.flvConvert .avi to dvffmpeg -i video_origine.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2 video_finale.dvOr:ffmpeg -i video_origine.avi -target pal-dv video_finale.dvConvert .avi to mpeg for dvd playersffmpeg -i source_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 finale_video.mpegExplanations :target pal-dvd : Output formatps 2000000000 maximum size for the output file, in bits (here, 2 Gb)aspect 16:9 : WidescreenCompress .avi to divxffmpeg -i video_origine.avi -s 320x240 -vcodec msmpeg4v2 video_finale.aviCompress Ogg Theora to Mpeg dvdffmpeg -i film_sortie_cinelerra.ogm -s 720x576 -vcodec mpeg2video -acodec mp3 film_terminée.mpgCompress .avi to SVCD mpeg2NTSC format:ffmpeg -i video_origine.avi -target ntsc-svcd video_finale.mpgPAL format:ffmpeg -i video_origine.avi -target pal-svcd video_finale.mpgCompress .avi to VCD mpeg2NTSC format:ffmpeg -i video_origine.avi -target ntsc-vcd video_finale.mpgPAL format:ffmpeg -i video_origine.avi -target pal-vcd video_finale.mpgMulti-pass encoding with ffmpegffmpeg -i fichierentree -pass 2 -passlogfile ffmpeg2pass fichiersortie-2This article is an English adaptation of Jean Cartier ffmpeg exemples.Sursa: http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs Quote