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.

 

Go Back   Doom9's Forum > General > DVD2AVI / DGIndex

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd December 2012, 18:36   #1  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
DGIndex is NOT showing delay in AC3 file when video has delay

Example: Here's a 1.4GB MPEG2. When you save a project of it with DGIndex then remux the video and AC3 file, the video has an audio delay - most obvious at the end of the video when the guys are talking. Yet the AC3 file has no delay mentioned in the file name. The same things happens in DGDecNV. The MPEG2 file did not have a delay until a project of it was saved with DGIndex.

Also try saving a project using the video demux option then immediately remux the files and you can see the delay at the end of the video as mentioned before.
VideoFanatic is offline   Reply With Quote
Old 2nd December 2012, 18:41   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
The delay is calculated at the beginning of the stream. Many things can happen within the stream, or due to your handling of it, to throw off sync.

I'd be willing to have a look at your stream and see if I can identify anything. But you'll have to use a host that doesn't require me to sign up. One option is mediafire.com.
Guest is offline   Reply With Quote
Old 2nd December 2012, 18:48   #3  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
I don't understand what the problem is. Don't you have a Microsoft live account? If so, you can sign in to download the file. I'm sorry I didn't realize before using SkyDrive that you had to sign in to download a file. I really don't want to have to upload the file again and split it up for MediaFire, it already took me several hours to upload it to SkyDrive.
VideoFanatic is offline   Reply With Quote
Old 2nd December 2012, 19:35   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
I don't want to give Microsoft my email and other personal details.

If the issue is important to you, then you'll do what you need to get help from people that can help you, and you won't ask them to jump through hoops to help you.

Is it clear enough now?

Send me your sign-in details and I'll use your account.
Guest is offline   Reply With Quote
Old 2nd December 2012, 23:09   #5  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Thank you for the account details. I am downloading it now...
Guest is offline   Reply With Quote
Old 3rd December 2012, 03:06   #6  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
The stream has apparently been edited. What did you use to make the cuts/edits? There are a lot of ways to screw up audio sync at cuts/joins.
Guest is offline   Reply With Quote
Old 3rd December 2012, 15:01   #7  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
I used VideoRedo. Just wondering, does DGIndex only cause the delay in the AC3 file and not the video file? If I get a delay in the AC3 file, when muxing back, could I instead just demux the video before I used DGIndex on it and then mux the DGIndex video with the AC3 file I demuxed which doesn't have a delay? Then I won't get a delay will I?
VideoFanatic is offline   Reply With Quote
Old 3rd December 2012, 15:49   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by holygamer View Post
I used VideoRedo.
I have to assume that screwed things up. Another possibility is you had commercials with different audio and that weren't cut out properly.

Quote:
Just wondering, does DGIndex only cause the delay in the AC3 file and not the video file?
DGIndex does not cause any delay, so you lost me here.

Quote:
If I get a delay in the AC3 file, when muxing back, could I instead just demux the video before I used DGIndex on it and then mux the DGIndex video with the AC3 file I demuxed which doesn't have a delay? Then I won't get a delay will I?
I don't fully follow you, so why not go ahead and try that?

DGIndex doesn't add or delete anything so it can't cause any delay. It just reports what it finds according to the PTS timestamps at the start of the stream.
Guest is offline   Reply With Quote
Old 3rd December 2012, 19:23   #9  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Quote:
Originally Posted by neuron2 View Post
The stream has apparently been edited. What did you use to make the cuts/edits? There are a lot of ways to screw up audio sync at cuts/joins.
Yes I made several cuts using VideoRedo h264. It muxes instead of Re-encoding. In VideoRedo option under Stream Parameters I select Resync - Insert Extra Video Frames (the other option is Resync - Remove Audio frames). Then I saved the video. Then I saved the project in DGIndex. DGIndex caused the delay in the ac3 file which was not in the original MPEG2 but what's worse is that it didn't mention the delay in the ac3 file name.

If before I saved the project I saved the video again in VideoRedo then the pop up which shows when the video has finished saving would have told me that "x amount of video resync frames were removed" (it's only about 8 frames) and then saved the project then I wouldn't get a delay.

The other option in VideoRedo is to Resync - Insert Remove Audio frames however if I do that and then save the video twice, no video resync frames were removed and I get a delay with DGIndex. Whatever option I choose, there are no problems with the sync or anything else in the finished MPEG2 file. I can make a DVD with the MPEG2 or whatever and there are no problems. But if I take that MPEG2 and save a project in DGIndex then the demuxed AC3 file has a delay. Therefore it's DGIndex that's causing the problem. If I demux the MPEG2 file in TSMuxer then mux the AC3 and video file from that back into an MPEG2 - I don't get a delay.
VideoFanatic is offline   Reply With Quote
Old 3rd December 2012, 21:11   #10  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by holygamer View Post
If I demux the MPEG2 file in TSMuxer then mux the AC3 and video file from that back into an MPEG2 - I don't get a delay.
I'll try to duplicate that with your sample tonight. But I tell you again, DGIndex does not add or remove any audio. It's possible that tsmuxer is correcting a PTS discontinuity. I'll know more tonight.
Guest is offline   Reply With Quote
Old 4th December 2012, 14:50   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
I tried your scenario. I demuxed the audio and video, once with DGIndex and once with tsmuxer. The video streams contained the exact same number of frames and the audio streams were binary identical.

So the ball's back in your court. Maybe your muxing is causing problems?

Last edited by Guest; 4th December 2012 at 16:31.
Guest is offline   Reply With Quote
Old 4th December 2012, 22:33   #12  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
This is what I did:

1: Saved Project & Demux Video of MPEG2 with DGIndex. The AC3 file DGIndex makes has no delay in the file name. However if you remux the AC3 & video file with TSMuxer you can see that the audio is not in sync at the end of the video by watching the man talking. The MPEG2 file was in sync before I saved the project with DGIndex. Are you saying you did this and you don't have any sync problems?

2. Instead of saving a project with DGIndex if you just demux the MPEG2 with TSMuxer then mux the files back then you don't get any sync problems (obviously.)
VideoFanatic is offline   Reply With Quote
Old 5th December 2012, 01:43   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
The streams demuxed by both tools are identical!

Just for fun I tried remuxing with tsmuxer the audio and video demuxed by tsmuxer. The result was out of sync at the end. You said obviously they are still in sync, but did you actually try it?

I tried again with Manzanita Muxer (a professional tool). Same result.

Your editing has screwed things up. As long as you play the original MPG file it is OK, because the PTS timestamps are there to ensure sync. Once you demux, those timestamps are lost.
Guest is offline   Reply With Quote
Old 5th December 2012, 02:03   #14  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Quote:
Originally Posted by neuron2 View Post
Your editing has screwed things up. As long as you play the original MPG file it is OK, because the PTS timestamps are there to ensure sync. Once you demux, those timestamps are lost.
I said DGIndex gives an out of sync AC3 file when you remux which you confirmed.

What I said was obvious was that if I just demux the MPEG2 (which hasn't been touched by DGIndex) with TSMuxer then mux back then the video is in sync.

Also you said the timestamps which ensure sync are lost once you demux yet how come I can demux and remux with TSMuxer and the video is still in sync?

Anyway you've confirmed that it's DGindex causing the problem. Would you be able to fix it so that it just demuxes like TSMuxer without causing an audio delay in the AC3 file?

How could my editing screw things up? I just marked sections of the video I wanted to cut then saved the video. The only option in VideoRedo for "detect / resync missing frames" is "Resync - Insert extra video frames" or "Resync - Remove Audio Frames". Whatever option I choose, I get a delay in the AC3 file generated by saving the project in DGIndex even though the MPEG2 was in sync before I saved the project.

I haven't seen a better program than VideoRedo h264 which allows you to mux instead of Re-encoding, which saves a 1 hour 30 min video in 1 minute and which is easy to make simple cuts in. I can mark chapter points as well for use in MultiAVCHD. If you know of a better program then please let me know.

Last edited by VideoFanatic; 5th December 2012 at 02:08.
VideoFanatic is offline   Reply With Quote
Old 5th December 2012, 04:47   #15  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by holygamer View Post
Anyway you've confirmed that it's DGindex causing the problem.
Hey pal, I never confirmed any such thing. You misrepresent me while totally missing my point.

Last edited by Guest; 5th December 2012 at 15:10.
Guest is offline   Reply With Quote
Old 5th December 2012, 05:16   #16  |  Link
an3k
Registered User
 
an3k's Avatar
 
Join Date: Oct 2006
Location: Omicron Persei 8
Posts: 180
I already have used DGIndex(NV) for far more than 1000 videos. Last week I started converting many of my DVDs and BDs (~60) for vacation and I only got two asynchronous demuxes. The async ones are little bit crappy recordings from concerts. What I want to say is that I got async audio out of DGIndex but not because of that software but because of the crappy source files.
If DGIndex would cause the async all or at least most of my demuxes had to be async.

Is the whole video async at the same level or does it increase towards the end of the video?

Quote:
Originally Posted by holygamer View Post
Yes I made several cuts using VideoRedo h264. It muxes instead of Re-encoding. In VideoRedo option under Stream Parameters I select Resync - Insert Extra Video Frames (the other option is Resync - Remove Audio frames). Then I saved the video. Then I saved the project in DGIndex. DGIndex caused the delay in the ac3 file which was not in the original MPEG2 but what's worse is that it didn't mention the delay in the ac3 file name.
And why do you do this BEFORE remuxing? First get your raw streams, then re-encode them if you want and finally mux them. Now you can add cuts and such stuff to the newly muxed file.

I think that VideoRedo is causing the delay because you enabled "Resync - Insert Extra Video Frames". Either it adds unnecessary video frames (and doesn't tell you) - which is fine as long that file is not demuxed - or it just adds a bit crap here and there into the container which then cause other (de)muxers to struggle. Perhaps the enabled option itself causes the problem or the software at all.

I'll download your file and test it myself with DGIndexNV, TSMuxer and Avisynth but not now because its 5am and I'm tired!
an3k is offline   Reply With Quote
Old 5th December 2012, 05:39   #17  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
The problem is that an arbitrary cut cannot exactly match the start of both an audio and video object. They have different time granularities. If you truncate partial audio frames at video cut points, a progressive desync results that manifests itself when presentation timestamps are lost through demuxing.

Quote:
Originally Posted by an3k View Post
And why do you do this BEFORE remuxing? First get your raw streams, then re-encode them if you want and finally mux them. Now you can add cuts and such stuff to the newly muxed file.
This is really great advice! Bravo. It gives a way to avoid the problem I described above.
Guest is offline   Reply With Quote
Old 7th December 2012, 12:04   #18  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Quote:
Originally Posted by neuron2 View Post
Hey pal, I never confirmed any such thing. You misrepresent me while totally missing my point. And now sadly I have run out of available time to help you.
Here's a new version of the video test I posted earlier.


Neuron2 - I'm sorry I misread what you said. I wasn't trying to be clever with anything I said and I really would like to know if there's a better editor than VideoRedo!

I thought you said when you remuxed the DGINdex demuxed files that the audio was out of sync but you actually said when you demuxed the MPEG2 (I posted earlier) with TSMuxer and then muxed back - the audio was out of sync. Is that correct? I guess my eyes just saw what they wanted to see - if I demux the MPEG2 with TSMuxer then remux - you are correct - the audio is out of sync.

Yes I could just encode the video first, mux back and THEN make my cuts however that would increase the encoding time because when you encode several 2 hour videos a day and each 1 has 30 minutes of commercials then that takes a long time to encode unless you cut them out beforehand. Hasn't anyone else who's edited a video and saved a project in DGIndex reported this sync problem before or do most people just encode first and then make their cuts?

To solve this problem, in VideoRedo I enabled multiple audio stream support.

In VideoRedo it now doesn't matter if I choose "Resync - Remove Audio Frames" or "Resync - Insert Extra Video Frames" because once I make my cuts and save the file (see new sample I posted at beginning of this post) and then demux and remux with TSMuxer, this time the audio is in sync! However if I take the VideoRedo saved file and "Save Project and Demux Video" with DGindex and then remux the DGIndex files - the audio has a delay and it's mentioned in the AC3 file name. So this time it is DGIndex causing the problem!

Quote:
Originally Posted by neuron2 View Post
The problem is that an arbitrary cut cannot exactly match the start of both an audio and video object. They have different time granularities. If you truncate partial audio frames at video cut points, a progressive desync results that manifests itself when presentation timestamps are lost through demuxing. This is really great advice! Bravo. It gives a way to avoid the problem I described above.
I have no idea if VideoRedo is "truncating partial audio frames at video cut points" or not but when I now demux and remux - the audio is in sync!

Last edited by VideoFanatic; 7th December 2012 at 14:32.
VideoFanatic is offline   Reply With Quote
Old 7th December 2012, 13:38   #19  |  Link
an3k
Registered User
 
an3k's Avatar
 
Join Date: Oct 2006
Location: Omicron Persei 8
Posts: 180
Quote:
Originally Posted by holygamer View Post
Yes I could just encode the video first, mux back and THEN make my cuts however that would increase the encoding time because when you encode several 2 hour videos a day and each 1 has 30 minutes of commercials then that takes a long time to encode unless you cut them out beforehand. Hasn't anyone else who's edited a video and saved a project in DGIndex reported this sync problem before or do most people just encode first and then make their cuts?
What do you want to do exactly? Record a MPEG2 from somewhere, remove the ads and then encode it to H.264 or MPEG4 ASP? You don't want to add funny transitions, end titles or something like that?

If so these is a much better way to do so! Get MeGUI. It uses DGIndex(NV), Avisynth and some other tools. First you index the mpeg2 with DGIndex, then you open the dgi file with the avs script creator in MeGUI. Now you see the raw video and a settings window (resize, crop, deinterlace, denoise, sharpening and much more. You also have the script editor window where you can write manually.
Using the video preview scroll to the ads, write down the last frame of video before ad starts and first frame of video after ad ends. Do this for every ad (like in VideoRedo). After you're finished you can save that avs file. Now do the same with the audio but instead of searching for start and end of ads just use the frame numbers you used for the video. Save that avs file too.

After that is done open the video and audio avs in the main tab, select the codec and its profile you want and queue them. Now go to the queue tab and start the encoding process.


Yes, at first Avisynth looks very complicated but after you understood how it works you can do much much more with it than with all of the other video editing tools (except those expensive suites like AfterEffects/Premiere .
an3k is offline   Reply With Quote
Old 7th December 2012, 14:55   #20  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by holygamer View Post
In VideoRedo it now doesn't matter if I choose "Resync - Remove Audio Frames" or "Resync - Insert Extra Video Frames" because once I make my cuts and save the file (see new sample I posted at beginning of this post) and then demux and remux with TSMuxer, this time the audio is in sync! However if I take the VideoRedo saved file and "Save Project and Demux Video" with DGindex and then remux the DGIndex files - the audio has a delay and it's mentioned in the AC3 file name. So this time it is DGIndex causing the problem!
You misled us about the first sample and results. Now you ask me to do another 1.5 GB download. I'll go through this one more time and that's it. But before I do, please tell me what you did differently with this sample such that you expect the results to be different.

I fully agree with an3k, it's much better to do your editing in the decompressed domain, not on the transport stream. I use AvsP for this, but there are several good ways to manage it.

Last edited by Guest; 7th December 2012 at 15:04.
Guest is offline   Reply With Quote
Reply

Tags
bug, delay, dgindex

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.