Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link | |
Registered User
Join Date: Sep 2019
Location: London
Posts: 11
|
x264 for Blu-ray - Video Underflows
Occasionally when compiling a Blu-ray project I get a warning that there are video underflow errors. Can anyone suggest a way to fix this?
I encode on an iMac 5k 27" (Big Sur) via terminal/ffmpeg. Blu-ray authoring is done using Sony DoStudio. A typical encode would be 30k/35k to 40k, with a buffer of 30k. Very slow, tune film. -c:v h264 -preset veryslow -tune film -b:v 30000k -maxrate 40000k -bufsize 30000k -level 4.1 -pix_fmt yuv420p -x264-params bluray-compat=1: open-gop=1:slices=4:keyint=24:colorprim=bt709:transfer=bt709:colormatrix=bt709: pass=1 (then pass=2) Quote:
![]() Last edited by RainbowThief; 24th November 2021 at 10:43. |
|
![]() |
![]() |
![]() |
#2 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,737
|
Try with:
Quote:
and then mux that file with Scenarist or whatever you're using to the BD. It should work. Last edited by FranceBB; 24th November 2021 at 19:28. |
|
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Sep 2019
Location: London
Posts: 11
|
Thanks for the feedback, I don't know what the AVSscript you have linked to is?
I'm not sure what actually causes a video underflow error - can somebody explain? Does it relate to the encoded 264 file, or a combination of all video and audio (and subtitle) streams? In my error message posted above, does this mean the error occurs just 2.54 seconds into the 94 minute video file? |
![]() |
![]() |
![]() |
#4 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,737
|
Quote:
About the buffer, looks like x264 is struggling to keep the bitrate within the constraints as there's something that caught it by surprise, which is weird considering that you're using a two pass encode so it should be prepared. Anyway please test with the parameters I gave you. |
|
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,262
|
Sometimes the issue is not only with video, but audio + video bitrate which goes too high. I had once the issue of muxing a Blu-Ray with Scenarist and according the audio i add to the video, run (or not) with buffer underflow. When it happens, i change [--vbv-maxrate 40000 --vbv-bufsize 30000] to [--vbv-maxrate 39000 --vbv-bufsize 29500]. If it's still happening, i go to [--vbv-maxrate 38000 --vbv-bufsize 29000]. You can also try [--vbv-maxrate 39900 --vbv-bufsize 29950], to see if it's not x264 just going a little out of spec...
Edit : You lack --bluray-compat --aud --min-keyint 1 --mvrange 511 --ref 4 --bframe 3 options for targetting Blu-Ray, and --level-force can be good also. Also, after a "talk" with mp3dom, it seems that in the very specific case of targetting Blu-Ray, disabling MBTree produce a little better results, so --no-mbtree can improve. Not mandatory, but --b-pyramid strict --open-gop can also improve.
__________________
My github. Last edited by jpsdr; 24th November 2021 at 19:07. |
![]() |
![]() |
![]() |
#10 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
x264 have too much bitrate oscillation and can easily go above 40 Mbps. Even if "theoretically" the stream is compliant (adhere to VBV restrictions), when muxing it can quite easily create over/underflows. Not to say that, when the things gets more complicated (i.e. multi-angle or different streams joined with seamless connection) it's a total mess of underflows and "invalid atc delta" errors. The solution is to lower the avg/max bitrate and/or vbv-bufsize, to make the bitrate spikes less frequent.
Last edited by mp3dom; 28th November 2021 at 02:16. |
![]() |
![]() |
![]() |
#12 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
dts stereo vs. lpcm stereo or dts 5.1ch vs. lpcm stereo?
This seems a bit odd, because there are only a very few instances where a dts file can be higher than lpcm (with same number of channels) and are mainly when you set the dts-core to have the same or higher bitrate than the lpcm itself. Last edited by mp3dom; 19th January 2022 at 00:51. |
![]() |
![]() |
![]() |
Tags |
blu-ray, ffmpeg, mac osx, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|