x264 encoded material in DVDA 5.0b

Sebaz wrote on 6/21/2010, 7:13 PM
Has anybody successfully authored a Blu-Ray in DVDA from video encoded with x264? It seems like an impossible task for me so far. In the Optimize Disc dialog it shows the video as compatible and with the green checkmark. However, when it starts building, it always stops with this error:

File name: STREAM/00001.m2ts
Status: TSWrapper.dll::CTSWrapper::ProcThreadMain::Video buffer underflows. -

So far no matter what I change in the encoding parameters, it will still stop with that error. The same files build just fine with Encore CS4. I would use Encore instead, but it sucks when it comes to setting a loop point. I tried the same project in both, and when I burned a BD-RE with DVDA, the menu starts playing and it goes smoothly through the loop point. When it finishes, it comes back to the loop point perfectly well. In Encore, when it comes to the loop point, it pauses for a couple of seconds, and it doesn't start exactly where I set the loop point, but a few frames after that. Note that the source is an uncompressed RGB AVI file, and both DVDA and Encore do the recompression. Also when it reaches the end and it goes back to the loop point, it also starts a few frames late. So for that reason I need to use DVDA, but I also need to encode with x264, because the AVC encoder in Vegas is rather poor in options and it tops at 16 Mbps, so it's not suitable for decent Blu-Ray material.

Here's my complete set of parameters copied from MeGUI, can anyone see what's wrong?

program --level 4.1 --pass 2 --bitrate 30000 --stats ".stats" --slow-firstpass --deblock -6:-6 --keyint 24 --min-keyint 2 --b-pyramid strict --vbv-bufsize 28000 --vbv-maxrate 29000 --no-fast-pskip --aud --nal-hrd vbr --output "output" "input"

This is for a 23.98 fps video at 30 Mbps, with the project set to BD25, so 30 Mbps is way below the top bitrate for a blu-ray disc.

Comments

musicvid10 wrote on 6/21/2010, 8:42 PM
I don't know the exact command line for MeGUI, but try Main@L3.1, b-frames off, 8x8dct off, hex motion estimation.

That is more or less nominal, if you can get it working there you can start adding in more advanced parameters. If you can get 2 b-frames working, pyramid is one of the last options I would test.

Also, deblock at -6,-6 is going to be pretty soft. Try -2,-1 as a starting point and work up or down from there.

I will test some Handbrake material in DVDA, I'm pretty sure I've gotten successful BD prepares while testing, but its been a while.
Sebaz wrote on 6/21/2010, 10:35 PM
Actually for 23.98 test material, it stopped giving me the error once I lowered the GOP to 16, and it finished building, although it was just a short test file, so I would like to see what happens when I try something longer.

My problem now comes with 29.97 interlaced video. Having seen the GOP size solution in the other footage, I lowered the template for 60i in MeGUI to 18-3 and even lower, such as 15-2 and 15-1. However, nothing seems to work. What I get now is quite different from the other error, it's this:

File name: STREAM/00000.m2ts

This happens with a one minute test file that I've encoded already with several different parameters. My current set, copied and pasted from MeGUI, is this:

--level 4.1 --pass 2 --bitrate 30000 --stats ".stats" --slow-firstpass --deblock -6:-6 --keyint 15 --min-keyint 1 --b-pyramid strict --weightp 0 --vbv-bufsize 29000 --vbv-maxrate 30000 --partitions all --no-fast-pskip --aud --nal-hrd vbr --tff

I did a search for "m_ptsOfNextGOP is empty" but very few results came up, and no answers. If I set a GOP of 30 and 3 or 2, it will give me a buffer underflow error, so I think the GOP has to stay low.

Can anyone think of what parameter I could modify to avoid this error? I've been encoding for hours to different ones trying to find the holy grail but nothing seems to work.

I'm trying to think what's the meaning of m_ptsOfNextGOP. It's obviously related to the GOP in some way, but all the different changes I made to GOP parameters didn't get rid of the error.

Thanks
musicvid10 wrote on 6/22/2010, 3:42 PM
Well, I ran a couple of tests, and Handbrake-encoded video prepares just fine to BD in DVDA. Both Main and High Profile material works.

So why don't you upload an example of your MeGUI-encoded video, and we'll compare them. Shouldn't be too hard, since they both use recent x264 codecs.
Sebaz wrote on 6/27/2010, 9:15 PM
Sorry it took a while to reply. Earlier today I saw that you had posted a reply, so I made a test file, just one minute long of 1080-60i video that I exported from Vegas in Lagarith YV12 (the color format used by x264) and I encoded it directly in the command line to the most current version of x264. The file and corresponding ac3 file are here:

http://www.megaupload.com/?d=57M3PFHB

http://www.megaupload.com/?d=1ZO3KWL9

Here's the full batch file that I made for the encoding:

x264 --bitrate 30000 --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --profile high --level 4.1 --keyint 15 --b-pyramid strict --slices 4 --tff --aud --fullrange on --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o "DVDA x264 test 15.264" "DVDA x264 test.avi"

x264 --bitrate 30000 --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --profile high --level 4.1 --keyint 15 --b-pyramid strict --slices 4 --tff --aud --fullrange on --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o "DVDA x264 test 15.264" "DVDA x264 test.avi"

The file produced gives the "- m_ptsOfNextGOP is empty." error in DVDA on build, despite showing with a green checkmark in the optimize dialog. I suppose it will also in your case, but please let me know either way.

Thanks
Sebaz wrote on 6/28/2010, 8:42 PM
John, thanks for the suggestion, but I encoded another test file at 25 Mbps and I still get the "m_ptsOfNextGOP is empty" error, obviously with both avc and ac3 files showing with a green check mark in the Optimize Disc module.

I read your other thread, but what happened to you didn't happen to me. I successfully authored a BD25 some time ago with a MPEG2 video that I had encoded at 35 Mbps and DVDA didn't give me any trouble.
musicvid10 wrote on 6/28/2010, 9:07 PM
Running MediaInfo on your video reveals a few higher level options are enabled, of the kind that break certain other apps.

I am going to start (when I have time), with a nominal set of x264 params (in Handbrake) that I know work in DVDA, then start adding yours in until I find which ones make DVDA unhappy.

A couple that have me suspicious (without having tested) are:
8x8dct=1
b_pyramid=1
weightb=1

Here is an excellent, but slightly dated, explanation of x264 options.
http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-x264.html#menc-feat-x264-encoding-options
Sebaz wrote on 6/29/2010, 8:40 AM
A couple that have me suspicious (without having tested) are:

I can try to disable 8x8dct and weightb, but b-pyramid strict seems to be part of the blu-ray spec, so it should stay on. As for weightb, I didn't include it in the batch file, did you mean weightp?
TeetimeNC wrote on 6/29/2010, 9:44 AM
Sebaz, you're way over my head on this BUT I'll share a couple thoughts that might be helpful.

1. I recall you shoot with an HMC40. If you are using footage from that cam how are you getting such high bit rate? I believe my 150 tops out at about 21Mbps.

2. I can drop my high-profile footage straight from my cam into DVDA and it will burn to BD. If I edit it first in Vegas I cannot burn to BD without recompress. This is a Vegas problem that SCS is aware of.

/jerry
Sebaz wrote on 6/29/2010, 10:20 AM
Well, I've changed the batch file to this:

x264 --bitrate 25000 --deblock -3:-3 --weightp 0 --no-weightb --bframes 3 --nal-hrd vbr --vbv-maxrate 25000 --vbv-bufsize 24000 --profile high --level 4.1 --keyint 15 --b-pyramid strict --slices 4 --no-8x8dct --tff --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 --slow-firstpass -o "Sandy's wedding nofull.264" "Sandy's wedding 032.avi"

x264 --bitrate 25000 --deblock -3:-3 --weightp 0 --no-weightb --bframes 3 --nal-hrd vbr --vbv-maxrate 25000 --vbv-bufsize 24000 --profile high --level 4.1 --keyint 15 --b-pyramid strict --slices 4 --no-8x8dct --tff --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 --slow-firstpass -o "Sandy's wedding nofull.264" "Sandy's wedding 032.avi"

And still get the same error.
Sebaz wrote on 6/29/2010, 12:22 PM
I also did another test with the above settings but with --b-pyramid none and still got the error.
BlackMax wrote on 9/26/2010, 1:53 PM
Try it again, this time with lastest build r1724. Also some simpler settings, note especially --b-pyramid none:

x264 --bitrate 25000 --keyint 24 --b-pyramid none --slices 4 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --tff --aud --colorprim bt709 --transfer bt709 --colormatrix bt709 --sar 1:1 --pass 2 --slow-firstpass -o "Sandy's wedding nofull.264" "Sandy's wedding 032.avi"

Have you been able to make any BDs w/DVDAP and x264, or does only the wedding video give you fits? Wondering about the ".avi" file as suspicious input...
musicvid10 wrote on 9/26/2010, 2:14 PM
Thanks for resurrecting this discussion. I was having trouble importing x264 file back into Vegas but found that a simple pass in AVIDemux fixed the problem.

I wonder if a simple remux will fix the problem in DVD Architect too?