View Full Version : Audio getting out of sync
nofsky
17th February 2009, 17:49
I've encoded one of the bonus features on one of my DVDs to x264/mp3 with MeGUI. I did a test with AutoGK (avi/xvid/mp3) and the same thing happens.
The sound syncs perfect in the beginning but as the video goes on it becomes more and more out of sync so that near the end of the (1h23m long) video the sound is about half a second before the video. This is with the transcoded mp3 audio but the same happens with the original AC3 audio.
I used DVD Decrypter to rip the special feature from the DVD into one VOB file. In MeGUI I used D2V Creator & AVS Script Creator.
The AC3 extracted by D2V Creator is 1h 23mn 53s 184ms.
The AC3 encoded to MP3 is 1h 23mn 53s 275ms.
The VOB file is 29.970 fps (Mediainfo won't show the length, GSpot shows 1:23:54, While playing the DVD VLC shows 1h 23mn 38s)
The VOB encoded to mkv/x264 is 1h 23mn 53s 529ms at 23.976 fps
Can anyone help me with this? Is it the conversion from 30fps to 24 that's the problem?
poisondeathray
17th February 2009, 21:12
Maybe you try DVD Fab HD Decrypter? DVD Decrypter hasn't been updated in a few years
Guest
18th February 2009, 02:53
Give your script and x264 settings. What field operation is set in the D2V file?
nofsky
18th February 2009, 11:47
I tried DVD Fab but that didn't make any difference.
The x264 profile I use is "Unrestricted 2-pass Balanced" with just the bitrate changed.
My avs is:
DGDecode_mpeg2source("F:\@Rips_DVD\NOTLD\VIDEO_TS\VTS_01_1.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=0).tdecimate(hybrid=1)
Spline36Resize(720,400) # Spline36 (Neutral)
Undot() # Minimal Noise
This is the beginning of my d2v:
DGIndexProjectFile16
3
F:\@Rips_DVD\NOTLD\VIDEO_TS\VTS_01_1.VOB
F:\@Rips_DVD\NOTLD\VIDEO_TS\VTS_01_2.VOB
F:\@Rips_DVD\NOTLD\VIDEO_TS\VTS_01_3.VOB
Stream_Type=1
MPEG_Type=2
iDCT_Algorithm=6
YUVRGB_Scale=1
Luminance_Filter=0,0
Clipping=0,0,0,0
Aspect_Ratio=16:9
Picture_Size=720x480
Field_Operation=0
Frame_Rate=29970 (30000/1001)
Location=0,0,2,4247b
A VTS_01_1.fix.txt file was created, does it have anything to do with this? Here's what's in it:
D2V Fix Output
Field order transition: 0 -> 2
d00 5 0 2048 0 1 1 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 a0
d00 5 0 399360 0 2 1 92 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
corrected...
d00 5 0 2048 0 1 1 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 b0 a0 b0 a1
d00 5 0 399360 0 2 1 92 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2 b2 b2 a2
Guest
18th February 2009, 15:39
You can try starting your project in by a few GOPs. Hit > twice and then [ in DGIndex. Use the new delay value that generates.
I don't know anything about TDecimate(hybrid=1) so I can't advise about its potential role.
Try what I suggested and report back.
setarip_old
18th February 2009, 16:48
@nofsky
Hi!I've encoded one of the bonus features on one of my DVDs...near the end of the (1h23m long) videoWhat is the Title and Region number of the DVD - and which particular "bonus feature"?
nofsky
18th February 2009, 18:32
Thanks for helping me out.
You can try starting your project in by a few GOPs. Hit > twice and then [ in DGIndex. Use the new delay value that generates.
I don't know anything about TDecimate(hybrid=1) so I can't advise about its potential role.
I'm not exactly sure what you mean by using the new delay value. Do you mean I should save a new d2v, after I've done what you said, and use it when encoding the movie?
The TDecimate have something to do with interlacing; only parts of the video was interlaced it seems.
@setarip_old
The movie is Night of the Living Dead: 40th Anniversary Edition, Region 1. The special feature in question is the "One for the Fire: The Legacy of Night of the Living Dead" documentary.
I have been able to encode the main movie itself just fine, without any problems.
setarip_old
18th February 2009, 19:54
Perhaps too obvious a question but, when you play the bonus feature from the actual DVD on your PC, does it exhibit the same behavior?
nofsky
18th February 2009, 20:06
While playing the DVD this problem isn't there, the sound syncs perfectly. The same with the decrypted VOB files I use when encoding.
Guest
19th February 2009, 00:31
I'm not exactly sure what you mean by using the new delay value. Do you mean I should save a new d2v, after I've done what you said, and use it when encoding the movie? Yes.
Now I have to babble because "yes" is too short to be accepted as a response.
nofsky
19th February 2009, 11:22
I just did a new encode using the adjusted d2v, no luck! Still the same problem. :(
Any ideas what else I could try? Could it have something to do with the reduction from 30fps to 24fps? Or the deinterlace processing?
Guest
19th February 2009, 14:36
Try it without the tfm()/tdecimate() just to eliminate that as a possibility.
It could be bad timestamping in the stream. We'd need a sample to assess that.
nofsky
20th February 2009, 10:47
I've done a new encode without the deinterlace stuff (tfm(order=0).tdecimate(hybrid=1))... no change. Still the same problem with audio out of sync.
It could be bad timestamping in the stream. We'd need a sample to assess that.
How long, what part, which program do I use? Could I not check for bad timestamping myself?
Guest
20th February 2009, 14:12
How long Let's start with the timestamps log file, see below.
Could I not check for bad timestamping myself? Let's do this:
Open the entire bonus movie in DGIndex. Enable Options/Log Timestamps. Save project. Attach the resulting timestamps log file.
nofsky
20th February 2009, 15:24
While doing this DGIndex reported "Field Order Transition Detected" and could not decide if it should be corrected or not. I chose Yes. Has this any significance?
Anyway, here is the timestamps logfile:
http://rapidshare.com/files/200379145/VTS_03_1.timestamps.rar
Thanks again for your help.
Guest
20th February 2009, 15:40
While doing this DGIndex reported "Field Order Transition Detected" and could not decide if it should be corrected or not. I chose Yes. Has this any significance? Not for collecting the timestamps.
I'll inspect the log today.
Please don't use RapidShare in the future. It's dreadfully slow.
nofsky
20th February 2009, 15:53
Oh, it's usually fast for me.
Anyway, thanks for your assistance.
Guest
20th February 2009, 21:47
SCR is the time base of the stream. Looking at the log I see that SCR resets to 0 about 8 times, even though it has not become big enough to wrap around. I guess that the feature was assembled from 9 sections of material. But for each section the length of the audio is one or two audio frames less than the length of the video. This is not a problem when the timestamps are correct for the start of each segment (as they are here) because the missing audio will be filled with silence during playback. But when you demux the audio, the segments are just lined up and the timestamps lost. The result would be that at each segment change, the audio would advance about 64ms (for AC3 and assuming two audio frames).
This is corroborated by the fact that 8 * 64ms is about half a second, and by the fact that your demuxed streams differ in length by about half a second, and finally by the fact that the audio becomes progressively advanced rather than retarded. I couldn't prove it directly because the timestamp dump does not show the audio access units, so I couldn't count missing ones at the SCR resets.
So, what to do? If it were me and the job was VERY important, I would write a special tool to detect the cuts and insert the needed silent audio frames. Without that you could cut the project up and manually adjust the audio of each segment before recombining them. The timestamp log has enough information to allow you to determine the frame numbers at which to do the cutting, but you'll have to write a program to process it to extract that information.
Easiest is to simply stretch the entire audio stream by half a second. You'd have up to 64ms of desync at various places (just before each segment change) but that's a lot better than 500ms. You can use AssumeSampleRate() on the audio to change its length. The change is small enough that nothing fancier is really needed.
nofsky
20th February 2009, 22:19
That's interesting, I guess they did a sloppy job creating the dvd.
Do you know of any way of capturing the audio while still keeping those missing/silenced frames in? I know Winamp has a diskwriter plugin for audio output, maybe this will work.
Or maybe I could stretch the sound track to the same length as the video using a sound editing program. This won't fix it but maybe the sound sync will be slightly better.
Anyway, if this doesn't work I think I'll just skip this video, it's not worth the trouble.
Thanks for all your help again, neuron2, I appreciate it.
Guest
20th February 2009, 22:28
The Winamp plugin might work. Give it a try.
Otherwise just stretch it. I suspect it will be fine that way.
setarip_old
21st February 2009, 01:31
@nofskyI used DVD Decrypter to rip the special feature from the DVD into one VOB file.If you haven't already done so with DVD Decrypter, try using it in ".IFO" mode - and use stream processing to select the appropriate videostream(s) and audiostream(s)...
nofsky
21st February 2009, 04:55
Winamp would only write about 14 minutes of sound then stop so that didn't work.
I did, however, manage to stretch the audio using a sound editing program and the sound syncs perfectly now after muxing with the video! :) It was after all only about 400ms difference so there was no noticeable distortion.
Thanks for your help, neuron2!
Guest
21st February 2009, 05:07
Cool. For closure, can you please tell us which audio editing program you used? Thanks!
nofsky
21st February 2009, 05:17
Sure, I used Adobe Audition 3 and the stretch effect. I'm sure you can do the same with a free program, like Audacity.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.