r.mirzojonov
r.mirzojonov

Reputation: 1249

How to specify bit rate while using concatenating videos?

I've been trying to write ffmpeg command that would take 3 mp4 videos(intro, main, outro) and 1 image (logo) then it would resize intro and concatenate them while adding logo to main video.

ffmpeg -i intro.mp4 -i main.mp4 -i outro.mp4 -i logo.png -filter_complex "[0:v]scale=1280:720,setsar=sar=1[scaled]; [1][3]overlay=5:5[main]; [scaled][0:a][main][1:a][2:v][2:a]concat=n=3:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -c:a aac output.mp4

So far this works fine, but when I try to specify the bit rate of output file. Here it says that I need to use Two-pass method but I don't know to correctly apply that method in my case, because the example shown there uses only 1 video while mine concatenates them. Should I even use two-pass method or is there any other way to specify bit rate?

Upvotes: 2

Views: 1521

Answers (1)

Gyan
Gyan

Reputation: 93068

The default CRF method is recommended.

Default value for CRF is 23. You can set that manually. Lower values provide greater quality but larger file sizes. 18-28 is the recommended range.

You can set a manual bitrate as well. 2-pass not needed but advised.

ffmpeg -i intro.mp4 -i main.mp4 -i outro.mp4 -i logo.png -filter_complex "[0:v]scale=1280:720,setsar=sar=1[scaled]; [1][3]overlay=5:5[main]; [scaled][0:a][main][1:a][2:v][2:a]concat=n=3:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -c:v libx264 -b:v 1500k -c:a aac output.mp4

Upvotes: 3

Related Questions