Log in

View Full Version : Can't keep audio in sync during frameserve. why?


link626
9th August 2010, 11:25
here's my problem.

I have an xvid file which has 100,000 frames, vbr mp3 audio.

I only want to encode frames 50000 to 51000. I make the avs script, and frame serve it to Megui.


DirectShowSource("D:\test.avi", fps=29.970, audio=true, convertfps=true)
#deinterlace
crop( 0, 0, 0, 0)
Trim(50000,51000)
LanczosResize(800,432) # Lanczos (Sharp)
#denoise


I setup Megui to encode audio with Lame, based on the frames in the avs script.

The video is encoded correctly- it has the correct 1000 frames.
But the audio is way off, and does not correspond to frames 50000-51000. It sounds like it encoded some other part of the movie.

If Avisynth served up frames 50k-51k, why did the mp3 encoder encode 1000 frames from some other segment?

what's the proper way to frameserve the audio?



btw, if i frameserve the whole xvid and reencode it without trimming, there are no sync problems.
It only happens when I want to encode a small segment of a movie

Gavino
9th August 2010, 11:30
Use EnsureVBRMP3Sync (http://avisynth.org/mediawiki/EnsureVBRMP3Sync)().

link626
9th August 2010, 11:46
thanks. that worked

stax76
9th August 2010, 12:03
You could just cut MP3 without encoding.