digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: EnsureVBRMP3Sync (http://www.digitalfaq.com/archives/avisynth/2512-avisynth-ensurevbrmp3sync.html)

rendalunit 02-06-2003 07:41 PM

EnsureVBRMP3Sync
 
How does this filter work?

Fiz 02-07-2003 04:34 AM

I had to use this for the first time recently. It maintains audio sync with the video.

My situation was I had a divx avi in 3 parts, plus a deleted scene.

My aim was to include the deleted scene into the video and trim off some excess from the end and in between. So my avs script looked like this.

Code:

plugindir = "D:\Avisynth\"
LoadPlugin(plugindir + "mpeg2dec.dll")
LoadPlugin(plugindir + "GripFit_preview.dll")
LoadPlugin(plugindir + "blockbuster.dll")
LoadPlugin(plugindir + "legalclip.dll")
LoadPlugin(plugindir + "sampler.dll")
LoadPlugin(plugindir + "dustv5.dll")
LoadPlugin(plugindir + "temporalcleaner.dll")


disc1=AviSource("D:\DivX\LDisc1.avi")
disc2=AviSource("D:\DivX\LDisc2.avi")
disc3=AviSource("D:\DivX\LDisc3.avi")
delscenes=AviSource("D:\DivX\LDelscenes.avi")

part1=disc1.trim(0,147972)
part2=disc2.trim(1000,41460)
part3=delscenes.trim(0,26577)
part4=disc2.trim(41461,121691)
part5=disc3.trim(0,49103)


movie = fizconvert(part1+part2+part3+part4+part5).sampler(length=24)

return movie


function FizConvert(clip l)
{
return l.ConvertToYUY2().
\LegalClip().
\GripCrop(528, 576, overscan=2).
\GripSize().
\SpaceDust().
\TemporalCleaner().
\LegalClip()
}

The video was formed perfectly and I then loaded the AVS into vdub and did a save WAV. The problem I had was that whereever I had trimmed the video and the start frame was not 0, the audio had not trimmed at the right place. I was forever confused as to why some parts of the movie were completely out of sync. :?

I then used EnsureVBRMP3Sync in the line before each trim
e.g.
part2=disc2.EnsureVBRMP3Sync.trim(1000,41460)

and did an audio extract from vdub. Hey presto, it was perfectly in sync! :D

Hope this helps.

rendalunit 02-07-2003 02:09 PM

Hey that helps me a lot! I wasn't loading my .avs into vdub- just the appended avi's- so I guess that's why this filter wasn't working :wink: btw- that's a very cool script 8)

Fiz 02-10-2003 04:26 AM

thanks 8) , I'm trying to create all my avs scripts with a similar template. I know the filters I want to use so I keep them in a function and only change the bits at the top. Still learning the ropes though!


All times are GMT -5. The time now is 01:58 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.