Log in

View Full Version : MeGUI: (xvid + vbr/mp3) --> (x264 + aac) Sync problem...


Buzz Lightyear
1st September 2007, 12:48
I've been converting a bunch of (xvid + vbr-mp3) files to (x264 + aac) with my batch encoding script (see http://forum.doom9.org/showthread.php?t=129415). But all the resulting mp4 files are out of sync. :( (when played with MPC-Homecinema)
(btw, I get exactly the same results with MeGUI, so my script is not the reason for the sync issue)
I'm pretty sure that the reason for that is the "improper VBR audio encoding" in the avi, as VDubMod calls it.

Is there any way to resolve/fix this? I've been searching the forum, but couldn't find a solution....

Thanks
Buzz Lightyear

check
1st September 2007, 13:22
what avs script do you use to load the files?

Buzz Lightyear
1st September 2007, 13:42
avs script for audio:
DirectShowSource(test.avi,fps=23.9759856527702)
avs script for video:
DirectShowSource(test.avs,fps=23.9759856527702)
Undot()
MSmooth(threshold=5, strength=3, chroma=false, mask=false

I don't think there is something "wrong" with the conversion, but the source (xvid/vbr-mp3) is funny.
If I play the source avi in MPC, everything is fine. If I demux the mp3-stream with VDubMod and play that demuxed mp3 file along with the source avi (in MPC: Play - Audio - then select the mp3 file as audio), I get the same sync error as before.
I think the problem is the vbr-mp3 in the avi container. Somehow it plays correct as long as you don't demux the audio....
Btw, the sync-error is progressive. None at the beginning, getting worse with time.

Sharktooth
1st September 2007, 14:16
well the VBR in AVI is an old story. that's why hacking things into AVI is ALWAYS a bad idea.
However, your problem is fixable. Just note how much desynch you get at the end so you can correct the source audio rate

Atak_Snajpera
1st September 2007, 14:18
Instead of loading avis using DirectShowSource use OpenDMLSource or AviSource.

Sharktooth
1st September 2007, 14:30
good hint. i completely forgot there was avisource... :D

check
1st September 2007, 14:39
fps=23.9759856527702Try replacing this with the proper framerate too, ie 23.976.

Buzz Lightyear
1st September 2007, 15:30
Thanks for the quick replies. That's what i love about this forum.

Try replacing this with the proper framerate too, ie 23.976.
That hardly is the reason for 3-5 secs out of sync. The 23.9759856527702 comes from MeGUI, btw. I just copied it into my script.

Instead of loading avis using DirectShowSource use OpenDMLSource or AviSource.
I guess you're talking about http://avisynth.org/mediawiki/OpenDMLSource , right?
I'll give it a try, and let you know what happend.

Btw., wouldn't it be a good idea for MeGUI to use AviSource if the source is AVI? (provided that solves my sync problem....)
I more or less based my whole script on the MeGUI "commandlines". And MeGUI uses DirectShowSource, right?

Atak_Snajpera
1st September 2007, 15:47
Btw., wouldn't it be a good idea for MeGUI to use AviSource if the source is AVI? (provided that solves my sync problem....)

Yes! MeGUI developers should swap DirectShowSource to OpenDMLSource. I prefer OpenDMLSource because it supports larger files.

Buzz Lightyear
1st September 2007, 17:10
Hey! It works! :)
I changed DirectShowSource to AviSource and now everything is fine. I don't even have to specify the fps of the movie during encoding. Only for muxing (mp4box) i still need the -fps 23.97....

Something I still don't understand: (old = DirectShowSource, new = AviSource)
When I mux video_old + audio_new I'm still out of sync.
When I mux video_new + audio_old, it's fine. (video_new + audio_new certainly also)
I thought that the audio_new would be different from the old one. Instead it looks like the video gets encoded differently. Which means that I can throw all my converted video in the bin, and start all over. :|

Now one should only change that in MeGUI also. That shouldn't be too hard, and would probably help a lot of people.

vassie
1st September 2007, 18:30
I too am having sync issues, how exactly do I switch to AviSource?
Thanks

Atak_Snajpera
1st September 2007, 18:35
Instead of DirectShowSource("movie.avi") use AviSource("movie.avi")

vassie
2nd September 2007, 09:28
Instead of DirectShowSource("movie.avi") use AviSource("movie.avi")

Thanks :)

Sharktooth
2nd September 2007, 14:33
Btw., wouldn't it be a good idea for MeGUI to use AviSource if the source is AVI? (provided that solves my sync problem....)
I more or less based my whole script on the MeGUI "commandlines". And MeGUI uses DirectShowSource, right?

Post it in the feature requests (MeGUI project at sourceforge).

Weltall
8th September 2007, 10:59
I always have the same problem and it isn't only with vbr, but with every avis. So this isn't a fixable problem? Everytime I wanted to join x264+aac through directshow I'll get this delay? Isn't there a ffdshow or avisynth new version which don't have this problem?

Sharktooth
8th September 2007, 12:30
no. just use AviSource() instead of DirectShowSource().
you can also try ffmpegsource()...
however megui (development version) now uses AviSource() for .avi files.

Weltall
9th September 2007, 04:06
Oh great! So it's ok now :)

Thanks Sharktooth.

P.S.: what you mean with development version? Is there any other versions? I have 2.6.1001 installed.

Sharktooth
10th September 2007, 18:19
0.2.6.1011 is the latest development (AKA unstable) version