VideoHelp Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. hi, I need some help.

    situation: I have a series of Loops which I use in a script in order to edit an audio file.
    it works well but due to three of these Loops are too much long, they produce bad sound effects.
    my idea is, instead of duplicate the frames, I'd like to add blank frames with no audio, or better, to use a command like
    killaudio in order to cancel any audio at those frames.

    so please, can you help me to find the best and simple way in order to replace these following three bolded Loops into frames with no audio?

    Code:
    LoadPlugin("\Desktop\util\MeGUI-2913-64\tools\ffms\ffms2.dll")
    Video=FFVideoSource("C:\cutted - no aac.mkv", fpsnum=25, fpsden=1, threads=1)
    Audio=FFAudioSource("C:\cutted - no aac.mkv")
    
    AudioDub(Video,Audio)
    
    
    Loop(2,3797,3797).Loop(0,5536,5536).Loop(2,5536,5536).Loop(3,5754,5754).Loop(3,5757,5757).Loop(4,25509,25509).Loop(6,25513,25513).Loop(7,51483,51483).Loop(5,51490,51490).Loop(34,71471,71471).Loop(29,71505,71505)
    Loop(2,91621,91621).Loop(6,101038,101038).Loop(6,101044,101044).Loop(40,123744,123744).Loop(6,123784,123784).Loop(0,126031,126031)
    Last edited by maudit; 13th Apr 2022 at 10:36.
    Quote Quote  
  2. You can't killaudio(), because that removes the audio track . You can't splice a stream with audio and video tracks, to one with just a video track

    maybe add .amplify(0) to each, which will make it silent audio



    EDIT: I missed the part about blank frames

    I would organize it to reference which video/audio you're referring to


    Code:
    LoadPlugin("\Desktop\util\MeGUI-2913-64\tools\ffms\ffms2.dll")
    Video=FFVideoSource("C:\cutted - no aac.mkv", fpsnum=25, fpsden=1, threads=1)
    Audio=FFAudioSource("C:\cutted - no aac.mkv")
    
    AudioDub(Video,Audio)
    
    a=last
    
    b=blankclip(a)


    For each normal section use a.Loop(....)

    For each blankclip with blankaudio section use b.Loop(...)
    Last edited by poisondeathray; 13th Apr 2022 at 10:55.
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    You can't killaudio(), ...

    maybe add .amplify(0) to each

    ...

    For each normal section use a.Loop(....)

    For each blankclip with blankaudio section use b.Loop(...)

    @poisondeathray,
    thank you, I got the sense of your suggestions but I have difficult to understand their usage, their syntax,
    can you please make a couple of examples?


    I mean, for the command ".amplify(0)", you mean like this?

    Code:
    Loop(2,3797,3797)....Loop(34,71471,71471).amplify(0).Loop(29,71505,71505).amplify(0)...
    .Loop(6,101044,101044).Loop(40,123744,123744).amplify(0).Loop(6,123784,123784)..
    or maybe, idk, the amplify command goes inside the Loop parenthesis?




    and about that other way you mentioned, I'm not sure I have fully understood the usage of the "last" special variable.
    what's inside this variable?
    you mean like this?

    Code:
    A=last
    B=blankclip(A)
    
    A.Loop(2,3797,3797)....B.Loop(34,71471,71471).B.Loop(29,71505,71505)...
    A.Loop(6,101044,101044).B.Loop(40,123744,123744).A.Loop(6,123784,123784)..
    Last edited by maudit; 13th Apr 2022 at 16:42.
    Quote Quote  
  4. Ignore the amplify comment, because I misread that you wanted black frames over those frame range

    a="last" means everything written before is now assigned the variable a

    In the example below, b_loop=last is the same video, but with blank frames and blank audio. You could have used another variable name if you wanted to

    You can use remapframes to mix&match versions . You only have 3 frame ranges in this example, but it's a handy function to use, especially when you have multiple ranges

    Code:
    LoadPlugin("\Desktop\util\MeGUI-2913-64\tools\ffms\ffms2.dll")
    Video=FFVideoSource("C:\cutted - no aac.mkv", fpsnum=25, fpsden=1, threads=1)
    Audio=FFAudioSource("C:\cutted - no aac.mkv")
    
    AudioDub(Video,Audio)
    
    a=last
    
    b=blankclip(a)
    
    a
    Loop(2,3797,3797)
    Loop(0,5536,5536)
    Loop(2,5536,5536)
    Loop(3,5754,5754)
    Loop(3,5757,5757)
    Loop(4,25509,25509)
    Loop(6,25513,25513)
    Loop(7,51483,51483)
    Loop(5,51490,51490)
    Loop(34,71471,71471) #71471 to 71504
    Loop(29,71505,71505) #71505 to 71533
    Loop(2,91621,91621)
    Loop(6,101038,101038)
    Loop(6,101044,101044)
    Loop(40,123744,123744) #123744 to 123783
    Loop(6,123784,123784)
    Loop(0,126031,126031)
    a_loop=last
    
    b
    Loop(2,3797,3797)
    Loop(0,5536,5536)
    Loop(2,5536,5536)
    Loop(3,5754,5754)
    Loop(3,5757,5757)
    Loop(4,25509,25509)
    Loop(6,25513,25513)
    Loop(7,51483,51483)
    Loop(5,51490,51490)
    Loop(34,71471,71471) #71471 to 71504
    Loop(29,71505,71505) #71505 to 71533
    Loop(2,91621,91621)
    Loop(6,101038,101038)
    Loop(6,101044,101044)
    Loop(40,123744,123744) #123744 to 123783
    Loop(6,123784,123784)
    Loop(0,126031,126031)
    b_loop=last
    
    
    RemapFrames(a_loop, mappings="[71471 71504] [71471 71504]
    [71505 71533] [71505 71533]
    [123744 123783] [123744 123783]", sourceClip=b_loop)
    Quote Quote  
  5. sry, double post, do not consider.
    Quote Quote  
  6. ok, now is a bit more clear, the code above replaces those ranges with blank frames.
    it is a bit complicated and still pretty hard to understand:

    in particular I cant get the syntax of:
    Code:
    a
    Loop(..)
    Loop(..)
    ...
    a_loop=last
    you said
    a="last" means everything written before is now assigned the variable a
    so, a_loop=last means in a_loop now there is everything written before? or just from the "a"?
    it looks like a bit redundant and I can't fully get it yet.


    are you sure this is the simplest way to mute those ranges?
    I do not need those ranges are blank, I just need their audio is silenced.

    can't I just use ".amplify(0)" in some way?
    this code below or something similar, won't work?

    Code:
    Loop(2,3797,3797).Loop(0,5536,5536).Loop(2,5536,5536)......
    Loop(34,71471,71471).amplify(0).Loop(29,71505,71505).amplify(0)
    Loop(2,91621,91621).Loop(6,101038,101038).Loop(6,101044,101044)
    Loop(40,123744,123744).amplify(0)
    Loop(6,123784,123784).Loop(0,126031,126031)
    Last edited by maudit; 13th Apr 2022 at 19:36.
    Quote Quote  
  7. Originally Posted by maudit View Post
    ok, now is a bit more clear, the code above replaces those ranges with blank frames.

    are you sure this is the simplest way to mute those ranges?
    I do not need those ranges are blank, I just need their audio is silenced.
    can't I just use ".amplify(0)" in some way?

    Now I'm confused

    Yes, that replaces those ranges with black video frames, and silent audio

    Earlier-
    Originally Posted by maudit View Post
    instead of duplicate the frames, I'd like to add blank frames with no audio
    I understand the audio part.

    What about the video frames? Did you mean duplicate blank (black) frames replacing original frames, or duplicate original frames (the video, not the audio)?





    it is a bit complicated and still pretty hard to understand:

    in particular I cant get the syntax of:
    Code:
    a
    Loop(..)
    Loop(..)
    ...
    a_loop=last
    you said
    a="last" means everything written before is now assigned the variable a
    so, a_loop=last means in a_loop now there is everything written before? or just from the "a"?
    it looks like a bit redundant and I can't fully get it yet.
    It means from everything from a to a_loop=last

    Before you were using "implied last"

    AudioDub(Video,Audio)
    Loop(2,3797,3797).Loop(0,5536,5536)....

    Really means
    AudioDub(Video,Audio)
    Loop(last,2,3797,3797).Loop(last,0,5536,5536)....

    Where "implied last" refers to AudioDub(Video,Audio) . Because "last" is implied, it can be omitted.

    But consider the case where you were mixing/matching different versions. Which "last" are you using ? Which video or audio are you referring to ?


    For this:

    Code:
    a
    Loop(..)
    Loop(..)
    ...
    a_loop=last
    Loop(..) really means Loop(last, ....) ; Since "a" was called and preceded Loop() , "a" is implied "last"
    So that really means
    Loop(a, ...)
    Loop(a, ...)
    ...
    a_loop=last

    and a_loop is the new variable name for "a" with all the loops applied



    can't I just use ".amplify(0)" in some way?
    Not like that, because it will mute the entire audio, and it doesn't give you duplicate black video frames
    Last edited by poisondeathray; 13th Apr 2022 at 19:25.
    Quote Quote  
  8. Another way you do it is with trim

    Assuming black duplicate frames
    Code:
    
    AudioDub(Video,Audio)
    
    Loop(2,3797,3797)
    Loop(0,5536,5536)
    Loop(2,5536,5536)
    Loop(3,5754,5754)
    Loop(3,5757,5757)
    Loop(4,25509,25509)
    Loop(6,25513,25513)
    Loop(7,51483,51483)
    Loop(5,51490,51490)
    Loop(34,71471,71471) #71471 to 71504
    Loop(29,71505,71505) #71505 to 71533
    Loop(2,91621,91621)
    Loop(6,101038,101038)
    Loop(6,101044,101044)
    Loop(40,123744,123744) #123744 to 123783
    Loop(6,123784,123784)
    Loop(0,126031,126031)
    a=last
    
    b=blankclip(a)
    
    a.trim(0,71470) ++ b.trim(71471,71533) ++ a.trim(71534,123743) ++ b.trim(123744,123783) ++ a.trim(123784,0)

    If you didn't want black duplicate frames, but you wanted duplicate original frames, just silent audio over those sections

    Code:
    AudioDub(Video,Audio)
    
    Loop(2,3797,3797)
    Loop(0,5536,5536)
    Loop(2,5536,5536)
    Loop(3,5754,5754)
    Loop(3,5757,5757)
    Loop(4,25509,25509)
    Loop(6,25513,25513)
    Loop(7,51483,51483)
    Loop(5,51490,51490)
    Loop(34,71471,71471) #71471 to 71504
    Loop(29,71505,71505) #71505 to 71533
    Loop(2,91621,91621)
    Loop(6,101038,101038)
    Loop(6,101044,101044)
    Loop(40,123744,123744) #123744 to 123783
    Loop(6,123784,123784)
    Loop(0,126031,126031)
    a=last
    
    b=a.amplify(0)
    
    a.trim(0,71470) ++ b.trim(71471,71533) ++ a.trim(71534,123743) ++ b.trim(123744,123783) ++ a.trim(123784,0)


    And for that other version, b_loop could have been simplified instead of repeating all those loop statements

    Code:
    b_loop = blankclip(a_loop)
    Last edited by poisondeathray; 13th Apr 2022 at 19:43.
    Quote Quote  
  9. yes, maybe I was not so clear, I mentioned blankclip cause it came to my mind and I thought it was useful for my purpose.
    but if it is such complicated I prefer to use another method.

    the purpose of the script, is that given that series of loops, it has to mute three of them.
    I'm only interested in the audio track, doesn't matter about the video.
    I didn't thought it was so complicated as well, but I'm gonna try your last code.



    edit: anyway about the last line:
    a.trim(0,71470) ++ b.trim(71471,71533) ++ etc

    can be written this way too?
    trim(a,0,71470) ++ trim(b,71471,71533) ++ etc
    Last edited by maudit; 13th Apr 2022 at 20:58.
    Quote Quote  
  10. Originally Posted by maudit View Post

    edit: anyway about the last line:
    a.trim(0,71470) ++ b.trim(71471,71533) ++ etc

    can be written this way too?
    trim(a,0,71470) ++ trim(b,71471,71533) ++ etc
    Yes
    Quote Quote  
  11. thank you poison, sry for the delay, I tried your method and it works.
    at the end I will not use it, cause those silenced parts are not so good to ear.
    So I will try to loop the video in some other way.. I'm still working on it, is not so simple as it seems...

    Anyway.. thank you very much for having explained those scripts examples, they can be very useful for future works.
    Thanks a lot.
    Quote Quote  



Similar Threads

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