Back Forum Reply New

Changing FPS without Audio out of sync.

My video capture device captures video at 30fps. Unfortunately I can't use 30 fps if I want to put the content onto a DVD. So when I change the FPS to 29.97 the audio becomes out of sync. I tried adjusting the Delay parameter, but that just made things worse. Is there a way that I could change the audio so it's in sync with the video?

I tried searching these forums but couldn't find any definitive answers.

Method 1, easiest: drop 1 of every 1001 frames (or fields). Any decimator should handle that fine.

Method 2, overkill: motion compensate into the new framerate.

Method 3, sensible: stretch the audio to 1001:1000 of the original rate, then just change the framerate (via assumefps). Since you have to resample to 48000 anyway, unless your camera captures in that, it shouldn't hurt it any more.

Hmmmm, this almost sounds like what I do for Pal-gt;NTSC which is 25 to 29.97.

All that I do is demux the audio, ChangeFPS(29.97) on the video then remux the audio back in.  Works 100% for me with no loss of sync for even a 3hour movie.

Would be the same even in your case of 30-gt;29.97

Sure, changefps works, that's my #1. You don't even have to demux/remux the audio because the filter leaves it alone. (I don't like it for 25-gt;30 because the stutter is pretty noticeable with progressive frames, but much less so for interlaced content.)

I never had a problem taking a dvd pal and doing it like that.

Dvd Pal -gt; Demux AC3 -gt; ChangeFPS(29.97) -gt; CCE -gt; DVD Lab Pro.  Bring in the ac3 and the now 29.97i NTSC mpeg2.  Not one bit of stutter on any of my dvd's and no sync loss.

Use TimeStretch.  Resampling the video is always going to be more noticeable.

Here is what I do for my captures:
avisource(quot;z:\my_capture.aviquot;)assumefps(29.97,true)

The quot;truequot; parameter will adjust the audio sample-rate to match
the video length.

Then you seperate the audio to a wav.  I use VirtuaDub and do
quot;save wav.quot;  I then resample the wav using Sound Forge which
does resample and timestretch in one operation.  I'm not
aware of another program that does this. If you use quot;changefps,quot; the rate will be fine, but you will
get blended frames.

ConvertFPS blends frames (normally). ChangeFPS just repeats or axes frames.

Avisynth comes with its own audio resamplers, ResampleAudio amp; Ssrc. You can use it like so:

avisource(quot;blue.aviquot;).assumefps(29.97,true).Ssrc(48000)

Ssrc quality compares very favorably to eg. Soundforge, Audacity, etc; ResampleAudio is faster but lower quality.

lt;igt;ConvertFPS blends frames (normally). ChangeFPS just repeats or axes frames.lt;/igt;

What?

ConvertFPS might blend.

Why would you want that?

lt;editgt;

I'm not going to argue.  I've presented my solution.  Revgen will decide.

foxyshadis was refuting your statement that ChangeFPS blends.  There's nothing to argue: ChangeFPS never blends.

BTW, if you want to delete 1 of every 1001 frames, I've got this DeleteEvery function that's good for that.

Thanks guys.

I decided to bob the video with EEDI/TDeint and use the assumefps(59.94,true) command to avoid any chance of field problems. I then used separatefields().selectevery(4,0,3).weave(). It seems to work well since there is no audio sync issues.

For some reason Ssrc said that it was unable to convert my audio to 48khz. So I demuxed it with Vdubmod and converted it with winamp's diskwriter plugin. Everything seems to be in order now.

IIRC Ssrc can't do arbitrary conversions, there has to be some relation between input rate and output rate but I can't remember exactly what it is. I would imagine the adjustfps(59.94, true) leaves you with an audio input rate that Ssrc doesn't like.

IIRC Ssrc can't do arbitrary conversions, there has to be some relation between input rate and output rate but I can't remember exactly what it is.

Yup. Too lazy to look up the documentation?

Ssrc

@Rev,

Try ResampleAudio:

Code:
avisource(quot;blue.aviquot;).assumefps(29.97,true).ResampleAudio(48000)
Originally Posted by revgenI decided to bob the video with EEDI/TDeint and use the assumefps(59.94,true) command to avoid any chance of field problems. I then used separatefields().selectevery(4,0,3).weave(). It seems to work well since there is no audio sync issues.

provided you know what the input field order is (hint:  if 4,0,3 is giving you top first, then the source is top-first), then you will not have to bob first - that's just wasted time if you're re-interlacing without changing the number of frames.

try:
assumefps(30000,1001,sync_audio=true).resampleaudio(48000)

and you'll (hopefully) find that it's a lot faster with the same result

I'm well aware when it comes to interlacing issues. It was a TFF source, so it worked fine.

It was the audio that was giving me problems. I'm kinda a noob when it comes to audio stuff. Knowing the quot;truequot; command for AssumeFPS should now help me in the future. Hopefully.

I'll try the ResampleAudio command the next time and see how it works.

Edit: Moved to separated thread by topic starter

@ stickboy

You know, it's funny. I can't find the thread, but some time ago
I had a problem with a capture that involved frame-blending.

You asked me to post my avisynth script. Esby replied and
told me to use quot;assumefpsquot; rather than quot;changefps,quot; which stopped
the blending (could have been quot;convertfpsquot;).

Beats me. Whatever works is fine.
¥
Back Forum Reply New