FFMPEG/X264 how to use them together [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this questionNeed a little help. I am trying to encode large videos using ffmpeg/x264. While x264 is totally unable to encode these videos to .mov, ffmpeg does a decent job.
But I need to use one of the flags which开发者_如何转开发 x264 provides to encode my video. So is there a good way to encode large videos using x264 given that i only want .mov as output.
While using x264 I am only mentioning input and output flags, I think that may be causing the problem.
Please guide
For one pass (newer commandline):
ffmpeg -i INPUT -acodec libfaac -ab 128k -ar 48000 -s WIDTHxHEIGHT -r FRAME_RATE -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 5 -trellis 1 -refs 2 -bf 1 -coder 1 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 4M -bufsize 4M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 21 OUTPUT.mp4
For two pass (newer commandline):
ffmpeg -i INPUT -an -pass 1 -s WIDTHxHEIGHT -r FRAME_RATE -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me dia -subq 1 -trellis 0 -refs 1 -bf 1 -b_strategy 1 -coder 1 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 4k -bufsize 4k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 OUTPUT.mp4
ffmpeg -i INPUT -acodec libfaac -ab 128k -ar 48000 -pass 2 -s WIDTHxHEIGHT -r FRAME_RATE -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 5 -trellis 1 -refs 2 -bf 1 -b_strategy 1 -coder 1 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 4k -bufsize 4k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 21 OUTPUT.mp4
1.5Mbit/s 640×480 H.264 videos (for improved quality using TV out) For one pass:
ffmpeg -i INPUT -acodec libfaac -ab 128k -s WIDTHxHEIGHT -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect WIDTH:HEIGHT OUTPUT.mp4
For two pass:
ffmpeg -i INPUT -an -pass 1 -s WIDTHxHEIGHT -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions 0 -me epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect WIDTH:HEIGHT OUTPUT.mp4
ffmpeg -i INPUT -acodec libfaac -ab 128k -pass 2 -s WIDTHxHEIGHT -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect WIDTH:HEIGHT OUTPUT.mp4
768kbit/s 320×240 H.264 videos For one pass:
ffmpeg -i INPUT -acodec libfaac -ab 128k -s WIDTHxHEIGHT -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 5 -trellis 1 -refs 5 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 768k -bufsize 2M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 -title SOME_TITLE OUTPUT.mp4
For two pass:
ffmpeg -i INPUT -an -pass 1 -s WIDTHxHEIGHT -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions 0 -me epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 768k -bufsize 2M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 -title SOME_TITLE OUTPUT.mp4
ffmpeg -i INPUT -acodec libfaac -ab 128k -pass 2 -s WIDTHxHEIGHT -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 5 -trellis 1 -refs 5 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 768k -bufsize 2M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 -title SOME_TITLE OUTPUT.mp4
2.5Mbit/s 640×480 MPEG-4 SP videos For one pass:
ffmpeg -i INPUT -acodec libfaac -ab 128k -s WIDTHxHEIGHT -vcodec mpeg4 -b BIT_RATE -flags +aic+cbp+mv0+mv4+trell -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 2.5M -bufsize 2M -title SOME_TITLE OUTPUT.mp4
For two pass:
ffmpeg -i INPUT -an -pass 1 -s WIDTHxHEIGHT -vcodec mpeg4 -b BIT_RATE -flags +aic+cbp+mv0+mv4+trell -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 2.5M -bufsize 2M -title SOME_TITLE OUTPUT.mp4
ffmpeg -i INPUT -acodec libfaac -ab 128k -pass 2 -s WIDTHxHEIGHT -vcodec mpeg4 -b BIT_RATE -flags +aic+cbp+mv0+mv4+trell -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 2.5M -bufsize 2M -title SOME_TITLE OUTPUT.mp4
Cheers
精彩评论