MP4 bitrate capping


When compressing the video in MP4, it would be great to cap the video bitrate.
For instance, I have set compression factor of 15, and the average bitrate is 30MBps.
But, it happened to bump to 60 or even 84MBps once in this video.

If we want to make a Blu-Ray-compliant video, capping the bitrate to 40MBps would be a good idea.


1 Like

So right now they use CRF which is generally the best bitrate control mode for h264/h265. The problem is you have no guarantee the bitrate conforms to blu-ray standards which are quite strict. Topaz also is using x264 as the transcoder. I checked with mediainfo on a test output and they aren’t setting blu-ray compatibility
nr=0 / decimate=1 / interlaced=0 / **bluray_compat=0** / constrained_intra=0 / bframes=0 / weightp=0 / keyint=12 / keyint_min=1 /

The audio is also transcoded as 96kbit aac-lc. Which is on the low end of quality for AAC, probably sounds like a160kbit mp3. It also transcodes the audio regardless of the original format which could reduce the quality.

I think it would be better to output as prores and then transcode with a blu-ray preset on something like premiere or x264 manually.

These are really usefull infos, thanks a lot!

However, it would be great to include more options to the MP4 encoding within VEAI.

I will explore the ProRes => ffmpeg x286 solution in the meantime.

It would be very convenient but imagine how much effort it would be to add all the options for x264 transcoding, probably have some profile selector where you can pick “blu-ray”. On the other hand they could continue work on improving the primary function of noise reduction/upscaling. Honestly I think they should just offer prores, tiff 8/16, and png. I was also going to put a feature request in for UT video support so there was a lossless video output.

They can’t implement all options for sure!
But a bit more options than just the CRF option would be enough.
However, removing video compression feature for h264 is not a good idea because not user friendly.

I prefer lossless, that way you could simply reencode your AI-generated file with a dedicated outside encoder which has plenty of advanced settings such as handbrake and my favorite, Avidemux; at least you’ll have a lossless original AI encoded video to work with.

I think it’s a brilliant setup that they have now as that way they can focus on model functionality instead, but yeah, it would be nice to have a suite of encoding formats and advanced settings, but just as long as you have access to lossless encoding, you should be set!

EDIT: Note, I’m still new to the program and encoding in general, but it is my understanding that the 0 setting for x264 CRF is lossless, so correct me if I’m wrong…

A few more options would be great, including direct audio stream copy.

For now, I am using this combination:

  • save video in .mov ProRes
  • then use ffmpeg to encode/compress to the mp4 output file with perfect settings for me (no artefacts and Blu-Ray compliant).

For those who are interrested, I can post ffmpeg settings I use.

1 Like

Sure, I’m interested in seeing your settings!

There you go:
ffmpeg -i -c:v libx264 -profile:v high -level 41 -pix_fmt yuv420p -preset medium -crf 12 -g 24 -vf setsar=sar=1/1 -threads 8 -x264opts bluray-compat=1:vbv-bufsize=16000:vbv-maxrate=31500 output.mp4
Please note that there are a few settings I picked up from Internet, but I don’t know what they do :wink:
As you can see, I use the CRF 12 value, and 24 frames between keyframes. Also, change number of threads according to your CPU.

Then, to create a full Blu-Ray structure (also allows me to simply add audio streams), I use justdan96’s version of tsMuxeR (available on all OSes, also supports 4K files).

Hope this helps.

1 Like

Thanks for the settings and another cool encoder prog that I can play with!

EDIT: I also just bought Video Proc and thank Fvck it has adjustable GOP, it may not be as robust and detailed as Avidemux’s settings but the added video downloader/video capture is worth it, and it’s pretty damn fast to boot, a 3:55 minute 4k video took only 3:55 minutes to complete!