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?
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.013Have 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, whilefoo_bv50000_g24.mp4
gives 13.2 Mb/s, whilefoo_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