PDA

View Full Version : Change FPS w/o audio de-sync


benedict
14th August 2002, 20:14
I need to convert a 10 fps video to a 30 fps video by tripling every frame. DJ Bobo was nice enough to recommend Avisynth and to provide the following code that will do this for me:

selectevery(3,1,1,1,2,2,2,3,3,3)

Now, I'm obviously new to this Avisource and I am trying to work my way through all the literature on it. Not the easiest thing.

Anyways, here's my question(s): I'm viewing this coding as "for every 3 frames, output frame1 three times, output frame2 three times, and then output frame3 three times".

I think that I must be missing something here. Either I don't understand the decoding of this statement, or wouldn't the statement:

selectevery(1,1,1,1)

do just as well? I'm obviously not seeing something, and I can't find an answer in the documentation.

Also, in the literature, the "selectevery" command always ends with (or starts with, depending on which doc's I look at) the word "clip". What is "clip"? Is it just something to add (seems silly), is it a variable name, or is it something I'm not even seeing?

hakko504
14th August 2002, 20:39
About clip:
Clip is a video sequence. Normally when you write a AVIsynth file you only use the implied function last as input clip to every command. The following pieces of code are all equal:AVISource(file.avi)
BicubicResize(352,288)
AVISource(file.avi)
last.BicubicResize(352,288)
AVISource(file.avi)
BicubicResize(last,352,288)
video=AVISource(file.avi)
video.BicubicResize(352,288)
video=AVISource(file.avi)
AVISource(video,352,288)
The reason for this variety is that in normal operation you want to keep the.avs as simple as possible (using the first kind of script).
Secondly, when using filters like Dissolve and MAM that takes multiple video sources as input arguments you must store at least one of the arguments as a variable. Example:
video=AVIsource(file.avi)
part1=video.trim(0,100)
video.trim(200,0) #here last is not defined as previous
#statement didn't return anything but
#put the result in the variable part1
Dissolve(part1,last,25) #mixes the overlap between part1 and
#the final part

dividee
14th August 2002, 22:20
And about selectevery: your reasonning is right, but the command should be: selectevery(1,0,0,0) since the frame numbering starts at 0.

benedict
15th August 2002, 06:41
@dividee

Ah, yes. The documentation did indeed mention frame numbering starting at zero. Thanks! That's one less mistake I'll make.

@hakko504

Which is why DJ Bobo didn't specify "clip" ... this would be implied by the AVISource statement preceding it. I'd only use that were I to want to take my input from elsewhere in my script.

Thanks all.