1

Building off the solution provided in this thread, I'd like to know how to make simple modifications to a complex command argument which uses ffmpeg to interweave two videos by dissolving them into each other every 2 seconds, with a 0.5 second transition. It looks like this:

ffmpeg -i input1.mkv -i input2.mkv -filter_complex \
       "[0][1]blend=all_expr='if(mod(trunc(T/2),2),min(1,2*(T-2*trunc(T/2))),max(0,1-2*(T-2*trunc(T/2))))*A+if(mod(trunc(T/2),2),max(0,1-2*(T-2*trunc(T/2))),min(1,2*(T-2*trunc(T/2))))*B';\
        [0]volume='if(mod(trunc(t/2),2),min(1,2*(t-2*trunc(t/2))),max(0,1-2*(t-2*trunc(t/2))))':eval=frame[a]; [1]volume='if(mod(trunc(t/2),2),max(0,1-2*(t-2*trunc(t/2))),min(1,2*(t-2*trunc(t/2))))':eval=frame[b];\
        [a][b]amix" output.mkv

It works beautifully for its intended purpose, however this is some serious command line magic and I can't understand how to change the cut up duration or transition duration.

Suppose I want a 3 sec cut up w/ a 1 sec transition, or a 1 sec cut-up w/ a 0.25 sec transition, what parts of this command would I alter to achieve that? What specific variables do I change?

  • As a first step it would probably help to format the filter_complex argument into multiple lines so it's more readable. – Panki Feb 28 at 13:27
  • 1
    I'll add a generic version to my earlier answer soon-ish. – Gyan Mar 1 at 19:32
  • @gyan Could you define "soon-ish"? I believe you might be the only one able to answer this question. No rush or anything, I do appreciate your help on this. – Lichtung Mar 6 at 23:24
  • By weekend, I hope. – Gyan Mar 7 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.