PDA

View Full Version : MeGUI: Weird exact -1000ms audio sync delay.


JakFrost
20th September 2008, 21:40
I'm encoding the Aeon Flux (Disc 1) DVD using MeGUI 0.3.0.2015 and I just came across a weird exact -1000 ms audio delay.

I wouldn't bother posting yet another "audio out of sync" thread except that the exactness of the -1000ms audio delay throughout the entire length of the video 1h 52m is puzzling and makes me think that there is a bug somewhere in there versus just a regular audio delay, then again this could be just a coincidence and there could actually be a delay like that that I'm having.

I manually checked the delay syncing the audio and the video playback to a video event when a character flicks open a knife and there is a sound effect at the 00:03:23 mark. When a -1000ms delay applied in the player or when re-muxing the entire MKV file with a manual delay applied to the audio track the sound effect comes perfectly on time. I used Media Player Classic 6.4.9.1 rv73 with FFDshow 2099 with DirectShow decoding and also VLC 0.8.6i with the internal decoding to verify and both confirm -1000ms audio delay that is necessary.

Video

I got the VOB files already ripped and when I check them out there is only 1 Cell listed so there are no additional blank cells causing the audio sync issues.

I use the "x264: Unrestricted 2pass Anime_Toons HQ" profile from the latest STx264 v80 release at 1500 bitrate to encode the video files.

The only thing of note that I can see from the VTS_01_*.VOB structure is that the first *0.VOB is only 58.4 MB with a single 2ch audio track that includes the Intro. The real episodes go from *1-6.VOB and are 1 GB each and they include a 6ch audio track, a 2ch audio track, and also a 2ch commentary track.

General
Complete name : VTS_01_0.VOB
Format : MPEG-PS
File size : 58.4 MiB
Duration : 3s 40ms
Overall bit rate : 161 Mbps

Video
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Standard
Duration : 49ms
Bit rate mode : Constant
Bit rate : 8 000 Kbps
Nominal bit rate : 8 000 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4/3
Frame rate : 29.970 fps
Standard : NTSC
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.772

Audio
Format : AC-3
Format/Info : Audio Coding 3
Duration : 3s 40ms
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

Text
Format : RLE
Format/Info : Run-length encoding

Menu
Format : DVD-Video

General
Complete name : VTS_01_1.VOB
Format : MPEG-PS
File size : 1 024 MiB
Duration : 3mn 58s
Overall bit rate : 35.9 Mbps

Video
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Standard
Duration : 3mn 58s
Bit rate mode : Constant
Bit rate : 32.6 Mbps
Nominal bit rate : 8 000 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4/3
Frame rate : 29.970 fps
Standard : NTSC
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.772

Audio #1
Format : AC-3
Format/Info : Audio Coding 3
Duration : 3mn 58s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Rear: L R, LFE
Sampling rate : 48.0 KHz

Audio #2
Format : AC-3
Format/Info : Audio Coding 3
Format profile : Dolby Digital
Duration : 3mn 58s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

Audio #3
Format : AC-3
Format/Info : Audio Coding 3
Format profile : Dolby Digital
Duration : 3mn 58s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

Menu
Format : DVD-Video

2008-05-17 04:04 PM 110,592 VTS_01_0.IFO
2008-05-20 09:58 PM 61,286,400 VTS_01_0.VOB
2008-05-20 11:42 PM 1,073,739,776 VTS_01_1.VOB
2008-05-20 11:41 PM 1,073,739,776 VTS_01_2.VOB
2008-05-20 11:38 PM 1,073,739,776 VTS_01_3.VOB
2008-05-20 11:40 PM 1,073,739,776 VTS_01_4.VOB
2008-05-20 11:34 PM 1,073,739,776 VTS_01_5.VOB
2008-05-20 11:43 PM 1,063,460,864 VTS_01_6.VOB



Audio

MeGUI uses DGindex 1.5.2 for demuxing AC3 audio during D2V file production and it shows 0ms for delay for both the 6ch and 2ch audio tracks. I tried manual demuxing myself with DGindex and same result, 0ms for both 6ch and 2ch AC3 tracks.

I create the D2V file for the Intro *1.VOB then separately I create a D2V file for *1-6.VOB for the rest of the episodes. If I don't do it this way and create one D2V for 0-6.VOB I get massive audio sync issues since DGindex gets confused going from audio track T80 as 2ch 192Kbps in 0.VOB to 6ch 448Kbps in 1-6.VOB.

2008-09-11 02:35 PM 4,112,640 VTS_01_0 T80 2_0ch 192Kbps DELAY 0ms.ac3

2008-09-20 01:51 AM 376,830,720 VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3
2008-09-20 01:51 AM 161,498,880 VTS_01_1 T81 2_0ch 192Kbps DELAY 0ms.ac3
2008-09-11 02:43 PM 130,760,448 VTS_01_1 T82 2_0ch 192Kbps DELAY 0ms.ac3

General
Complete name : VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.ac3
Format : AC-3
Format/Info : Audio Coding 3
File size : 359 MiB
Duration : 1h 52mn
Overall bit rate : 448 Kbps

Audio
Format : AC-3
Format/Info : Audio Coding 3
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Rear: L R, LFE
Sampling rate : 48.0 KHz

General
Complete name : VTS_01_1 T81 2_0ch 192Kbps DELAY 0ms.ac3
Format : AC-3
Format/Info : Audio Coding 3
File size : 154 MiB
Duration : 1h 52mn
Overall bit rate : 192 Kbps

Audio
Format : AC-3
Format/Info : Audio Coding 3
Format profile : Dolby Digital
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

MeGUI uses NeroAacEnc.exe 1.1.34.2 (Aug 6 2007) to encode using the two profiles below.

2ch -> Nero AAC: NDAAC-HE-64Kbps
6ch -> Nero AAC: NDAAC-HE-MultiChannel-160Kbps

The options chosen are below. The first option is disabled to ensure that there is no DirectShow filter being used that could be responsible for adding the delay and also to ensure that the filter doesn't downmix 6ch to 2ch, as FFDshow's Mixer does by default.

[_] Force Decoding via DirectShow
Output Channels [ Keep Original Channels ]
[X] Increase Volume Automatically
[X] Improve Accuracy using 32bit & Float computations
[O] Adaptive Bitrate @ ## kbit/s
AAC Profile: Automatic

The resulting encoded files are below.

General
Complete name : VTS_01_1 T80 3_2ch 448Kbps DELAY 0ms.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 131 MiB
Duration : 1h 52mn
Overall bit rate : 164 Kbps
Encoded date : UTC 2008-09-13 09:18:04
Tagged date : UTC 2008-09-13 09:34:02
Writing application : Nero AAC codec / Aug 6 2007

Audio
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : Yes
Format settings, PS : No
Codec ID : 40
Duration : 1h 52mn
Bit rate mode : Variable
Bit rate : 163 Kbps
Maximum bit rate : 259 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Rear: L R, LFE
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 131 MiB (100%)
Encoded date : UTC 2008-09-13 09:18:04
Tagged date : UTC 2008-09-13 09:34:02

Chapters
1 : 00:00:00.097 -

General
Complete name : VTS_01_1 T81 2_0ch 192Kbps DELAY 0ms.mp4
Format : MPEG-4
Format profile : 3GPP Media Release 6 Basic
Codec ID : 3gp6
File size : 52.9 MiB

Duration : 1h 52mn
Overall bit rate : 66.0 Kbps
Encoded date : UTC 2008-09-20 06:57:12
Tagged date : UTC 2008-09-20 07:02:40
Writing application : Nero AAC codec / Aug 6 2007

Audio
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : Yes
Format settings, PS : No
Codec ID : 40
Duration : 1h 52mn
Bit rate mode : Variable
Bit rate : 66.15 Kbps
Maximum bit rate : 90.4 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 52.3 MiB (99%)
Encoded date : UTC 2008-09-20 06:57:12
Tagged date : UTC 2008-09-20 07:02:40

Chapters
1 : 00:00:00.097 -



Muxing

I use MeGUI's MKV muxer option or manually MKVMerge GUI 2.3.0 to mux the video, the 6ch audio, and also the 2ch commentary into one track. I also tried muxing the encoded video and the original AC3 6ch audio and 2ch commentary tracks and the delay is present there also. This one fact makes me think that maybe the problem lies somewhere at the beginning with DGindex not calculating the delay correctly.

I thought it might have been MKVMerge or the "AAC is SBR/HE-AAC/AAC+" option but that's not the case since the HE-AAC files are inside the .MP4 container so that's not the issue.

Audio Sync Verification

I re-ran the DGindex project this time with "Log Timestamps" option enabled and I checked the audio tracks 80, 81, 82 for sync and came out with these results.

The only thing unusual that I see is that after the first to references the delay shows up at around ~-300ms for the 6ch track and ~250ms for the 2ch track but the demuxed AC3 filenames all show 0ms delay.

I calculated the average delay and median values for all three tracks without the first two 0ms references and the results are below. They are nowhere near the -1000ms that I found manually.


Track Average Median
80 -253.5243978 -270
81 -182.6696942 -191
82 -181.6613513 -190


Delay Analysis Output (Audio ID 80)

Decode picture: temporal reference 0
delay = 0
Decode picture: temporal reference 0[I]
delay = 0
Decode picture: temporal reference 2[I]
delay = -308
Decode picture: temporal reference 2[I]
delay = -297
Decode picture: temporal reference 2[I]
delay = -285
.
.
.
Decode picture: temporal reference 2[I]
delay = -294
Decode picture: temporal reference 2[I]
delay = -282
Decode picture: temporal reference 2[I]
delay = -303


Delay Analysis Output (Audio ID 81)

Decode picture: temporal reference 0[I]
delay = 0
Decode picture: temporal reference 0[I]
delay = 0
Decode picture: temporal reference 2[I]
delay = -244
Decode picture: temporal reference 2[I]
delay = -233
Decode picture: temporal reference 2[I]
delay = -221
.
.
.
delay = -230
Decode picture: temporal reference 2[I]
delay = -218
Decode picture: temporal reference 2[I]
delay = -239


Delay Analysis Output (Audio ID 82)

Decode picture: temporal reference 0[I]
delay = 0
Decode picture: temporal reference 0[I]
delay = 0
Decode picture: temporal reference 2[I]
delay = -244
Decode picture: temporal reference 2[I]
delay = -233
Decode picture: temporal reference 2[I]
delay = -221
.
.
.
delay = -230
Decode picture: temporal reference 2[I]
delay = -218
Decode picture: temporal reference 2[I]
delay = -239


[I]So what is going on?

setarip_old
21st September 2008, 01:43
I got the VOB files already rippedWhat software and procedures did you use to "rip" your original DVD?

JakFrost
21st September 2008, 03:51
I do not know how the original DVD's were ripped. How does that have any effect on the -1000ms delay even after checking that there are no extraneous cells listed in the IFO's?

JakFrost
21st September 2008, 07:47
I'll get the original DVDs back from my friend when I see him again in a few days and I'll re-rip them again with DVD Fab HD decrypter like you said.

But my question is, if this is not the fault of the rip, what could be the cause of this exact -1000ms audio delay when all the stuff I tried DGindex shows 0ms or ~-253ms delay and there is nothing here pointing to -1000ms?

JakFrost
21st September 2008, 20:45
New day new idea. I started thinking of this problem, VOB in sync, demux/encode out of sync. I want to find the root cause before I have to rip the DVDs again.

So an idea came to me today after reading another thread this morning about a sync problem: Transcode from MPEG2 to x264 vie MeGUI, strange sync problem. Neuron2 mentioned an obvious work around, start the project a few GOPs into the video instead of right at the beginning.

I immediately remembered the delay analysis output where the first two I-frame references had a delay of 0ms and everything after was showing normal ~-200-300ms delay values as should be seen in any video. Also the AC3 filenames had 0ms delay even though throughout the analysis there was a constant delay throughout the references.


Delay Analysis Output (Audio ID 80)

Decode picture: temporal reference 0[i]
delay = 0
Decode picture: temporal reference 0[i]
delay = 0
Decode picture: temporal reference 2[i]
delay = -244
Decode picture: temporal reference 2[i]
delay = -233


So, I fired up DGindex again and jumped 2 GOPs ahead, marked the start and end, and re-indexed the 1-6.VOBs with timestamps logged.

I ran the analysis again and came out with this much better looking result.


Delay Analysis Output (Audio ID 80)

Decode picture: temporal reference 2[I]
delay = -230
Decode picture: temporal reference 2[I]
delay = -218
Decode picture: temporal reference 2[I]
delay = -239
Decode picture: temporal reference 2[I]
delay = -227


The demuxed audio filenames also look better with actual delay values inserted into them.


2008-09-21 01:56 PM 376,678,400 VTS_01_1 T80 3_2ch 448Kbps DELAY -230ms.ac3
2008-09-21 01:56 PM 161,433,504 VTS_01_1 T81 2_0ch 192Kbps DELAY -166ms.ac3
2008-09-21 01:56 PM 130,695,072 VTS_01_1 T82 2_0ch 192Kbps DELAY -166ms.ac3


I created another AviSynth script and did an Analyze only to be surprised to find that the auto-detected interlace settings have now completely changed from the original values.


DGDecode_mpeg2source("VTS_01_1 (Original).d2v",info=3)
ColorMatrix(hints=true,interlaced=true)
tfm(order=1).tdecimate(hybrid=1)
#crop
#resize
Undot() # Minimal Noise



DGDecode_mpeg2source("VTS_01_1 - 2 GOPs Skipped.d2v",info=3)
ColorMatrix(hints=true,interlaced=true)
tfm(order=0).tdecimate()
#crop
#resize
Undot() # Minimal Noise


I adjusted the chapters to be one second before the previous timestamps. Then I did an AutoEncode job with a 2 CD (1.4MiB) ~1743kbps bitrate and the two audio tracks as HE-AAC 6ch 160kbps and 2ch 64kbps commentary and let it run.

I'll see the results later today and we'll see if this solves the issue. I hope so since I would rather like to find the root cause of the problem and a solution than have to re-rip and end up with the same issue after that only to be scratching my head.

neuron2
21st September 2008, 23:21
I do not know how the original DVD's were ripped. Closed for rule 6 violation.