VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 37 of 37
Thread
  1. Originally Posted by pippas View Post
    Slowdn()...
    Note that Slowdn() keeps the same number of frames. So to slow a segment at the end requires that it speed it up at the start. Attached is a sample where it's obvious. At the top is the original clip, at the bottom SlowDn(last, 0, 84, 1.0, 0.5).
    Image Attached Files
    Quote Quote  
  2. I found that script on Doom 9 a while back (authored by a poster named 'le capitain' in 2011), and found it very useful......

    Way beyond my own script writing skills, so I never knew quite which of the 2 functions 'slowdn' and 'speedup' I should use when I wanted to keep a section of a clip at the same speed. Probably neither I suspect..
    But I wouldn't know - for example - how to maintain the last 50 or 100 frames at the end of a clip as all being 0.5 speed..... I would probably just write it as a slowdn from 0.5 to 0.49 ... but I'm sure that's not a very elegant solution?...
    Quote Quote  
  3. Member
    Join Date
    May 2018
    Location
    United States
    Search PM
    pippas, I actually already had that SLO-MO tab open and already had tried that, lol. But I couldn't get it to work very well. I messed around with it some more using your script, but I'm not sure what it needs. Because you have 50 frames that stay at normal speed first, and some frames at the end that stay at half speed. But that doesn't work for me because I already have the audio start at normal speed and end at half and it needs to match the video. With my audio editor, I just have a marker on the playback envelope at the beginning set to 1.0 and is set to "linear", and there's a marker at the end I have set for 0.5.

    I tried just having one Slowdn and having it be Slowdn(source, 0, Framecount(source), 1.0, 0.5) but it didn't work. That seems like it would be the simplest one to do, too. And now that I've played around with the audio speed, I think it is idea to start at 0.8 speed and end at 0.45 speed, but that's beside the point.

    Originally Posted by raffriff42 View Post
    Originally Posted by Idec Sdawkminn View Post
    I'm trying to change the speed of a video to where it starts out at normal speed, ends at half speed, and has an even, regular transition between the 2.
    I would probably use an NLE like Premiere or Vegas for this, BUT -
    there's a plugin called SickJumps that does what you describe. Here's a test script, with my comments:
    Code:
    ## load plugin
    LoadPlugin("c:\some folder\SickJumps\SickJumps.dll")
    
    <DEFINE A SOURCE HERE>
    ConvertToYV12(matrix="Rec709")
    
    ## for debugging/testing
    Info
    
    #@ function SickJumps(clip c, int "first_frame", int "last_frame",
    ##\                 float "start_multiplier", float "full_multiplier",
    ##\                 float "up_seconds", float "down_seconds",
    ##\                 string "script_variable", float "end_multiplier")
    
    SickJumps(100, 590, 1.0, 0.5, 2.0, 3.0)
    ##........^first_frame
    ##..............^last_frame
    ##...................^start_multiplier (speed 1)
    ##........................^full_multiplier (speed 2)
    ##.............................^up_seconds (speed 1 -> speed 2)
    ##..................................^down_seconds (speed 2 -> speed 1)
    
    ## THIS EXAMPLE:
    ## * play 1x speed to "first_frame"
    ## * over the next 2 sec (OUTPUT TIME), ramp down to 0.5x speed
    ## * stay at 0.5x until 3 sec (OUTPUT TIME) before source frame "last_frame"
    ## * over the next 3 sec (OUTPUT TIME), ramp up to 1x speed and play to end
    
    return Last
    The audio changes pitch with speed. The sound is smooth; no glitches - very impressive.
    This one looks interesting as well, but I'm doing the audio separate, so that doesn't matter. But the part I'm confused with is the up_seconds and down_seconds. I don't want it to do it for a certain number of seconds, but more for the duration of the video. I could just modify the script to match the length of each video I do I guess, but would down_seconds be for the length of the video before or after the slowdown? And would up_seconds just be 0 then?

    Lastly, I've been able to successfully do this using the trial of Sony Vegas 15. The "linear" velocity envelope doesn't quite match the rate of my audio editor, but it matches it the closest out of the available settings and if I insert a halfway marker to a certain setting, then the rates match.
    Quote Quote  
  4. Originally Posted by Idec Sdawkminn View Post
    I tried just having one Slowdn and having it be Slowdn(source, 0, Framecount(source), 1.0, 0.5) but it didn't work.....
    I tried modifying the script line in jagabo's post#31 to - "SlowDn(last, 0, 550, 1.0, 0.5)" - but unfortunately that brings up an error here.....

    I did find that the "Slowdn (source, 0, 550, 1.0, 0.5)" seems to work OK - although it only adds 11 frames to the whole sequence, so it's less than half a second longer..... Maybe it's more impressive with a longer sequence?

    Where the 'smoothness' of MVTools can look more impressive than the simple frame interpolation - of functions like 'Linear Velocity' in Vegas - is with more extreme changes.

    Taking 400 frames of my same 'boat' sequence, and slowing that gradually to 1/10th speed - rather than 1/2 - shows that you can retain some 'smoothness' right down to very slow speeds.... That's just not possible with simple frame interpolation.

    But as the others have already made clear, 'optical flow' doesn't always work that well...
    Image Attached Files
    Last edited by pippas; 7th May 2018 at 08:06. Reason: typo
    Quote Quote  
  5. Here's a sample function to linearly slow the clip to 1/2 speed:

    Code:
    #####################################################################
    
    function SlowFPS(clip v, int num, int den)
    {
        # pick the method you want
        # ChangeFPS(v, num, den)  # duplicate frames
        # ConvertFPS(v, num, den)  # blended frames
        SmoothFPS2(v, num, den)  #motion interpolated frames
        # Interframe(v, NewNum=num, NewDen=den, cores=4) # doesn't work
    }
    
    #####################################################################
    
    function SlowToHalf(clip v)
    {
         v+BlankClip(v, length=v.framecount/2)
         Animate(0,last.framecount, "SlowFPS", \
            last, int(last.framerate * 1000), 1000, \
            last, int((last.framerate + last.framerate/2) * 1000), 1000)
    }
    
    #####################################################################
    
    
    WhateverSource("filename.ext") 
    SlowToHalf()
    Other mvtools based frame rate changers should work in place of SmoothFPS2. Note that the number of frames is increased by 50 percent -- as described in the first post.
    Quote Quote  
  6. Member
    Join Date
    May 2018
    Location
    United States
    Search PM
    Originally Posted by jagabo View Post
    Here's a sample function to linearly slow the clip to 1/2 speed:
    !!!!!!!!!!!!!! it looks and syncs perfectly when I use the ChangeFPS one! Thank you!
    Quote Quote  
  7. I found that sometimes there would be a dark frame at the end -- because of the BlankClip() function used to lengthen the source clip in SlowToHalf(). To eliminate that change:

    Code:
        v+BlankClip(v, length=v.framecount/2)
    to
    Code:
        v.Loop(v.framecount/2, v.framecount-1, v.framecount-1)
    I.e.:

    Code:
    function SlowToHalf(clip v)
    {
        v.Loop(v.framecount/2, v.framecount-1, v.framecount-1)
        Animate(0,last.framecount, "SlowFPS", \
    	last, int(last.framerate * 1000), 1000, \
    	last, int((last.framerate + last.framerate/2) * 1000), 1000)
    }
    That lengthens the source clip by repeating the last frame rather than adding a black clip.
    Quote Quote  



Similar Threads