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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 15th October 2011, 23:17   #1  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
DGIndex makes Video out of sync with Audio - please help!

I have an MPEG 2 with 2 channel AC3 audio. I demux with TS Muxer to get an MPV file and an AC3 file.
I then saved the MPV file in DGIndex to get a D2V file. I then ran the D2V file through HC Encoder to get my new MPV file. The original video is in sync however after I run the D2V file through HC Encoder (whether via an AviSynth script or not) the resulting M2V file once remuxed with the AC3 audio - the audio is out of sync. The audio is out of sync from about the 44th minute and onwards.

Both the original video and the new video are exactly the same length:
Original MPEG2 before I demuxed it to get MPV for HC Encoder gives: 1:17:44.11 (hours, minutes, seconds, frames)
MPV (from HC Encoder) + AC3 TS file gives: 1:17:44.11

If I don't demux the MPEG 2 first via TSMUxer to get an MPV and AC3 file and instead use DGIndex to demux then the end result is that the whole file has the audio out of sync.

It's definitely DGIndex that's causing the problem.

The original MPEG2 file is DVD compliant because I could make a DVD from it in VideoRedo without re-encoding so I don't think it's the file that’s the problem.

I even tried to use VideoRedo's Elementary Stream Multiplexer to mux the converted M2V file with the AC3 file but that just gives me a 30 second file of garbage.

I suppose I could use an audio delay but how would that work if the audio is only out of sync from the 44th minute onwards?

I would appreciate any help on how to get my video and audio in sync. Is there another program I could use to make a D2V file?
VideoFanatic is offline  
Old 16th October 2011, 00:57   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by holygamer View Post
If I don't demux the MPEG 2 first via TSMUxer to get an MPV and AC3 file and instead use DGIndex to demux then the end result is that the whole file has the audio out of sync.
Did you apply the audio delay correction reported by DGIndex?

Quote:
It's definitely DGIndex that's causing the problem.
To get correct results with DGMPGDec, you have to:

a) demux with DGIndex
b) apply the reported audio delay, either using an AC3 cutter like DelayCut, or using DelayAudio() in your script

Last edited by Guest; 17th October 2011 at 20:07.
Guest is offline  
Old 16th October 2011, 05:00   #3  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Quote:
Originally Posted by neuron2 View Post
Did you apply the audio delay correction reported by DGIndex?

I think it's definitely PEBKAC.

To get correct results with DGMPGDec, you have to:

a) demux with DGIndex
b) apply the reported audio delay, either using an AC3 cutter like DelayCut, or using DelayAudio() in your script
This is what I'm doing: I open my MPEG2 in DGINdex then I go to File, Save Project. These are the files it gives me:

Code:
RAW July 07 1997 Edited.d2v
RAW July 07 1997 Edited T80 2_0ch 192Kbps DELAY 0ms.ac3
RAW July 07 1997 Edited.mpv

I then load my script in HC Encoder. This is my script:

Code:
Mpeg2Source("I:\New\z = Encode\dgindex\RAW July 07 1997 Edited.d2v", CPU=6)
DeGrainMedian(limitY=2, limitUV=3, mode=1, interlaced=true)
DeGrainMedian(limitY=2, limitUV=3, mode=1, interlaced=true)
AddBorders(8, 0, 8, 0)
DelayAudio(0)
I added the delayaudio as you suggested (did I do it right?) but it's still out of sync. Is there something I'm missing? How did you avoid getting sync problems?

Last edited by VideoFanatic; 16th October 2011 at 05:02.
VideoFanatic is offline  
Old 16th October 2011, 13:15   #4  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Why do I need DelayAudio when HC Encoder isn't even processing audio? It's only processing a video.
VideoFanatic is offline  
Old 16th October 2011, 14:51   #5  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
OK, you have 0 delay, so no adjustment is necessary (but see the note below).

This is the process that should work:

1. Demux the audio with DGIndex while doing Save Project. Don't demux the video.
2. Serve your video via the script.
3. Open the script with HCEnc and encode the video.
4. Mux the audio and encoded video with an appropriate muxer (such as Imago Muxer or mplex).

If that does not work for you, then please post a link to a sample from the beginning of the source stream. Just use DGSplit to cut the first 100MB of the original file. Upload that to mediafire.com and post the link here. Also, tell me what muxer you used.

IMPORTANT NOTE: Here is one more thing to look at. Your source file may have some blank video at the start that messes up sync. Try opening the file in DGIndex and then doing > several times until video appears. Then hit [ to start the project there. Then Save Project, etc., as described above. This is pretty common on DVDs. This may result in an audio file with a non-zero delay, so you'll have to adjust for that with DelayCut on your AC3 file before muxing.

Quote:
Why do I need DelayAudio when HC Encoder isn't even processing audio? It's only processing a video.
That would be needed if you are decoding the audio in your script and then re-encoding it, perhaps with SoundOut().

Last edited by Guest; 16th October 2011 at 14:58.
Guest is offline  
Old 16th October 2011, 14:54   #6  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Hi, sorry I made this post before you're above post. I will get back to you soon.

Quote:
Originally Posted by neuron2 View Post
Did you apply the audio delay correction reported by DGIndex?

I think it's definitely PEBKAC.

To get correct results with DGMPGDec, you have to:

a) demux with DGIndex
b) apply the reported audio delay, either using an AC3 cutter like DelayCut, or using DelayAudio() in your script
Sorry but it IS DG Index that's causing the problem because I can demux an MPEG 2 (which has no sync problems) with it and if I then remux the M2V and AC3 files it gives into a TS file, I play it back and the audio is out of sync.

When I demux an MPEG2 with DGIndex it gives an M2V file and an AC3 file which has "DELAY 0ms" in the title.

I've just been told by someone else that I don't need to add a delay because HC Encoder is only working with the video file. Is that correct?

Anyway with the AC3 file I got from DGIndex I opened it in DelayCut and ticked "Original Length" because the ac3 file had "DELAY 0ms" in the title. I then remuxed the files and I still had sync problems.

Last edited by VideoFanatic; 16th October 2011 at 14:56.
VideoFanatic is offline  
Old 16th October 2011, 15:15   #7  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
I suspect you need to skip some GOPs at the beginning of the project as I mentioned. If it does not work then please post a sample as described. This is a well-known scenario that can cause async. Its root cause is not DGIndex but rather the timestamp conditions at the start of the file.
Guest is offline  
Old 16th October 2011, 16:59   #8  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Quote:
IMPORTANT NOTE: Here is one more thing to look at. Your source file may have some blank video at the start that messes up sync. Try opening the file in DGIndex and then doing > several times until video appears. Then hit [ to start the project there. Then Save Project, etc., as described above. This is pretty common on DVDs. This may result in an audio file with a non-zero delay, so you'll have to adjust for that with DelayCut on your AC3 file before muxing.
I don't really like the sound of that as it doens't sound very precise!

Do you want a 100MB sample from the orginal MPEG2 file which has no problems or do you want a sample from the TS file which I muxed from the DGIndex MPV and Ac3?
VideoFanatic is offline  
Old 16th October 2011, 18:15   #9  |  Link
laserfan
Aging Video Hobbyist
 
Join Date: Dec 2004
Location: Off the Map
Posts: 2,461
Quote:
Originally Posted by holygamer View Post
Do you want a 100MB sample from the orginal MPEG2 file which has no problems or do you want a sample from the TS file which I muxed from the DGIndex MPV and Ac3?
Quote:
Originally Posted by neuron2 View Post
Just use DGSplit to cut the first 100MB of the original file. Upload that to mediafire.com and post the link here. Also, tell me what muxer you used.
The earlier post (in its entirety) seemed clear enough to me, but neuron2 always wants the original file, in order to replicate your steps/process exactly.
laserfan is offline  
Old 16th October 2011, 18:31   #10  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
Sorry, I misread it. Here's the 100MB file: http://www.mediafire.com/?6t8e0ov76k7w1ne
VideoFanatic is offline  
Old 16th October 2011, 21:07   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by holygamer View Post
I don't really like the sound of that as it doens't sound very precise!
It's very precise, because DGIndex is going to give you the correct delay value to use relative to where you start the project. It's all been thoroughly discussed many times. Looking at your sample now... I hope it includes the start of the stream, as I requested.

EDIT: Where did you get this source file?

Last edited by Guest; 16th October 2011 at 21:16.
Guest is offline  
Old 16th October 2011, 23:37   #12  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
I just used the Trim and Copy function of VideoRedo to save the first 100 MB of the original MPEG2 file - wasn't that what you wanted?. It muxes without re-encoding.

I use TSMuxer to mux the AC3 and M2V files from DGIndex.

Quote:
Your source file may have some blank video at the start that messes up sync. Try opening the file in DGIndex and then doing > several times until video appears. Then hit [ to start the project there. Then Save Project, etc., as described above. This is pretty common on DVDs. This may result in an audio file with a non-zero delay, so you'll have to adjust for that with DelayCut on your AC3 file before muxing.
I did that and DGIndex gave an AC3 file like this:

RAW July 07 1997 Edited T80 2_0ch 192Kbps DELAY -41ms

I then opened the AC3 file in DelayCut, ticked "Original Length" then entered "41" in the Start (msec)" box. It then gave a file like this:

RAW July 07 1997 Edited T80 2_0ch 192Kbps DELAY -41ms_fixed

I then muxed that AC3 file and the M2V file from DGIndex in TSMuxer but the audio is still out of sync. You said marking the file in DGIndex is precise yet I've still got my audio out of sync so isn't very precise! Unless I've done something wrong? Could you please point me to some of those discussions you mentioned.

The source is from Wrestling footage recorded off TV onto VHS, transferred to DVD then dumuxed to an MPEG2.

Could you please try saving the MPEG2 on your end with DGIndex and then doing the other steps needed to get the end result video file so I can see how you manage to get the audio in sync?
VideoFanatic is offline  
Old 17th October 2011, 19:04   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
I just used the Trim and Copy function of VideoRedo to save the first 100 MB of the original MPEG2 file - wasn't that what you wanted?
I specifically asked you to use DGSplit on the original source file. Maybe your cut does the same thing, but I cannot vouch for it.

Anyway, your uploaded stream has two missing audio frames. I have verified it by tracing and also with EAC3TO, which reports two audio gaps. Failure to account for those produces desync of 64 ms, which is easily perceptible.

EAC3TO is able to replace the missing frames with copies of the previous frame.

Manzanita Muxer, a $5000 professional tool, gives demuxed audio identical to that of DGIndex, i.e., it just demuxes what it sees and does not try to recreate any missing frames.

So for this kind of corrupted stream, you should demux audio with EAC3TO. Then mux it with the re-encoded video and things should be fine. You won't be able to set a project start other than the very beginning, however, because then you cannot coordinate the start with EAC3TO.

I'll surely look into adding similar gap processing to DG tools, as my handling for gaps between multiple M2TS files (and only for AC3 audio!) is a bit ad hoc, and a more general solution would address gaps anywhere, whether due to corruption, concatenation, editing, etc. It has to be done.

Last edited by Guest; 18th October 2011 at 02:54.
Guest is offline  
Old 17th October 2011, 20:10   #14  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally Posted by holygamer View Post
The source is from Wrestling footage recorded off TV onto VHS, transferred to DVD then dumuxed to an MPEG2.
Did you do that yourself?

If so, what tools did you use for each step? I want to try to determine where audio frame loss could have occurred.

If you did not do it yourself, where did you get the MPEG2 file?
Guest is offline  
Old 18th October 2011, 01:41   #15  |  Link
VideoFanatic
Registered User
 
Join Date: Sep 2011
Posts: 241
I got the DVDs from someone else, I don't know what tools they used. All I know is that they recorded TV footage onto VHS then transferred onto DVD. I then got the DVD and demuxed with VideoRedo to MPEG2. I then used TSMuxer to demux the MPEG2 then I used AC3Tool to convert AC3 to WAV. Then I removed the background hiss with a WAV editor. I then converted the WAV back to AC3 with WAV to AC3 Encoder 5.0. Then I remuxed the AC3 and MPV in TSMuxer. I then make my cuts in VideoRedo but I don't think VideoRedo would cause the missing audio frames.

Once I removed the hiss and clicks, the audio sounds fine, however if you listen via headphones you may be able to hear the occasional artefact. So god knows how the videos were recorded from start (TV) to finish (DVD).

In the VideoRedo options, within the Stream Parameters section there's an option for "Detect / resync missing frames". It has a default option of "Resync - Remove Audio Frames" selected. You can also select "Ignore" or "Resync - Insert Extra Video Frames". Could any of those options prevent the audio frame loss? Obviously the default option doesn't as that's what I used on the file I have a problem with.

Could you please tell me how to use your choice of GUI for EAC3TO to do what you said. I just want to fix the ac3 file. I downloaded More GUI from http://forum.doom9.org/showthread.php?t=135095 but I can't get it working.
  • I downloaded More Gui from the above link and I also downloaded Eac3to
  • In the "Paths/Misc" tab I set the path to Eac3to.exe. I did the same for TSMuxer
  • In the "Eac3to Audio" tab I selected AC3 as the "Audio track choice". I ticked "Force eac3to to loop audio instead of inserting silence"
  • I couldn't see any menu that would let me output an AC3 file so I selected the "Convert Movie" tab. I dragged my AC3 file into the "Source Files and Folders" box and I set a destination folder and I entered a movie name.
  • I then click "Make Movie" but nothing happens.
  • In the "Eac3to Audio" tab I then ticked "Demux all audio tracks"
  • In the "Other Programs" tab I then selected "AC3" under "Audio track choices". I also ticked "Remux all audio tracks"
  • In the "Paths/Misc" tab I ticked "Demux with eac3to, mux with tsmuxer".
  • When I click on "Make Movie" I get the following error message "Line -1: Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded".

If I load an MPEG2 instead of an AC3 file it shows a percentage complete window but it just gives error messages and loads up TSMuxer at the end of it.

Is there a foolproof guide which explains how to use More GUI. If not could you please tell me how to use it or another GUI that works. Thanks

Last edited by VideoFanatic; 18th October 2011 at 02:06.
VideoFanatic is offline  
Old 18th October 2011, 02:05   #16  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Quote:
Originally Posted by holygamer View Post
Could you please tell me how to use your choice of GUI for EAC3TO to do what you said.
I imagine neuron2 didn't use a GUI for EAC3TO...
Asmodian is offline  
Old 18th October 2011, 02:11   #17  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
If you had posted what I asked for (a DGSplit of the original VOB), we could have determined whether the frame loss was there from the start or your process caused it.

Quote:
Originally Posted by holygamer View Post
I got the DVDs from someone else, I don't know what tools they used. All I know is that they recorded TV footage onto VHS then transferred onto DVD. I then got the DVD and demuxed with VideoRedo to MPEG2.
But it's all moot now because you just admitted to violating our forum rule 6. Therefore I have to close the thread and not help anymore with this issue. Please read and follow our forum rules. Also see number 10 here:

http://forum.doom9.org/announcement.php?a=36

Thank you for your understanding. I know it sucks to have this happen but there are ample warnings about these things and you should have taken note of them.

@Asmodian

That's right. "eac3to -demux file.mpg" hardly needs a GUI. Then again, nowadays many people don't know how to open a command window and set the PATH variable. It's like "Huh, what? Just give me a GUI." Hard to deny the point, though! Still, there are EAC3TO GUIs in abundance, so no need to panic.

Last edited by Guest; 18th October 2011 at 03:01.
Guest is offline  
Closed Thread

Tags
audio, dgindex, sync, video

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 17:57.


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