0

Trying to combine an audio and picture to mp4 I can hit my target bitrate:

ffmpeg -y \
-loop 1 -r 4 -i ./image.jpg \
-stream_loop -1 -i ./audio.mp3 \
-vcodec libx264 -pix_fmt yuv420p \
-filter:v "crop=2560:1440:0:0" \
-video_size 2560x1440 \
-b:v 13000k -minrate 13000k -maxrate 16000k -bufsize 26000k \
-preset ultrafast \
-tune stillimage \
-b:a 128k -ar 44100 -ac 2 -acodec aac \
-af "dynaudnorm=f=150:g=15" \
-r 30 -g 60 \
-f flv tmp.flv

When i change the output container from mp4 to flv the bitrate drops

ffmpeg -y \
-loop 1 -r 4 -i ./image.jpg \
-stream_loop -1 -i ./audio.mp3 \
-vcodec libx264 -pix_fmt yuv420p \
-filter:v "crop=2560:1440:0:0" \
-video_size 2560x1440 \
-b:v 13000k -minrate 13000k -maxrate 16000k -bufsize 26000k \
-preset ultrafast \
-tune stillimage \
-b:a 128k -ar 44100 -ac 2 -acodec aac \
-af "dynaudnorm=f=150:g=15" \
-r 30 -g 60 \
-f mp4 tmp.flv

When I write to tmp.flv; the bitrate drops to about 1500k but with the tmp.mp4 the bitrate stays close to what I describe with the -b:v 13000k

Why does flv cause the bitrate to drop so low?

ohroblot
  • 45
  • 4
  • Both of your commands are identical. – llogan Jan 16 '21 at 22:22
  • I made a quick edit, the main difference between the commands are one is `-f flv tmp.flv' and the other is `-f mp4 tmp.mp4`, even doing further testing doing `-f mp4 tmp.flv` the encoding bitrate stays at the suggested but changing the output to `-f flv tmp.flv` the bitrate drops down between 1600kbits/s and 1900kbits/s – ohroblot Jan 17 '21 at 09:01
  • the issue seems to be somehow related to the `-g` option, removing that and the bitrate will increase. If i lower `-g` that works a little but I cannot maintain the desired bitrate. Also if I replace `-g with -keyint_min` this helps to raise the bitrate but not enough to reach the target bitrate. Any idea why these options affect the encoding bitrate? – ohroblot Jan 17 '21 at 17:59

0 Answers0