[RESOLVED] DGAVCDecDI audio delay with video output from VideoReDo

Support forum for DGAVCDecDI
Post Reply
DAE avatar
chibiboi
Posts: 5
Joined: Sun Aug 04, 2013 12:08 pm

[RESOLVED] DGAVCDecDI audio delay with video output from VideoReDo

Post by chibiboi »

When I use DGAVCDecDI to decode a .TS file cut from VideoReDo, it usually always gives me a .AC3 audio that's -68ms but when I mux that with the an encoded mp4 version of the video, it seems to be too early. Is anyone else having this problem?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by admin »

The delay refers to the stream that will be served by the Avisynth script. You cannot assume it will be correct for some arbitrary stream that you want to use.
DAE avatar
chibiboi
Posts: 5
Joined: Sun Aug 04, 2013 12:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by chibiboi »

neuron2 wrote:The delay refers to the stream that will be served by the Avisynth script. You cannot assume it will be correct for some arbitrary stream that you want to use.
So I can't assume the delay it gives me is correct? I always assumed it was correct because the delays that DGIndex gives me for VOB files always sync perfectly with the video. But I discovered this wasn't the case with DGAVCDecDI. How will I be able to determine the proper audio delay for me TS files then?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by admin »

No, it is supposed to be correct, if you follow the process correctly. You haven't described your process in sufficient detail for me to know if you have done it properly.

Do this:

Make your project. Then make a script like this (use the appropriate audio delay):

LoadPlugin("...\DGAVCDecodeDI.dll")
video=DGSource("myfile.dgi")
audio=NicAC3Source("myfile.ac3",2).DelayAudio(-0.068)
AudioDub(video,audio)

Open the script in VirtualDub and assess the sync. If is is not correct then please post a link to the stream (first 100MB) so that I can try to reproduce it.
DAE avatar
chibiboi
Posts: 5
Joined: Sun Aug 04, 2013 12:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by chibiboi »

I've uploaded two samples here, both taken from the same capture and cut with VideoReDo.

The first clip starts off in the middle of the episode, and oddly shows a delay of 96ms (if i remember correctly). Sometimes, maybe 10% of the time, I get this value with DGAVCDecDI. The second clip shows a delay of -68ms (I get this 90% of the time). I THINK it has something to do with the headers that VideoReDo creates when cutting the .TS files, I'm not sure. But you'll notice the delay of -68ms is slightly off, a bit early. It's most noticeable during sound effects and during mouth-movements.

When I choose to encode the audio, I use MeGUI to encode the AC3 into AAC at default settings. I've found that if I enter 0 for the delay, rather than -68ms, the audio seems to sync fine. Although one thing I did notice is that the AC3 audio, according to MediaInfo, has a shorter duration than the .TS video file. And the AAC audio encoded with MeGUI has a duration between the demuxed AC3 audio and the .TS video file if I set encoding settings with delay of 0ms.

I've noticed that if I encode the video using the .dgi file, and I mux that .mp4 output with the untouched .ac3 audio using mkvmerge, with audio delay set at the value DGAVCDecDI tells me (-68ms in most cases), the audio will be more off-sync than if I were to mux the .aac audio, which I find strange.

Maybe you can help shed some light on this situation, thanks admin!
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by admin »

I looked at your -68ms clip.

1. Sync looks fine to me in the sample you provided.

2. Your sample is anime, which is very problematic to find reliable events that can be used to assess sync, especially with the music and voice overs that make audio waveform visualization difficult.

3. Watching the script gives sync that looks the same to as I get playing the TS directly in TotalMedia Extreme.

So I conclude that you haven't demonstrated any issue with my tools. If you believe the sync is off (using my method and not your involved process), then I can argue it is that way in the original TS.
DAE avatar
chibiboi
Posts: 5
Joined: Sun Aug 04, 2013 12:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by chibiboi »

OK, then maybe my problem is VideoReDo. Have you tried re-encoding the AC3 file into AAC? Could you tell me why the duration is different?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by admin »

chibiboi wrote:OK, then maybe my problem is VideoReDo. Have you tried re-encoding the AC3 file into AAC? Could you tell me why the duration is different?
I don't want to get involved with re-encoding, as my tools are not involved. Regarding the difference between the audio and video lengths, it could happen because the video and audio units have different durations. But then it would be less than or equal to an audio frame, i.e, 32ms. In the sample (without applying a delay correction), I get video length 1:03.26 and audio length 1:03.23, so the difference is 30ms, within the expected range. What difference are you seeing? MediaInfo may be getting things wrong.
DAE avatar
chibiboi
Posts: 5
Joined: Sun Aug 04, 2013 12:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by chibiboi »

It seems the issue is with VideoReDo, my apologies. I just trimmed a video, and opened it with VideoReDo, and compared the audio graph with the original source's audio, and it seems the trimmed clip's audio shifted forward.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAVCDecDI audio delay with video output from VideoReDo

Post by admin »

Thanks for the status update!
Post Reply