PDA

View Full Version : Code question - where is the error in my normal+slowmotion script?


flame_19
12th January 2006, 13:23
Hey everyone!

I want to cut together some scenes from a long movie. One of the scenes has to be in slow motion. All this has to

be handled in only one avisynth script (sorry). The final outout should be like:

- scene one (normal)
- scene two (slowmotion)
- scene three (normal)



I can produce a simple slowmotion with this code:

-----------------------------------------------------
film = AVISource("d:\mymovie.avi")
ChangeFPS(75)
AssumeFPS(25)
-----------------------------------------------------



When i try to integrate this into a sequence of other, normal scenes, it does not work!

-----------------------------------------------------
film = AVISource("d:\mymovie.avi")

#SCENE ONE (NORMAL)
sceneOne = film.Trim(6000,6030)

#SCENE TWO (SLOMOTION)
sceneTwo = film.Trim(6000,6060)
ChangeFPS(sceneTwo, 75)
AssumeFPS(sceneTwo, 25)

#SCENE THREE (NORMAL)
sceneThree = film.Trim(6000,6040)

#COMPOSE OUTPUT
output = sceneOne + sceneTwo + sceneThree

return output
-----------------------------------------------------


What is my mistake?
Why does this not work?
Is there another simple way to make a slowmotion within a normal sequence?


I am looking forward for all kind of help!
Christop

communist
12th January 2006, 13:46
#COMPOSE OUTPUT
output = sceneOne + sceneTwo + sceneThree

return output
-----------------------------------------------------


What is my mistake?
Why does this not work?


You're telling AviSynth to pick sceneOne / Two / Three which are defined as?

Film.Trim(...)

Try with this:

film = AVISource("d:\mymovie.avi")

#SCENE ONE (NORMAL)
sceneOne = film.Trim(6000,6030)

#SCENE TWO (SLOMOTION)
sceneTwo = film.Trim(6000,6060).ChangeFPS(sceneTwo, 75).AssumeFPS(sceneTwo, 25)

#SCENE THREE (NORMAL)
sceneThree = film.Trim(6000,6040)

#COMPOSE OUTPUT
output = sceneOne + sceneTwo + sceneThree

return output

flame_19
12th January 2006, 14:43
Thank you!

However your code is not working. But that's only a small bug, here comes the final working code.

-----------------------------
film = AVISource("d:\mymovie.avi")

#SCENE ONE (NORMAL)
sceneOne = film.Trim(6000,6060)

#SCENE TWO (SLOMOTION)
sceneTwo = film.Trim(6000,6060).ChangeFPS(75).AssumeFPS(25)

#SCENE THREE (NORMAL)
sceneThree = film.Trim(6000,6060)

#COMPOSE OUTPUT
output = sceneOne + sceneTwo + sceneThree

return output
----------------------------

Thanks again for the quick help!
Christopher

communist
12th January 2006, 15:54
Ah yes - stupid me I left the references to the clips in the Change/AssumeFPS commands ;)