ffmpeg Tricks

Separate video and audio

Encode DVD

ffmpeg -i my_video.avi -target pal-dvd -aspect 16:9 -sameq my_dvd_video.mpg

2-pass h.264 encoding

ffmpeg -i in.mov -an -pass 1 -vcodec libx264 -vpre slow_firstpass -b 5000000 -threads 0 -s 1280x720 out.mp4
ffmpeg -y -i in.mov -acodec libfaac -ab 320k -pass 2 -vcodec libx264 -vpre slow -b 5000000 -threads 0 -s 1280x720 out.mp4

ffmpeg -y -i <input_file> -pass 1 -vcodec libx264 -b <video_bitrate> -g <gop_size> -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab <audio_bitrate> output.mp4

ffmpeg -y -i <input_file> -pass 2 -vcodec libx264 -b <video_bitrate> -g <gop_size> -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab <audio_bitrate> output.mp4 

 ffmpeg -y -i dare2.mov -pass 1 -vcodec libx264 -b 2000000 -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab 128000 -s 1280x720 dare2.mp4
ffmpeg -y -i dare2.mov -pass 2 -vcodec libx264 -b 2000000 -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab 128000 -s 1280x720 dare2.mp4 

ffmpegTricks (last edited 2011-11-12 04:42:50 by bd65d261)