Log in

View Full Version : TMPGenc DVD Author + XviD = sound sync problems.


pojke
17th May 2005, 22:38
I've been using TMPGenc Author to remove unwanted portions of DVD video. Sometimes snipping only a few seconds here and there, and sometimes cutting out long sections of the video. When the edited DVD is re-authored, it works perfectly in any software or standalone DVD player. But when that perfectly working DVD is encoded with XviD, the sound becomes out of sync with the video (sometimes as much as a 3-second lag). The extent of the sync problems seems to be proportional to the number of cuts made before the re-author.

Any ideas about what's causing XviD to do this and how to solve it? I know the original source has been altered, so I don't consider it an encoder bug, but I would really like to find some solution so that I can do those kinds of lossless edits and encode with XviD.

My Xvid settings are here (http://204.127.198.24/~nonpc/xvidsettings.html)
XviD version 1.0-09052004
Encoding is done with Gordian Knot according to the guide.

Teegedeck
18th May 2005, 09:57
I guess it is well possible that you'll have to split, repair and encode the AC3 track manually. But perhaps some of the knowledgeable mods and members visiting this subforum have a better solution at hand. If not, your question could be moved to the audio subforum.

You could also try encoding the source as 'directshowsource' and letting the dshowfilters take care of the delay (as playback of the MPEG2 file apparently worked correctly).

pojke
19th May 2005, 06:52
I'm not sure why this topic got moved from Xvid into the Newbies forum. I'm not new to ripping/encoding and have read the guide and used the programs quite a bit. The problem here seemed pretty specific, which is why I asked about "...what's causing XviD to do this and how to solve it." I was wondering if there were Xvid-specific issues that could be addressed. If not, I'm certainly willing to try another editor (if one exists, but I haven't found anything else with TMPGenc's functionality). But for the encoding, I'd prefer to use XviD.

Teegedeck, thank you for the suggestions. Unfortunately, I don't understand what you mean by split, repair, and encode the AC3 track manually. And I'm not sure what's meant by "encoding the source as 'directshowsource' and letting the dshowfilters take care of the delay." Is that the same as the "direct stream copy" setting in Nandub? Is there a guide that will shed light on this? Point me to it and I'm ready to learn, but I really had hoped it wouldn't be quite as laborious as "split and repair" sounds.

After searching the forums I find it odd that (apparently) no one ever wants to edit a DVD and encode it with Xvid. Or am I the odd one?

Teegedeck
19th May 2005, 14:45
I didn't mean to insult you. Sorry if you had that impression but it's just that

this
Originally posted by pojke
I'm not sure why this topic got moved from Xvid into the Newbies forum.
contradicts this

Unfortunately, I don't understand what you mean by split, repair, and encode the AC3 track manually.

I moved your post to this subforum because it fits here, and here is the place where you are most likely to receive help.

And to answer that question, no, XviD has nothing to do with audio delay; nothing whatsoever, delay is most likely a problem with the audio stream or (de)muxing. I could have moved your post to either DVD Authoring or Audio Encoding, perhaps it will be moved to either one of them eventually. But you might have difficulties comprehending the geek talk, as you had problems with mine -- but: this Newbies subforum is dedicated to explaining complicated stuff in simple words and thus you are probably in the right place, now.


As for 'splitting' and repairing: Open your resulting file with VDubmod, go to the stream list and choose to demux the audio stream. Now you'd have to research yourself how to repair an AC3(?) stream with BeSweet. And then mux audio and video again, using the delay given in the AC3's filename. Might work, might not.
As for 'encoding as directshowsource', this is only one guess, and perhaps not the best solution: Look for the '.avs' file AutoGK produces and replace the word the 'mpegsource' with 'directshowsource', then encode directly with VDubMod (audio, too, use the LAME ACM codec for example). Result will be a stereo soundtrack, but as long as it is in synch perhaps better than nothing.

pojke
20th May 2005, 06:10
No, no, not insulted at all. Just concerned that it was in the right place for the problem. I'm very appreciative of any help wherever it comes from. My impression of the forum came from the description under the title, which reads "If you're new to DVD ripping please post your questions here." And that didn't seem to describe my situation.

By resulting file, I assumed you meant the final .avi, so I opened it with VDubMod and got a warning box: "VirtualDub has detected an improper VBR audio encoding in the source AVI file (audio stream 1). The current preference is to rewrite the audio header....... Do you still want to rewrite the header?" I clicked yes, went to the stream list and chose demux. It produced an mp3 of the audio. I wouldn't know how to go about muxing audio and video again. Besides, you mentioned AC3...... and this is mp3. ??

I replaced 'mpegsource' with 'directshowsource', but when I tried to open the .avs file in VDubMod, an error box popped up: "Avisynth open failure. DirectShowSource could not open as video or audio...... cannot play back the file. The format is not supported." Note: the avs file used was the one produced from the GK encode.

As an experiment, I started fresh and encoded again chosing AC3 in GK instead of mp3. The result was the same sound sync problems.

BTW, you mentioned AutoGK, but that's not what I've been using. I decrypt/rip, then use R4R, then Gordianknot.

killingspree
21st May 2005, 14:00
Originally posted by pojke

By resulting file, I assumed you meant the final .avi, so I opened it with VDubMod and got a warning box: "VirtualDub has detected an improper VBR audio encoding in the source AVI file (audio stream 1). The current preference is to rewrite the audio header....... Do you still want to rewrite the header?" I clicked yes, went to the stream list and chose demux. It produced an mp3 of the audio.


just as a quick hint: never answer this warning with yes, most of the time it does more harm than good.

to your actual problem: most of the time, especially if you just want to cut out portions of the video, it's way easier to encode the video to xvid first and do the editing in a decent avi editor later on. it is imho much easier to edit avis than dvd streams... virtualdub(mod) is actually my tool of choice if all i want to do is cut out some parts of an avi... this should also avoid your sync issues!

changing from mpeg2source to directshowsource is imho not a suitable approach to solving your problem...

pojke
22nd May 2005, 09:14
Well that potentially changes things.
But how to go about editing in Virtualdubmod? I couldn't find a guide for doing that, so I experimented and ran into a lot of problems.

After loading the XviD .avi (one that has not been edited and has no sound sync problems) the same warning popped up, so I chose "no". But the video will not play smoothly and the audio is a stuck loop playing the same 3 sec segment over and over like a mistracking CD. Also, when the stop button is pressed, the program closes.

So I tried choosing "yes" after the warning. It plays more smoothly but the audio is terribly out of sync. Still I tried deleting a few scenes and saving the file. Soon, an out of disk space warning popped up. It had eaten up 22gb of space. The .avi was only 225mb.

I'm really in the dark about this. Do Virtualdub edits require recompression? If so, it's not much of a solution, because it would require compressing the video twice.

killingspree
22nd May 2005, 09:50
editing in virtualdubmod is really easy and comfortable and easy and does NOT require reencoding. a quick rundown of the most important features in virtualdubmod can be found here (http://www.doom9.org/vdubmod-procedures.htm).
the editing guidelines are on the bottom of the page, but the general and muxing directives should be of some interest to you too...

your huge file was caused by a simple setting error... before saving the file, you have to set the video mode to 'direct stream copy' this way, it does not touch the video (except apply the cuts) and should create a file of equal quality than the original

of course editing without recompression is pretty much limited to cutting by keyframe. resolution changes or video filtering is not possible.

hth
steVe

pojke
22nd May 2005, 19:36
Ah... after setting it to direct stream copy, it indeed produced an edited file without recompression.

But the sound was out of sync with the video and there were numerous little pops and blip-like noises throughout the video even in places where there were no cuts.

I did cut on non-keyframes though. It's really not possible to make the cuts I need without doing that. It was frustrating enough cutting by keyframe in TMPGenc Author where there are 15 frames between each keyframe. But when editing this .avi there were 95!!!! frames between the keyframes. That severely limits the choice of where to cut. So much so that it's not an option. Is there a way around this?

Also, as I mentioned earlier, simply playing the video in VirtualdubMod has major problems. It is impossible to even play and stop the movie if you answer "no" to the warning. The audio is stuck in an endless loop and choosing "stop" closes the program. Even when choosing "yes" the sound is out of sync and the video is jerky.

killingspree
25th May 2005, 14:34
Originally posted by pojke

I did cut on non-keyframes though. It's really not possible to make the cuts I need without doing that. It was frustrating enough cutting by keyframe in TMPGenc Author where there are 15 frames between each keyframe.

well at least the end point of your cuts have to be keyframes - otherwise you'll never get an avi in sync, sorry, but nothing you can do about that - 100 frames between keyframes in avis is just normal...


Even when choosing "yes" the sound is out of sync and the video is jerky.

virtualdub is a video editing tool not a video player, do the cuts, export the video, then play it...

pojke
1st June 2005, 23:01
I've now experimented with several movies using VirtualDubMod.

The suggestion was to choose "no" after the initial error message, but again, how is one to edit anything if merely stopping the video closes the program?

So I chose "yes" and made the cuts only at keyframes . The result was the same. A movie with horribly out of sync sound, strange little blip noises at the cuts, and slight freezes in motion here and there throughout the entire video.

These were all perfectly encoded (XviD) movies that played flawlessly beforehand.
So, unless there are settings that will correct these issues, the program seems unable to edit these XviD files.

And I'm essentially where I was with the first post: without a solution for making these edits. Is there one? And if not, why not?