View Full Version : Audio sync problems possibly to do with DGIndex
walkeral
2nd March 2005, 12:32
I have got a rather odd problem concerning audio synchronisation which I am trying to locate the source of.
The process I am currently using is:
Process DVB-T UK stream using ProjectX 0.82.00.02, demuxing audio to mpa and video to m2v
Run m2v file through DGIndex (last time I used 1.1.0)
Load d2v file into AVISynth using MPEG2Source("f:\1.d2v",cpu2="xxoooo",iPP=false,idct=6) and load the audio using MPASource("f:\tl.mpa", normalize = false)
Open the AVS file in VirtualDubMod and extract the audio to a wave file, which is then encoded into Ogg Vorbis using HeadAC3he
Remove the audio input line from the script, then encode video using AVS2AVI and Xvid 1.1.0b1 (also tried using 1.0.3)
The problem then appears when I mux the ogg and avi back together, in that by the end of the film, frames of video appear to have disappeared at some point, messing up the sync!
I initially thought it was ProjectX, but I have checked the m2v file along with the ogg file in Virtualdub and the sync is fine. Opening the AVS file in Virtualdub along with the ogg file also gives a correct sync. The problem is occuring in DGIndex, MPEG2Source, AVISynth, AVS2AVI or Xvid. The last three have no reported problems, leaving DGIndex / MPEG2Source suspect. This problem has occured ever since I started using DGIndex and AVISynth.
Can anybody help with this one? I'm not sure if I have configured something wrong or I am using the wrong method, or if somewhere a bit of software is playing up!
neuron2
2nd March 2005, 14:05
Does the sync error stay constant? If so, just adjust the offset.
Your process is too complicated and uses too many other tools to allow me to comment further. You'd have to isolate your issue better for me to help you further.
walkeral
2nd March 2005, 15:03
The sync errors are intermittent - sometimes you get none, sometimes you get 3 or 4 in different parts of the film. At the moment I have to open the wav file again and manually correct it, then recompress the audio.
I used to do the whole thing in VirtualDubmod and I never got this problem. Unfortunately it kept randomly terminating without giving an error message.
I've downloaded the latest VirtualDub (1.6.4) which is generally stable (although it doesn't support MPEG2 and OGG so makes things more difficult, but AVISynth works fine) - I'll give it a try and see if the error occurs again. It'll probably be a day or so before I know.
walkeral
2nd March 2005, 19:01
It seems the old crash after the first pass routine is still present:
AppName: virtualdub.exe AppVer: 1.6.4.0 ModName: dgdecode.dll
ModVer: 0.0.0.0 Offset: 000012bd
Cyberia
2nd March 2005, 21:37
Simplify your process. Get rid of MPASource and see what happens.
Convert the mpa directly to ogg. I think BeSweet can do this, if not I KNOW BeSweet can convert the mpa to a wav and then you can convert that to ogg.
walkeral
2nd March 2005, 23:46
I've finished the encoding run through VirtualDub and the audio is now fine. Seems that AVS2AVI was responsible for messing up the video. That still leaves the crashing after 1st pass issue - I think this is quite a common one though. I could tell that frames were missing as a scene change near the end was 6 frames later in the new one!
I will mention I've tried converting the mpa directly to ogg, or to wav then ogg (as I tend to edit out the loud noise you get when the stream is corrupted), i.e. not via the same route as the video, and every time it would drift out of sync. I haven't done it that way for over a year now. Thanks for the suggestion anyway.
neuron2
2nd March 2005, 23:49
The crashing is probably because you have cut the TS not at a good picture boundary. You can workaround it by deleting the last picture flags field from the D2V file.
E.g., if the last line is like this:
... 02 02 03 ff
Change it to:
... 02 02 ff
Please let me know if that helps.
walkeral
3rd March 2005, 16:49
OK, I've changed the .d2v file last line from:
800 2 0 1970950706 0 0 32 72 d2 f2 f2 e2 f2 b2 a2 b2 b2 a2 ff
to:
800 2 0 1970950706 0 0 32 72 d2 f2 f2 e2 f2 b2 a2 b2 b2 ff
This time, Virtualdub just closed after the first pass, and the job manager says it was aborted (although it finished fine). No error messages this time though.
neuron2
3rd March 2005, 17:19
What happens if you just preview in VirtualDub when the file reaches the end (with the modified D2V)?
walkeral
7th March 2005, 09:20
The last frame in VirtualDub is a dead frame, with or without the modified .d2v.
neuron2
7th March 2005, 20:13
Try again with DGMPGDec 1.3.0b3. Thank you.
walkeral
7th March 2005, 21:05
With 1.3.0b3 it's exactly the same. I've tried it with the unaltered .d2v file, one with the last frame chopped off, and I've tried removing the last frame from the encoding range - every time VirtualDub just terminates at the end of the first pass with no error messages.
neuron2
8th March 2005, 16:22
What happens with a one-pass encode?
walkeral
9th March 2005, 12:17
Crashes on single pass as well (although output file is fine).
neuron2
10th March 2005, 16:07
Are you able to trim it down (from the front) to a file size that would be small enough to upload to my server (1GB or less)? I don't see how to go any further without being able to duplicate the problem.
Also, what version of Avisynth are you using? Some recent versions have problems like this. Try 2.5.4 if you're using a later version.
walkeral
11th March 2005, 00:34
I can upload a test file and my current AVISynth directory, along with the script file etc. The last few tests I did were on a video about 2000 frames long - about 50MB I think.
neuron2
11th March 2005, 03:11
Yes, please. Put it all in a directory named walkeral.
Also, what about your Avisynth version and trying with 2.5.4?
walkeral
11th March 2005, 17:25
No change with 2.54. I'm uploading the input m2v file, d2v file, the ProjectX logfile, the avs file, and the plugins folder from AVISynth (which contains DGIndex). It should be up in an hour or so (I only have 256kbps upload!)
neuron2
14th March 2005, 15:20
So far I've not been able to reproduce your problem. In view of this:
http://forum.doom9.org/showthread.php?s=&postid=624645#post624645
Can you please try encoding to MPEG2 using TMGEnc or another encoder (avoiding VirtualDub), to see if it is possibly a VirtualDub problem?
Cyberia
19th March 2005, 04:01
I could not reproduce this either.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.