[FFmpeg-user] ffmpeg optimization question:

Lou lou at lrcd.com
Tue Jul 23 23:31:04 CEST 2013


On Mon, 22 Jul 2013 16:53:26 -0700
John Crossman <johncrossman at berkeley.edu> wrote:

>    1. ffmpeg -i *video1.mp4* -i  *video2.mp4*  -filter_complex
>    "[1:v]pad=iw*2:ih[bg];[bg][0:v]overlay=W/2+((W/2-w)/2):(H-h)/2" -qscale:v 2
>    -strict -2  *video3.mp4*

-qscale:v is ignored by libx264.

>    2. ffmpeg -i *video3.mp4*  -acodec libmp3lame -ab 64k -ar 22050 -r 25
>    -vcodec libx264 -level 41 -crf 20 -bufsize 20000k -maxrate 25000k -g 250 -s
>    1280x720 -coder 1  -subq 7 -me_range 16 -keyint_min 25 -sc_threshold 40 *
>    final.mp4*
> 
> My question: How can I optimize the command #2 above? I have sample stdout
> below.

As Carl already mentioned, and I may be missing something, but I don't
see the need for two commands when you can do it in one. If you're
uploading to YouTube:

ffmpeg -i input1 -i input2 -filter_complex pad;overlay -preset medium
-crf 18 -codec:a copy output.mkv

* No need for "-coder 1  -subq 7 -me_range 16 -keyint_min 25
  -sc_threshold 40"; that's what the presets are for.
  See https://trac.ffmpeg.org/wiki/x264EncodingGuide

* I see no reason for "-level 41 -bufsize 20000k -maxrate 25000k -g
  250 -s 1280x720"


More information about the ffmpeg-user mailing list