View Full Version : Help me fix a sync problem...
Blue_MiSfit
16th August 2008, 01:52
Hi folks.
So I've got a new (to me) problem today.
Source is The Eye 3, from a commercial encoding house. It's MPEG-2, 4:2:2 1080p24 at 30mbps CBR (cringe). We've got 3/2 AC3 at 640kbps all rolled into an MPEG PS container (.MPG)
When played back with Media Player Classic, sync is flawless.
When I load the file into DGIndex and do the usual procedure for building a d2v / demuxing audio all seems well. The resulting audio track has a reported delay of 0ms in the file name.
However, when I try to play the D2V + AC3 together, the sync is horribly off. It's so far off, it's impossible to say how much. It doesn't help that the dialogue is in chinese, and the english hardcoded subs are less than perfect.
I've tried logging the timestamps, and using the audio sync analyzer, but I'm not sure how to interpret the results:
Delay Analysis Output (Audio ID 80)
Decode picture: temporal reference 0[I]
delay = 0
Decode picture: temporal reference 2[I]
delay = -116
Decode picture: temporal reference 2[I]
delay = -137
Decode picture: temporal reference 2[I]
delay = -125
Decode picture: temporal reference 2[I]
delay = -114
Decode picture: temporal reference 2[I]
delay = -134
Decode picture: temporal reference 2[I]
delay = -123
Decode picture: temporal reference 2[I]
delay = -111
Decode picture: temporal reference 2[I]
delay = -132
Decode picture: temporal reference 2[I]
delay = -120
Decode picture: temporal reference 2[I]
delay = -141
Decode picture: temporal reference 2[I]
delay = -129
Decode picture: temporal reference 2[I]
delay = -118
Decode picture: temporal reference 2[I]
delay = -138
Decode picture: temporal reference 2[I]
delay = -127
Decode picture: temporal reference 2[I]
delay = -115
Decode picture: temporal reference 2[I]
delay = -136
Decode picture: temporal reference 2[I]
delay = -124
Decode picture: temporal reference 2[I]
There's a lot more, and I can provide the full file if necessary.
I'm not sure how to proceed. The documentation is rather vague (to me) on this topic.
Any suggestions?
~MiSfit
Guest
16th August 2008, 02:11
Is is 10 seconds off? 1 second? 1/2 second? 100 milliseconds? You must have some idea.
You can try starting your project in by a few GOPs and then using the reported delay.
What do you mean by "play the D2V + AC3 together"?
Blue_MiSfit
16th August 2008, 13:17
Is is 10 seconds off? 1 second? 1/2 second? 100 milliseconds? You must have some idea.
You can try starting your project in by a few GOPs and then using the reported delay.
I'm not sure at the moment.. I'll check in when I have access to the sources (VPN too slow). The delay in this preview translates through to a full encode.
What do you mean by "play the D2V + AC3 together"?
1) Extract the audio and make a D2v with DGIndex
2) Make an AviSynth Script with just "MPEG2Source(...)"
3) Match filenames - like this: "movie.avs", and "movie.ac3"
4) Open the AVS in Media Player Classic.
This method may sound shaky, but it's worked remarkably well every time I've used it.
~MiSfit
Guest
16th August 2008, 13:36
If you can't even tell us whether the desync is 10 seconds or 1 sec, to be honest, I don't know why you are wasting our time by posting about this.
Your playing method is indeterministic. You're asking me to vouch for the sync performance of some third-party application. Make a deterministic script that dubs the audio and video. You'll need to do that anyway to start the project in by a few GOPS and specify a delay, as I suggested.
Blue_MiSfit
17th August 2008, 03:07
I cant give you the information right now - because the source is at my work machine, and I don't have VPN access this weekend. If I recall correctly, it's probably 2-3 seconds.
I will do as you ask and do an AudioDub().
I will also try to start the D2V a few GOPs in - I've used that method before, and hadn't thought to try it this time.
I'm not trying to waste anyone's time :)
I will update the thread on Monday.
-Derek
Guest
17th August 2008, 03:34
An unprocessed stream sample without cutting the start will be useful as well.
Blue_MiSfit
17th August 2008, 05:58
Will do!
setarip_old
17th August 2008, 08:11
Hi!...the english hardcoded subs are less than perfect.The commercial R1 version of this DVD contains selectable English and Spanish subtitles...
Blue_MiSfit
17th August 2008, 08:30
I can't use the DVD :(
~MiSfit
Blue_MiSfit
18th August 2008, 20:22
Okay, after looking into this further, the progressively desyncs. It's okay for the first few minutes, then gets worse, and eventually is more than 40 seconds out by the end of the movie. Sounds like different durations to me!
So I checked, and the audio is indeed ~1 minute, 20 seconds longer than the video :rolleyes:
So, I'm trying to trim a few GOPs in, but I don't think that will fix it.
I know there's a fix for this, but I can't remember.. I will be searching.
~MiSfit
Guest
18th August 2008, 20:51
What field operation did you use when you made your project?
Blue_MiSfit
18th August 2008, 21:19
Honor Pulldown flags - the source is 24p as indicated by DGIndex
http://www.mediafire.com/?sharekey=a5ffb9b5a7eff1d7d2db6fb9a8902bda
There's the first ~ 30 seconds
Guest
18th August 2008, 21:24
I can't look at that until tonight (corporate firewall).
When you say you compared the lengths of the audio and video, how did you do that?
Blue_MiSfit
18th August 2008, 21:26
I loaded the video into AviSynth with a simple MPEG2Source, dropped that into AvsP, and went to the end of the video.
The audio, I just dropped into Media Player Classic, and looked at the duration.
Thanks,
~MiSfit
Guest
18th August 2008, 21:33
How big is the full source MPG file?
Blue_MiSfit
18th August 2008, 21:34
18,673,062 KB
~MiSfit
Guest
18th August 2008, 21:35
Oh.
Do you get a difference in audio and video length when you apply your process to just the sample you uploaded?
You said it's OK for the first few minutes, so why give me a sample of the first 30 seconds???
Blue_MiSfit
18th August 2008, 21:39
You asked for it :)
An unprocessed stream sample without cutting the start will be useful as well.
I will upload another one towards the end..
http://www.mediafire.com/?sharekey=a5ffb9b5a7eff1d7d2db6fb9a8902bda
~MiSfit
Guest
18th August 2008, 21:47
Upload a piece such that when you apply your process the audio and video lengths diverge, as you claimed.
If I cannot duplicate an issue with the stream you upload, there is no point.
Blue_MiSfit
18th August 2008, 21:52
I see.
The method I described will not show an obvious difference, since Media Player Classic rounds to the nearest second.
However, if you load the AC3 into DelayCut, you will see a different length than the video in AvsP. In the case of sample 2, audio was 10.016 seconds, and video was 10.135 seconds.
~MiSfit
Guest
18th August 2008, 22:24
Have you checked for PTS discontinuities in your MPEG stream?
Blue_MiSfit
19th August 2008, 01:36
No - I'm not sure how to do so :)
Would you be so kind as to enlighten me?
~MiSfit
Guest
19th August 2008, 01:49
Umm, you uploaded the demuxed files!
PTS timestamps are lost when you demux.
I need a fragment of the source program stream.
Blue_MiSfit
19th August 2008, 02:14
Okay, does Mpeg2cut preserve PTS?
I'm really not familiar with MPEG Program Streams :)
~MiSfit
Blue_MiSfit
19th August 2008, 02:25
http://www.mediafire.com/?sharekey=a5ffb9b5a7eff1d7d2db6fb9a8902bda
There's a trim using MPEG2Cut.
Let me know if it's not sufficient.
Guest
19th August 2008, 02:25
You can use DGSplit. Set the split size to 100Mbytes and then kill it after it writes the first file.
If you want to extract a piece from later in the file, open it in VirtualDub's hex editor and then use Edit/Extract segment.
EDIT: Looking at your last upload.
Blue_MiSfit
19th August 2008, 02:33
Okay, the sample I provided last time was small (26mb).
I will use DGSplit and get the first 100mb of this file.
~MiSfit
Guest
19th August 2008, 02:35
I can't see anything wrong with it.
I don't see how I can help you if you don't make available a stream that can be used to duplicate your issue.
I have my own tool for inspecting PTSs. I don't see anything wrong in the sample.
Are there any kind of major cuts or interruptions in the stream, like maybe the audio format changes for a while, or something like that? Or is it the same stuff all the way through?
What happens if you go ahead and encode it properly and play the resulting file? I don't trust your toolchain for assessing sync.
Blue_MiSfit
19th August 2008, 02:37
Upload in progress.
Since this is an issue that gets progressively worse, I assume you would need a very large sample, if not the entire source (provided our current, final attempt isn't successful).
Is there anything else I can provide (short of the entire file, or a large segment thereof due to licensing issues)?
~MiSfit
Blue_MiSfit
19th August 2008, 02:39
http://www.mediafire.com/?sharekey=a5ffb9b5a7eff1d7d2db6fb9a8902bda
Guest
19th August 2008, 02:40
What are you uploading now?
Split off the first 4 GBytes. Then see if you get a large discrepancy in the video and audio lengths with that. If so, snail mail it to me on a data DVD.
Blue_MiSfit
19th August 2008, 02:41
Are there any kind of major cuts or interruptions in the stream, like maybe the audio format changes for a while, or something like that? Or is it the same stuff all the way through?
Not as far as I can tell
What happens if you go ahead and encode it properly and play the resulting file? I don't trust your toolchain for assessing sync.
The exact same behavior - a progressive audio desync. Quality Control folks caught it, and I'm going back and trying to fix the problem :)
What are you uploading now?
The first 100MB, per your request
Split off the first 4 GBytes. Then see if you get a large discrepancy in the video and audio lengths with that. If so, snail mail it to me on a data DVD.
I'll see if I can do such a thing (or maybe we can send you the whole thing on an external HDD). Licensing restrictions can be very tricky, but we might be able to get around it :)
Thank you so much for taking time out of your undoubtedly busy life to help me resolve this issue. It's sincerely appreciated!
~MiSfit
Guest
19th August 2008, 02:45
I don't see anything wrong with the 100MByte sample either. You're going to have to send me the stream.
If you demux with another tool, do you get the same result?
Blue_MiSfit
19th August 2008, 02:49
Hmm... I've used DGIndex for such a long time now, I'm not sure about other tools :)
Could you suggest any other tools?
~MiSfit
setarip_old
19th August 2008, 03:10
@Blue_MisFit
While "neuron 2" works his magic for you, you might want to try the following as an experiment regarding your initial MPEG2 (.MPG, including video and audio) file:
1) Load the file into "MPEG2Cut2.EXE" (different than "MPEG2Cut.EXE")
2) From the "Output" dropdown menu, select "Parse Options" and place checkmarks next to "Audio Matching", "Broken Link Set", "Align Video Edge Packets" "Align Audio Edge Packets", "Handle Split Start Codes", and "Adjust Time Stamps - EXPERIMENTAL" - and then save the .MPG with a new filename
3) See if, when demuxed, this new file exhibits the same problematic behavior.
Note - You MAY have to also go to the "Misc" dropdown menu and change the "Default time format from "Relative-Start=0" to "MPEG Time Stamp (PTS) - but I'd try it without this change at first...
Blue_MiSfit
19th August 2008, 07:48
Thank you for the helpful suggestion, setarip_old!
I will give this a try first thing tomorrow!
~MiSfit
Blue_MiSfit
20th August 2008, 01:37
I tried both methods - both fail :(
I'm going to go back to the encoding house and see if they can redeliver..
~MiSfit
setarip_old
20th August 2008, 06:38
I tried both methods - both failSorry to hear that - It was worth a shot...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.