VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. How do you copy frames with VirtualDub or AviSynth? This would seem easy enough but after searching the Intertubes, and AviSynth Wiki, I can't find a solution.
    Quote Quote  
  2. What do you mean by "copy frames"? Do you mean video? or stills ?

    If you mean video, in vdub, video=>direct stream copy, file=>save as avi. You can mark in/out if you want a section

    Avisynth requires re-encoding, because it decompresses the frames
    Quote Quote  
  3. Basically I have a an AVI video and I want to copy specific sections to pad them out. So instead of cutting the video into many sections I just want to have let's say frames 100 - 110 copied 10 times each and 500 - 510 copied 50 times each. I know this will cause a sort of slow motion effect which is fine. Is this doable or should I be doing it a different way?
    Quote Quote  
  4. You should be able to do it in avisynth

    Do you care about the audio? It will desync if you insert copied frames if you don't account for that

    Do you want it appended to the other "normal" sections? So frames 0-99 would be the same as the original?

    How do do you want "padded?" , do you mean section sequence 100-110 repeated 10 times ; or frame 100 repeated 10x, then 101 repeated 10x, etc...

    A 10x frame repeat will give a slo mo effect, but very noticeably choppy. Other options would be to apply blurring or blend frames, or generate intermediate frames (frame interpoloation). It depends what you are trying to do and the "look" you are going for. Maybe you could describe in better detail exactly what you are trying to do?
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    You should be able to do it in avisynth

    Frame 100 repeated 10x, then 101 repeated 10x, etc...
    This.
    Quote Quote  
  6. ok disclaimer; I just know the avisynth basics, so this might be a "clunky" way of doing it and there are probably cleaner ways to do this:

    Code:
    a=AVISource("video.avi").Trim(0,99)
    b=AVISource("video.avi").Trim(100,110)
    c=AVISource("video.avi").Trim(111,200)
     
    d=Interleave(b,b,b,b,b,b,b,b,b,b)
     
    a++d++c
    In this example, "a" represents frames 0-99, "b" is section 100-110, "c" is section 111-200. Interleave will alternate frames between videos , so Interleave(video1, video2) would alternate frames from video1 and video2 (so frame 0 video1, frame 0 video2, etc...).

    You may have to adjust the fps of the interleaved section, depending on what you want to do. (e.g. use AssumeFPS)
    Quote Quote  
  7. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by poisondeathray View Post
    You may have to adjust the fps of the interleaved section, depending on what you want to do. (e.g. use AssumeFPS)
    You will have to adjust it, since Interleave changes the frame rate and you can't append sections with different rates. Also, a less 'clunky' way (especially for repeating say 50 times) would be:
    Code:
    v=AVISource("video.avi")
    a=v.Trim(0,99)
    b=v.Trim(100,110)
    c=v.Trim(111,499)
    d=v.Trim(500,510)
    e=v.Trim(511,0)
     
    b2=b.ChangeFPS(v.FrameRate*10).AssumeFPS(v)
    d2=d.ChangeFPS(v.FrameRate*50).AssumeFPS(v)
     
    a++b2++c++d2+e
    This repeats frames 100-110 10 times and frames 500-510 50 times.
    Quote Quote  
  8. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by Gavino View Post
    Also, a less 'clunky' way...
    Can simplify the syntax a bit:

    Code:
    AVISource("video.avi")
    Trim(0,99)                                                ++\
    Trim(100,110).ChangeFPS(FrameRate*10).AssumeFPS(FrameRate)++\
    Trim(111,499)                                             ++\
    Trim(500,510).ChangeFPS(FrameRate*50).AssumeFPS(FrameRate)++\
    Trim(511,0)
    This way you can just keep adding sections as you like, without having to make up and remember variable names. The only variable you need is "last", and you don't even have to state that as it's implicit.
    Last edited by AlanHK; 27th Jan 2010 at 11:34.
    Quote Quote  
  9. I was actually going to post about the frame rate error I was getting so I will try these new scripts and see what happens.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!