FFMPEG invocation to output mp4 with video bitrate >15mbps

0

I am attempting to deliver a 30 second 1920x1080 @ 23.976fps animation video in h264 mp4 to a distributor that has a strict requirement that the video bitrate be greater than 15Mb/s.

The animation has very little detail and little motion, with large areas of solid color. It compresses very efficiently. So efficiently, in fact, that it's actually hard to get the video bitrate up to the distributor's specification.

With ffmpeg 3.0, I successfully used the following invocation to get the video datarate above 15Mb/s:

ffmpeg -i foo.mov -c:v libx264 -preset veryslow -crf 0 -c:a aac -b:a 320k foo.mp4

But that invocation stopped achieving the desired result when I upgraded to ffmpeg 4.1.3, so I switched to:

ffmpeg -i foo.mov -c:v libx264 -b:v 50000K -c:a aac -b:a 320k foo.mp4

which has often worked to get above 15Mb/s but not consistently for all input files.

I have tried

-profile:v high444

-level 5.0

-tune animation

-minrate 20000K

but none have gotten the compressor to stop being so dang efficient.

I have a new animation video that is resisting all ffmpeg 3 and ffmpeg 4 invocations to get its video rate above 15Mb/s. (My successful cheat is to upres the source file to 3840x2160 before running it through ffmpeg, but it seems there should be a better way.)

So my question is: what are some other parameters to specify in the ffmpeg invocation to micromanage the compressor to drive UP the video datarate?

JohnPilgrim

Posted 2019-08-06T20:20:54.390

Reputation: 1

Use your 2nd command with -g 24 added. That'll force a keyframe every second. – Gyan – 2019-08-06T21:18:12.247

-g 24 helped: the datarate went from 11.9 Mb/s to 13.2 Mb/s, but still doesn't meet the requirement. – JohnPilgrim – 2019-08-06T21:40:53.237

adding -intra to the second command was the solution: got the datarate up to 32.7 Mb/s on my test file. – JohnPilgrim – 2019-08-06T21:42:33.013

Have you tried adding the minrate in aspect of "m" as well as apply a buffersize? – Chris – 2019-08-06T20:52:57.857

No need to do -intra. Reduce -g value to half the framerate. – Gyan – 2019-08-07T04:39:19.727

foo_bv50000_g12.mp4 gives 14.7 Mb/s, while

foo_bv50000_g24.mp4 gives 13.2 Mb/s, while

foo_bv50000_intra.mp4 gives 32.7 Mb/s, so neither -g 12 nor -g 24 achieve the criteria with my sample file. I suppose I could keep walking downward the keyframe interval until the datarate got above 15Mb/s, but -intra requires less hand tuning. – JohnPilgrim – 2019-08-07T21:07:32.477

Answers

0

Instead of using the constant/variable rate process, try a quality target. I think the following post on Superuser could be what you need.

Variable bit rates with "-vb" and "minrate"/"maxrate" settings in FFmpeg

Chris

Posted 2019-08-06T20:20:54.390

Reputation: 1

-crf 0 often did work for my purposes in ffmpeg 3.x but stopped working for my purposes in ffmpeg 4.x:
ffmpeg foo.mov -c:v libx264 -preset veryslow -crf 0 -c:a aac -b:a 320k foo_crf0_ffmpegX.mp4 gives

foo_crf0_ffmpeg3.mp4 9480 kb/s --versus--

foo_crf0_ffmpeg4.mp4 3389 kb/s – JohnPilgrim – 2019-08-06T21:50:58.427

Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

– bertieb – 2019-08-07T13:29:20.190

0

adding -intra to the second command was the solution: got the datarate up to 32.7 Mb/s on my test file, up from 11.9 Mb/s

ffmpeg -i foo.mov -c:v libx264 -intra -b:v 50000K -c:a aac -b:a 320k foo.mp4

JohnPilgrim

Posted 2019-08-06T20:20:54.390

Reputation: 1