Log in

View Full Version : Audio sync problems...


Izik
15th November 2002, 03:56
Hi. I'm newbie to all the stuff in this subject, so please forgive me if my question is too silly...
Also, i'm newbie to english, so sorry for wrong typing...
This is the first movie that I'm try to convert from DVD to AVI using Gordian Knot 0.26 beta version and DivX 5.0.2 pro Bundle.
I did every step as writing in the guide, and after about 24 hours, i've got the perfect product. A avi file, about 1.32 GB size, with audio (in mp3 quality) and subtitles. evreything seems to be okay, until i try to split the movie in Virtual Dub.
When I just open the file in VD, i've got the alert:

"VirtualDub has detected an improper VBR audio encoding in the source AVI file and will rewrite the audio header with standard CBR values during processing for better compatibility. This may introduce up to 18249 ms of skew from the video stream. If this is unacceptable, decompress the *entire* audio stream to an uncompressed WAV file and recompress with a constant bitrate encoder. (bitrate: 115.6 + 9.9 kbps)"

I don't take this to my mind and splited the movie using "Direct stream copy" in both audio and video. After this, I've played the second part of the movie, and OOPSS...!!! The sound and video was not sync!! The voice played after the pic is shown in the screen!! Now i returned to the big, unsplitted file (the whole movie file), and try to start the movie from the middle by dragging the slide, and again, the voice was not sync with the pic. i've try to decode again the audio by select "Full proccessing mode"and chosse PCADM in the compress dialog, but nothing help... )-:
what can i do?
Here are the movie details as shown in VD:

Video:
Frame size: 608x448, 25.000 fps
# of frames (time): 167051
Decompressor: DivX Pro 5.0.2 Codec
Number of key frames: 1259
Min/avg/max/total key frame size: 2989/22869/85846 (28118K)
Min/avg/max/total delta frame size: 8/7745/159590 (1254002K)

Audio:
sampling rate: 48000Hz
Channels: 2 (Stereo)
Sample precision: 0-bit
Compression: Fraunhofer IIS MPEG Layer-3 Codec
Preload skew: 384 samples (0.01s)
# of frames: 278418
Min/avg/max/total frame size: 96/346/768 (94306K)

and here are the AVS file:
#
# Created with Gordian Knot
#
# http://thewef.nav.to
#
# PLUGINS
# get them from http://users.win.be/dividee
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\decomb.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\InverseTelecine.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\Avisynth_Spatial.dll")
#LoadPlugin("C:\PROGRA~1\GORDIA~1\GreedyHMA.dll")
LoadPlugin("C:\WINDOWS\SYSTEM\vobsub.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\SimpleResize.dll")
#
# SOURCE
mpeg2source("C:\First Movie\The Boat.d2v")
#
# TRIM
trim(0,157099)
#
# IVTC
#Telecide()
#Decimate(cycle=5)
# or use
#InverseTelecine(40,10,15)
#GreedyHMA(1,0,4,0,0,0,0,0)
#
# DEINTERLACING
FieldDeinterlace()
# or use
#VerticalReduceBy2
# or maybe
#GreedyHMA(1,0,0,0,0,0,0,0)
#
# CROPPING
crop(2,0,713,574)
#
# DENOISING: choose one combination (or none)
# 1) little noise (fast)
#TemporalSmoother(2,1)
#
# 2) medium noise (slow)
#SpatialSoftenMMX(1,4,6,false,false,4,4,6,8)
#TemporalSmoother(2)
#
# 3) heavy noise (very slow, you have been warned)
#SpatialSoftenMMX(2,4,6,false,false,4,4,6,8)
#TemporalSmoother(3)
#SpatialSoftenMMX(1,4,6,false,false,4,4,6,8)
#
# SUBTITLES
VobSub("C:\First Movie\Vts_01_0")
#
# RESIZING
SimpleResize(608,448)
#
# BORDERS
#AddBorders(left,top,right,bottom)
#
# COMPRESSIBILITY CHECK
# !!!!Snip Size now has to be 14 for use in GKnot!
#SelectRangeEvery(280,14)
#
# FOOL CCEnc
#ResampleAudio(44100)

hope this will help,
izik.:confused:

colordog
15th November 2002, 05:32
The same thing happens a lot to me when I try to split with VirtualDub - I get that audio error when you open the AVI.

Unfortunately, I'm too ignorant to have yet figured out why this sometimes happens. However, I do know that when that happens with VirtualDub, that if I open it in NanDub and split it there instead, it has always worked for me (~6 cases).

I just followed the NanDub AVI-splitting instructions posted on the GKnot Guide page: http://www.doom9.org/virtualdub_procedures.htm#Splitting

I know they're similar programs, but like I said, I don't know why, just that it works for me. Hope this helps you out!

jggimi
15th November 2002, 06:27
Let me ease your confusion. GKnot uses both Virtual Dub and Nandub to create a DivX 5 .avi file.

Virtual Dub is used to encode DivX 5 video, creating a silent, video-only _movie.avi file.

Nandub (a special, modified version of Virtual Dub) is used to interleave the audio with the video to create the final .avi file.

Nandub was designed for DivX 3 video encoding, and that is the only video codec it supports. However, unlike Virtual Dub, it supports many different types of audio, and can also manage multiple audio tracks in a single .avi file.

If you're following Doom9's guide, you are creating a variable bitrate mp3 audio stream. Virtual Dub supports mp3 audio, but does not support vbr mp3.

That is why, when you're following Doom9's DivX 5 guides, if you click on the link for splitting .avi files, you will see instructions and sample GUI windows for Nandub, not Virtual Dub. Audio format flexibility is one reason, the other is that Nandub has management capability for splitting files by MB, which makes splitting a little easier.

colordog
15th November 2002, 06:56
Hey -

Sincere thanks for the excellent explanation! I always wondered what the true difference between the two programs is. Thanks!

Hiro2k
15th November 2002, 06:57
You can change the way you create an mp3 in Gknot by using the advanced commands in besweet. I think you just use

--alt-preset cbr 192

This will encode your audio at a constant bitrate of 192 or whatever bitrate you want. Also I have read that splitting cbr files is less prone to become out of sync after you split the avi.

Izik
16th November 2002, 23:31
if i followed the guide and craete sound file as write in the guide, i'll must split it with Nandub and not with Virtual Dub?
Cause I think that i don't use any speciall command in BeSweet, just check the "MP3, 128kBit/sec. avrage bitrate" option (not the "MP3, custom parameters") and that may be the reason for this problem.
Also I've the other problem, which i wrote in the first massage, that when I jump to the middle of the movie, in the one big file (before the splitting), its does also sync problems. how could i solve THIS problem?

colordog
16th November 2002, 23:56
Izik -

1) I think what jggimi meant is that when you make an encode with Gordian Knot, BeSweet (the audio encoding component) will default to making a _variable_ bitrate MP3. VirtualDub will choke on this (as you know), so for those you'll need to split with NanDub instead, as shown on that FAQ page.

2) I think what Hiro2K was stating was that instead, if you still wanted to use VirtualDub, you could use command flags to instruct BeSweet to make a _constant_ bitrate MP3 instead. Like he said, you on the audio encoding page under "Transcoding Parameters" on the "Lame" setting, you change ABR to CBR, and the number is whatever kpbs you enjoy.

3) If you look at the GKnot Guide, you'll see that it recommends some specific parameters, and this'll make you more familiar with Hiro2K's suggestion: http://www.doom9.org/gknot-divx5.htm

4) Actually, you don't talk about sync problems before splitting your AVI. In fact, you say that everything's okay until you split the movie. Is your audio off the same amount of time throughout the whole movie, or does the time-offset change as the movie progresses?

Izik
17th November 2002, 00:39
Firstable, thanks for all the replies...
If you read the WHOLE first massage you will see:
"Now i returned to the big, unsplitted file (the whole movie file), and try to start the movie from the middle by dragging the slide, and again, the voice was not sync with the pic."
But its doesn't metter, I've this problem and that's it.
The specific problem is that:
When the movie start from the begin, all is okay. If I don't stop it from running streamly, its all fine. All the bugs come when I just touch the slide. If I want to jump to another section of the movie, even a little forward, the sync problems start. But if i don't touch the slide and let the movie go on, its all o.k.
Hope you'll understand this with my bad english...
Izik

killingspree
15th December 2002, 14:26
usually it always works fine for me too... but this time it just wont. I can jump around in the unsplit videofile without problems though.
i've tried splitting with both vdub and nandub. both have got probelms. while in vdub the split files just wont display any video afterwards in nandub the audio and the video are out of sync.

Anyway, i've had that problem before and most of the time it helps if you
a) check if you've used a keyframe as a splitting point
b) remux the avi
c) sometimes it helps to just run the file through nandub with audio and video in direct stream copy mode (so it just writes a new header)
d) or alternative to the "resaving" in nandub it sometimes works if you use divfix (programm to fix small errors in avis) -> just search the download section on doom9.org

in my case all these 'tricks' do not help, so maybe somebody has found a different solution.
regards
steVe

EDIT: as long as you haven't solved the searching problem in the big avi file i see no sense in going on to splitting the avi at all.

ReTroAcTive
19th December 2002, 11:30
when i try to play some of my movies on a 533 celron, with intel video, it plays fine, till i jump the slider like Izik. when i jump it forward or back, the video pauses just a few seconds but the audio doesnt, does this happen to you too Izik? i think its more to do with the high resolution because it plays most of the movies i make just fine even when i jump the slider forward or back.
Izik maybe if you slide your quality level setting on your divx decoder down a little and see if that helps at all.
by the way Izik, your english is quite good really.

EDIT
i should also add the same movies play, jump forward and jump back fine on any of the other puters.