mp4 > mov
ffmpeg -i IN.mp4 -q:v 0 -strict -2 OUT.mov
mp4 > ogv
ffmpeg -i IN.mp4 -codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 OUT.ogv
-qscale:v 7 Qualité de la vidéo (de 0 = pire à 10 = meilleur). 5à7 est un bon compromis. Si l'option n'est pas renseignée, ffmpeg donnera -b:v 200k par défaut (faible qualité)
-qscale:a Qualité audio (de 0 = pire à 10 = meilleur). 3-6 is a good range to try. Par défaut : 3.
Note: si on oublie -codec:a libvorbis then ffmpeg will default to the native FFmpeg flac audio encoder for ogg/ogv output container.
mp4 > webm
ffmpeg -i IN.mp4 -c:v libvpx -b:v 1M -c:a libvorbis OUT.webm
-c:v libvpx donne variable bitrate mode by default. In this mode, it will simply try to reach the specified bit rate on average, e.g. 1 MBit/s. This is the target bitrate. We should choose a higher bit rate if we want better quality. Note that we shouldn’t leave out the -b:v option as the default settings will produce mediocre quality output.
Video Demux
ffmpeg -i IN.mov -r 25 -s 1280x720 -aspect 16:9 -f yuv4mpegpipe -pix_fmt yuv420p -vsync 1 -y OUT.y4m
Video Encode with 2 pass
x264 --pass 1 --bitrate 1200 --vbv-maxrate 2400 --vbv-bufsize 6000 --stats ./x264_2pass.log -o /dev/null video.y4m x264 --pass 2 --bitrate 1200 --vbv-maxrate 2400 --vbv-bufsize 6000 --stats ./x264_2pass.log -o video.h264 video.y4m
Mux Video/Audio
ffmpeg -i video.h264 -i IN.mp4 -vcodec copy -acodec copy -y OUT.mp4