Log in

View Full Version : AV sync problem converting a DVD


andy_blah
13th December 2008, 05:34
As the title says, I am having problems converting a DVD. The problem is the audio-video synchronisation. Seems that the audio is slower than the video for some reason. I have used BeSweet(+BeLight) to encode the audio, and I'm unsure if this one is the faulty one or the video is, I've tried to mux the original AC3(yes, I've used a .mkv container...) as well as the encoded audio(.mp3) and it seems that both have this problems, the .mp3 has the same duration as the video.

Here is one of the VOB's details:

http://i61.photobucket.com/albums/h41/andy_blah/Snapshots/gspot1.png

And here are the mp4's details:

http://i61.photobucket.com/albums/h41/andy_blah/Snapshots/gspot2.png

What should I do to fix this?

Sorry if I wasn't detailed enough

Noplait
13th December 2008, 21:33
Hello,
I think it must be a delay problem, you should be able to get it with DVD2AVI or DVD Decrypter (IFO mode stream processing when demuxing).

andy_blah
13th December 2008, 21:48
I would prefer to convert the DVD to .h264, and I already have it decrypted and on my HDD. Thank-you for the answer tho.

Ranguvar
14th December 2008, 05:19
Could you please run MediaInfo and post that output too? The G-Spot is lacking info.

andy_blah
14th December 2008, 08:47
Here it is:

The .VOB
General
Complete name : C:\My Documents\VIDEO_TS\VTS_01_1.VOB
Format : MPEG-PS
File size : 1 024 MiB
Duration : 26mn 38s
Overall bit rate : 5 374 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, Matrix : Default
Duration : 26mn 38s
Bit rate mode : Variable
Bit rate : 4 103 Kbps
Nominal bit rate : 9 800 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 16/9
Frame rate : 29.970 fps
Standard : NTSC
Colorimetry : 4:2:0
Bits/(Pixel*Frame) : 0.396

Audio #1
ID : 128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 26mn 38s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Surround: L R, LFE
Sampling rate : 48.0 KHz

Audio #2
ID : 129 (0x81)
Format : AC-3
Format/Info : Audio Coding 3
Format profile : Dolby Digital
Duration : 26mn 38s
Bit rate mode : Constant
Bit rate : 448 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

Text #1
ID : 32 (0x20)
Format : RLE
Format/Info : Run-length encoding
Video delay : 26mn 35s

Text #2
ID : 33 (0x21)
Format : RLE
Format/Info : Run-length encoding
Video delay : 26mn 35s

Menu
Format : DVD-Video



The MP4

General
Complete name : C:\My Documents\VIDEO_TS\01.mp4
Format : MPEG-4
Format profile : JVT
Codec ID : avc1
File size : 134 MiB
Duration : 26mn 38s
Overall bit rate : 702 Kbps
Encoded date : UTC 2008-12-11 18:24:16
Tagged date : UTC 2008-12-11 18:24:16

Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 26mn 38s
Bit rate mode : Variable
Bit rate : 700 Kbps
Maximum bit rate : 3 560 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 1.500
Frame rate mode : Constant
Frame rate : 29.970 fps
Standard : NTSC
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.068
Stream size : 133 MiB (100%)
Writing library : x264 core 65 r1051M 549cc55
Encoding settings : cabac=1 / ref=4 / deblock=1:1:1 / analyse=0x3:0x113 / me=hex / subme=5 / psy_rd=0.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=1 / nr=0 / decimate=1 / mbaff=0 / bframes=16 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=0 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=700 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=0
Encoded date : UTC 2008-12-11 18:24:16
Tagged date : UTC 2008-12-11 19:15:43



The MP3

General
Complete name : C:\My Documents\VIDEO_TS\01.mp3
Format : MPEG Audio
File size : 36.6 MiB
Duration : 26mn 38s
Overall bit rate : 192 Kbps
Performer : http://DSPguru.doom9.net
Genre : Other
Writing library : LAME3.90.3
Comment : Made with BeSweet v1.5b31

Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Duration : 26mn 38s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Writing library : LAME3.90.3

Ranguvar
14th December 2008, 22:03
Okay. First thing, the sync is bad dynamically, correct? In other words, the sync gets progressively worse as the video plays? The alternative would be a fixed delay, where the audio is off by an exact time at all places in it.

Second, try using Media Player Classic to play the original video and the encoded audio, and the encoded video with the original audio. You can do this through the Open File dialog. This should help you narrow down whether the video or audio is bad.

andy_blah
14th December 2008, 22:35
I tried what you suggested but only by muxing with MkvMerge because I don't have MPC. Seems that both are faulty, the audio is just desynchronized by a few miliseconds from the original and it does not progress, and the progression of the desync of the mp4(with the AC3) progresses by a strange way, at some times the audio is behind the video, and in other times the audio is in front of the video. Sorry if this is a little bit confusing.

Ranguvar
15th December 2008, 03:17
Err... yeah. That is indeed confusing :p

Let's go to back to square one, and convert the audio and video in a sane way, I say. Along the way we can check out how you did it. What did you use to encode the video? Straight x264.exe, or a GUI? What was your AviSynth script? Did the script play fine? Try playing the script with the audio from the source and see if it has no delay. You can use MPC-HC for this (get it, it's a phenomenal player). What were your options for BeSweet?

andy_blah
15th December 2008, 14:33
Let me explain that again:

A = original
B = re-encoded

Video B + Audio A => desynchronised sound (sometimes the sound is behind the video timeline-wise, and sometimes the sound is ahead of the video, timeline-wise)

Video A + Audio B => desynchronised sound (only by a few ms)

For video encoding I used MeGUI

The Avisynth script only included the original video by DirectShowSource.

I didn't try to load the script, but tested now, in WMP it only plays the sound, and on MPC-HC it displays an error:

C:\My Documents\VIDEO_TS\dvd.avs::Avisynth video #1

Media Type 0:
--------------------------
Video: YV12 720x480 29.97fps

AM_MEDIA_TYPE:
majortype: MEDIATYPE_Video {73646976-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_YV12 {32315659-0000-0010-8000-00AA00389B71}
formattype: FORMAT_VideoInfo {05589F80-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 518400
cbFormat: 88

VIDEOINFOHEADER:
rcSource: (0,0)-(0,0)
rcTarget: (0,0)-(0,0)
dwBitRate: 0
dwBitErrorRate: 0
AvgTimePerFrame: 333667

BITMAPINFOHEADER:
biSize: 40
biWidth: 720
biHeight: 480
biPlanes: 1
biBitCount: 12
biCompression: YV12
biSizeImage: 518400
biXPelsPerMeter: 0
biYPelsPerMeter: 0
biClrUsed: 0
biClrImportant: 0

pbFormat:
0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020: 00 00 00 00 00 00 00 00 63 17 05 00 00 00 00 00 ........c.......
0030: 28 00 00 00 d0 02 00 00 e0 01 00 00 01 00 0c 00 (...Ð...à.......
0040: 59 56 31 32 00 e9 07 00 00 00 00 00 00 00 00 00 YV12.é..........
0050: 00 00 00 00 00 00 00 00 ........


In BeLight:


BeSweet.exe -core( -input C:\My Documents\VIDEO_TS\01.ac3 -output C:\My Documents\VIDEO_TS\01.mp3 -logfile C:\My Documents\VIDEO_TS\01.log ) -azid( -s stereo -L -3db ) -ota( -hybridgain ) -ssrc( --rate 48000 ) -lame( -b 192 --resample 48 )


[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : C:\My Documents\VIDEO_TS\01.ac3
[00:00:00:000] | Output: C:\My Documents\VIDEO_TS\01.mp3
[00:00:00:000] | Floating-Point Process: Yes
[00:00:00:000] | PostGain normalize to : 0.97
[00:00:00:000] +-------- AZID -------
[00:00:00:000] | Input Channels Mode: 3/2, Bitrate: 448kbps
[00:00:00:000] | Output Stereo mode: Stereo
[00:00:00:000] | Total Gain: 7.000dB, Compression: None
[00:00:00:000] | LFE levels: To LR -3.0dB, To LFE 0.0dB
[00:00:00:000] | Center mix level: BSI
[00:00:00:000] | Surround mix level: BSI
[00:00:00:000] | Dialog normalization: -4dB
[00:00:00:000] | Rear channels filtering: No
[00:00:00:000] | Source Sample-Rate: 48.0KHz
[00:00:00:000] +-------- LAME -------
[00:00:00:000] | Bitrate method : CBR
[00:00:00:000] | MP3 bitrate : 192
[00:00:00:000] | Channels Mode : Joint Stereo
[00:00:00:000] | ReSample Rate : 48.0KHz
[00:00:00:000] | Error Protection: No
[00:00:00:000] +---------------------
[00:26:38:272] Gain of 6.0dB had been asserted to file.
[00:26:38:272] Conversion Completed !
[00:26:38:272] Actual Avg. Bitrate : 192kbps
[00:03:26:000] <-- Transcoding Duration

linyx
15th December 2008, 18:41
...the progression of the desync of the mp4(with the AC3) progresses by a strange way, at some times the audio is behind the video, and in other times the audio is in front of the video. Sorry if this is a little bit confusing.
That could mean the audio was behind the video, then because their "framerates" were mismatched, the audio progressed ahead of the video or vice versa. Of course, that's just my guess for that particular problem.

andy_blah
18th December 2008, 12:32
Yes, but still I don't know what to do to stop this from occurring. The original and the converted videos seem have the same frame rate :confused:

nm
18th December 2008, 15:19
What exactly is your source title? It could be mixed progressive (hard- or soft-telecined) and interlaced, which requires a variable output framerate when handled properly. I don't know if MeGUI can automatically pass correct timecodes to the muxer for VFR output.

andy_blah
18th December 2008, 15:25
What exactly do you mean by "source title"? Also, I don't know how to find out if it is hard or soft telecined, but it is indeed telecined (3:2 pulldown)

Guest
18th December 2008, 15:30
What exactly do you mean by "source title"? He means the title of your DVD. Is it "Kureyon Shin-chan"?

To identify soft telecine, open the VOB in DGIndex and do a preview. If the field repeats box increments, then soft pulldown is present.

If you used DGIndex, what field operation was set when you saved your project? If you did not use DGIndex, what did you use? I'm thinking that if you have irregular pulldown and you just ignored the pulldown flags then you can get the variable desync you mentioned.

andy_blah
18th December 2008, 15:49
The title of the DVD is in japanese, and I think that it would be better if I type in the romanization: Kureyon Shinchan: Arashi o Yobu! Yuhi no Kasukabe Boizu

Can you show me an example of what a box increment looks like?(noob question...) Is it by any way those artifacts of the interlaced frames? For your next questions I am quite confused, do I have to do a certain thing in DGIndex, or should I use it just to diagnose?

Guest
18th December 2008, 16:30
Can you show me an example of what a box increment looks like?(noob question...) Do a preview in DGIndex and look at the Info dialog box "Field repeats". Does it stay at zero or count upwards?

Is it by any way those artifacts of the interlaced frames? I can't make any sense out of this question. Would you like to try again?

For your next questions I am quite confused, do I have to do a certain thing in DGIndex, or should I use it just to diagnose? I was asking how you decoded the DVD video stream. What tool did you use? What is your Avisynth script also?

andy_blah
18th December 2008, 16:40
Do a preview in DGIndex and look at the Info dialog box "Field repeats". Does it stay at zero or count upwards?

It counts upwards

I can't make any sense out of this question. Would you like to try again?

Box increments = interlace artifacts?

I was asking how you decoded the DVD video stream. What tool did you use? What is your Avisynth script also?

As mentioned above, only included the video path with DirectShowSource

Guest
18th December 2008, 19:40
It counts upwards Then you have soft pulldown.

Box increments = interlace artifacts? "box increments" means the count in the edit box goes up. I don't know why you are bringing up interlace artifacts in this context.

As mentioned above, only included the video path with DirectShowSource That may be your problem. Try using DGMPGDec and set Video/Field Operation/Force Film in DGIndex. Read the Quick Start guide to get started.

andy_blah
24th December 2008, 15:53
That solved it, Thank-you very much :thanks: