VideoHelp Forum




Results 1 to 4 of 4
  1. Hey there,

    I've been encoding most of my DVD collection to H.264 (mencoder) recently. Every resulting file turned out the way I wanted them to be: clear video, clear sound, small file size compared to DivX/XviD. But the movie I encoded yesterday had a weird result.

    Other than my previous movies, it's a code 1 DVD, it's interlaced, and has NTSC 29.97 FPS. All the other movies I ripped are code 2 DVDs, non-interlaced, and have PAL 25 FPS (I think). Anyway, the resulting H.264 MP4 file's audio lags by about 1 second, I guess, at the end of the movie.

    I'm not an expert, but does the movie having NTSC 29.97 FPS have anything to do with my A/V sync problem? I figured this since all my other movies turned out fine, and they were PAL.

    I ripped it like all the other movies using MacTheRipper (2.66). Then chose the H.264 mencoder encoder, AAC audio (128kbit/s), deinterlace, x264 deblock, some cropping, CABAC, constant bitrate, two-pass encoding, lanzcos scaling method, hexagon ME function, and Qmin=2, Qmax=51.

    I'm not sure how much information I have to put here to find the problem. So, if I should give more, please, just tell me. Is there any workaround to this which hopefully doesn't require any extra programs? I'd be very thankful. Thanks in advance.

  2. Member
    Join Date
    Aug 2005
    Location
    Palo Alto, California USA
    Search Comp PM
    Regrettably, sync errors are not uncommon. Some of the causes are:

    1) Source video has content with a mixture of framerates, and the encoder makes a few errors. Over the length of a movie, the sync can drift by a second or two. Generally, the sync error will grow more or less continuously throughout the movie if this is the cause. This is relatively rare among PAL discs, in my experience, but not that uncommon among NTSC, so your instincts are spot on.

    2) Source video has extended blank frames during scene breaks, fooling the encoder as in 1). You'll get sync jumps at these transitions.

    3) The target video bitrate is too low, and the encoder is forced to drop frames here and there. This can cause sporadic jumps in sync errors not easily correctable with any simple process.

    As these are all encoder-related features (ok, they're bugs), there's little that you can do ahead of time to fully prevent their causing problems. I'm forced to do some post-processing to fix them up. Methods that I use are:

    1) Using VLC's sync offset feature, note the sync error at the beginning, middle and end of movie. If the drift seems more or less constant, then you can use the "change tempo" feature of Audacity (e.g.) to slow down (or, more rarely, speedup) the audio track to match. You may need to use this in conjunction with a fixed offset during remuxing. Although this is an additional step, it is a fast operation compared to encoding into h.264.

    2, 3) Again note the sync errors in the various sections, and identify where the troublesome jumps in sync (generally at scene breaks) are. Chop up the video into however many pieces have constant sync error within them. Resync each piece and splice together. This will generally be relatively easy for 2), but often impractical for 3).

    Hopefully someone else will be offer a less cumbersome procedure, but this is all I've been able to come up with. I've not been able to prevent sync errors altogether.

  3. Okay, a small update from me.

    I've just encoded the NTSC video using the DivX (mencoder) encoder. And there's actually no audio lag, none at all!

    This is weird! But at least I can re-encode it to H.264, and hopefully end up with no audio lag as well.

  4. Member
    Join Date
    Aug 2005
    Location
    Palo Alto, California USA
    Search Comp PM
    Actually it's not that weird, because of the way divx keeps track of AV sync. If you don't mind the degradation in quality (which you can mitigate a bit by using a high bitrate) and longer encode times, then using divx as an intermediate format is a useful workaround.

    Once synced this way, a subsequent encode into h.264 will almost certainly remain in sync.




Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!