VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 39 of 39
  1. Originally Posted by jagabo View Post
    In the version of AviSynth I have TimeStreth's tempo parameter is percent. Ie, tempo=10 makes the tempo 1/10 of the original (very slow). If you want it twice as fast you specify tempo=200. 10 times as fast, tempo=1000.
    Yes, jagabo. I saw it.

    @Gavino.
    I had considered this whole thread solved before test your example. But now, putting it on the desk, your example has no sound at all.
    What is wrong here?
    Code:
    v1=DirectShowSource("D:\work\test1.mp4")
    
    #v=ffmpegsource2("D:\work\test1.mp4", atrack=-1)
    
    #v = FFVideoSource("D:\work\test1.mp4", atrack=-1)
    #selectevery(last, 2)
    
    #selectrangeevery(v, 5, 1, audio=true)
    
    v=SelectEvery(v1, 10).AssumeFPS(v1)
    a=TimeStretch(v1, tempo=500)
    
    #a = FFAudioSource("D:\work\test1.mp4")
    
    #AssumeFPS(30000,1001)
    
    AudioDub(v,a)
    P.S.: And, with some situations, AvsPmod crashed miserably...
    Thank you.
    Quote Quote  
  2. Originally Posted by jairovital View Post
    your example has no sound at all.
    Shame on me...


    My kid had turned off my speaker...

    Sorry, guys. It's all fine.
    Thank you.
    Quote Quote  
  3. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    In the version of AviSynth I have TimeStreth's tempo parameter is percent. Ie, tempo=10 makes the tempo 1/10 of the original (very slow). If you want it twice as fast you specify tempo=200. 10 times as fast, tempo=1000.
    Yes, my mistake - I meant 1000.

    Originally Posted by jairovital View Post
    I had considered this whole thread solved before test your example. But now, putting it on the desk, your example has no sound at all.

    P.S.: And, with some situations, AvsPmod crashed miserably...
    I tried your example code and it worked OK (used AvsP to launch MPC as a player).

    What are you using to play the script?
    You could try adding ConvertAudioTo16Bit() at the end.
    TimeStretch delivers float audio, which some players might not like, but the Avisynth VfW interface converts this to 16 bit anyway, so it shouldn't make a difference unless the player is using the Avisynth API directly.

    EDIT: Ah, I see it was a false alarm. I'll leave the info there as it might be useful in future searches about TimeStretch().
    Quote Quote  
  4. Yes, my friends, this long walk didn't reach its end...
    I keep creating challenges, trying to make different scripts to better understand that infinite thing called avisynth.
    For the most of you, of course, the end is nearby, but for me... journey just began.
    Maybe I'm asking basic lessons, but it's because I already searched and tried too much and could not find an answer.

    So, how to make a script to get some normal pieces of the same video and put inside it a speedup one? Let's say:
    1 - normal speed
    2 - normal speed
    3 - fast
    4 - normal speed
    And keep the corresponding audios?

    I'm trying something like this:
    Code:
    v1=DirectShowSource("D:\work\test1.mp4")
    
    v2=trim(v1, 120, 180)
    v3=trim(v1, 1860, 2160)
    v4=trim(v1, 3000, 4049)
    v5=trim(v1, 4050, 8460)
    
    a2=AudioTrim(v1, 120, 180)
    a3=AudioTrim(v1, 1860, 2160)
    
    v6=SelectEvery(v5, 5).AssumeFPS(v5)
    a=TimeStretch(v5, tempo=500)
    
    v=v2+v3+v4+v5+v6
    a=a2+a3+a4+a5+a6
    
    AudioDub(v,a)
    ConvertAudioTo16bit()
    AudioTrim is documented, but it always say "no function named AudioTrim". My Avisynth was alpha2, but I updated to alpha3 (september, 2011). The lack of the function remains.

    At page of Trim, it states:
    Prior to v2.60, to trim an audio-only clip, you may not just set a fake frame rate with AssumeFPS. Instead, you must make a BlankClip, use AudioDub, trim that, and then KillVideo. Otherwise, AviSynth makes an error message "cannot trim if there is no video".

    I'm not sure how to use Audiodub, if it can be used twice...
    And about concatenate audio like a1+a2...
    Confused...
    Scratching the head...

    Any help?
    Thank you.
    Quote Quote  
  5. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    There is no need to separate out the video and audio.
    Just do this:
    Code:
    v1=DirectShowSource("D:\work\test1.mp4")
    
    v2=trim(v1, 120, 180)
    v3=trim(v1, 1860, 2160)
    v4=trim(v1, 3000, 4049)
    v5=trim(v1, 4050, 8460)
    
    v6=SelectEvery(v5, 5).AssumeFPS(v5)
    v6=TimeStretch(v6, tempo=500).ConvertAudioTo16bit()
    
    return v2+v3+v4+v5+v6
    AudioTrim is not yet available in the released version, although it has been documented in the wiki.
    Last edited by Gavino; 26th Apr 2012 at 10:36. Reason: Info on AudioTrim
    Quote Quote  
  6. Originally Posted by Gavino View Post
    There is no need to separate out the video and audio.
    Just do this:
    No. There are some problems when reaches the fast segment. It plays at normal speed and the audio is also weird, may be slower than it would be. Make a test for yourself.
    Thank you.
    Quote Quote  
  7. Gavino's script works fine here (on a random AVI file). DirectShowSource() may be your problem. Was it your intent to repeat section 5? Once at normal speed, once at 5x?
    Last edited by jagabo; 26th Apr 2012 at 11:11.
    Quote Quote  
  8. Holy jagabo! Yes! My mistake again!
    Section 5 must stay out of v1+v2...

    return v2+v3+v4+v6

    Not v5!

    I confess I try, but programming is not my talent...
    Thank you.
    Quote Quote  
  9. Hey, folks, it's show time!
    A little bonus for those who had patience to go so far, a sample of our hard work.

    Some crazy dude will explain to us how it can be done.

    Some parts speedup, others not.

    Enjoy.

    Thank you.
    Quote Quote  



Similar Threads

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