VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. I'm having a problem where frames are being cut off, and placed out of order. I can't seem to figure just what the mistake might be in the code:


    AudioDub(FFAudioSource("Clip1.mp4"),FFVideoSource( "Clip1.mp4",fpsnum=30000, fpsden=1001,threads=1)).Trim(4533,4788)Amplify(0)+ AudioDub(FFAudioSource("Clip2.mp4"),FFVideoSource( Clip2.mp4",fpsnum=30000, fpsden=1001,threads=1)).Trim(150, 5596)+Trim(6024, 6238)+Trim(6684, 6886)

    The problem seems to be that Clip 2 leaves out the last two trims entirely, and bumps the last two frames of Clip1 to the very end.
    Quote Quote  
  2. Originally Posted by smike View Post
    I'm having a problem where frames are being cut off, and placed out of order. I can't seem to figure just what the mistake might be in the code:


    AudioDub(FFAudioSource("Clip1.mp4"),FFVideoSource( "Clip1.mp4",fpsnum=30000, fpsden=1001,threads=1)).Trim(4533,4788)Amplify(0)+ AudioDub(FFAudioSource("Clip2.mp4"),FFVideoSource( Clip2.mp4",fpsnum=30000, fpsden=1001,threads=1)).Trim(150, 5596)+Trim(6024, 6238)+Trim(6684, 6886)

    The problem seems to be that Clip 2 leaves out the last two trims entirely, and bumps the last two frames of Clip1 to the very end.
    Probably an issue with "implied last" . The last few trims don't specify which clip you are referring to, so it references the last one (the one that is already trimmed previously)

    If you explicitly tell which clip reference to apply trim to, you should avoid those problems

    Also you should use "aligned splice" when joining clips with audio ("++")

    Code:
    clip1=AudioDub(FFAudioSource("Clip1.mp4"),FFVideoSource("Clip1.mp4",fpsnum=30000, fpsden=1001,threads=1))
    clip2=AudioDub(FFAudioSource("Clip2.mp4"),FFVideoSource("Clip2.mp4",fpsnum=30000, fpsden=1001,threads=1))
    
    clip1.Trim(4533,4788).Amplify(0) ++ clip2.Trim(150, 5596) ++ clip2.Trim(6024, 6238) ++ clip2.Trim(6684, 6886)
    Quote Quote  
  3. Ah okay, that worked perfectly. I'll have to remember to put "Clip" before Audiodub from now on. Thank you very much.
    Quote Quote  
  4. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    And Thank You from me also poisondeathray for the same problem I had been having with a GUI I have been working on that occasionally did the same thing. Big Thank You!
    Quote Quote  
  5. Just a little tip or two.... you can make it a bit more readable and easier to modify when the trim count is high like this:

    Code:
    clip1=AudioDub(FFAudioSource("Clip1.mp4"),FFVideoSource("Clip1.mp4", fpsnum=30000, fpsden=1001, threads=1))
    clip2=AudioDub(FFAudioSource("Clip2.mp4"),FFVideoSource("Clip2.mp4", fpsnum=30000, fpsden=1001, threads=1))
    
    clip1.Trim(4533,4788).Amplify(0)\
    ++ clip2.Trim(150, 5596)\
    ++ clip2.Trim(6024, 6238)\
    ++ clip2.Trim(6684, 6886)
    That way if each trim is followed by different filtering it's easy to see what's going on.

    For the record, ffmpegsource2 combines video and audio from the same source and the function is built into ffms2.dll these days. You do have to specifically enable the audio with "atrack", but I thought I'd mention it as I find the simpler I can make a script, the less confused and bewildered I become.

    Code:
    clip1=ffmpegsource2("Clip1.mp4", fpsnum=30000, fpsden=1001, threads=1, atrack=-1)
    clip2=ffmpegsource2("Clip2.mp4", fpsnum=30000, fpsden=1001, threads=1, atrack=-1)
    
    clip1.Trim(4533,4788).Amplify(0)\
    ++ clip2.Trim(150, 5596)\
    ++ clip2.Trim(6024, 6238)\
    ++ clip2.Trim(6684, 6886)
    Quote Quote  
  6. Originally Posted by hello_hello View Post

    For the record, ffmpegsource2 combines video and audio from the same source and the function is built into ffms2.dll these days.
    It's actually the helper function in the .avsi, not the .dll . Some people don't use the .avsi and have to call FFAudioSource, FFVideoSource explicitly

    EDIT: You're right, they changed it in v 2.22, the function is merged into the .dll


    Another option if many trim calls are being made, or different filtered versions of videos are being combined in different sections is to use RemapFrames, RemapFramesSimple, or clipclop
    Last edited by poisondeathray; 9th Aug 2016 at 09:32.
    Quote Quote  



Similar Threads

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