1

I have bee experimenting with ffmpeg on video transitions , Now am stuck in this transition , I have no where to go ,

I have two videos like this,

enter image description here

at the end of first video i have to split the first video into two from center and reveal the second video like the following,

enter image description here any help would be appreciated

2
  • ffmpeg is processing, not composition tool. But you can many tricks with it.
    – bukkojot
    Sep 21, 2017 at 12:07
  • I think you'd need a custom filter to accomplish that. You might find this useful.
    – Elder Geek
    Sep 22, 2017 at 15:19

2 Answers 2

2

Some variant of:

ffmpeg -i FIRST -i SECOND -lavfi "blend=all_expr='if(lte((W/2-sqrt((X-W/2)*(X-W/2)))+N*SW,W/2),A,B)'" OUTPUT

2
  • 1
    Amazing! It not as described author, but very impressive
    – bukkojot
    Sep 23, 2017 at 3:11
  • Hey man, how to set custom time to complete this animation??? please inform me..., Thank you Jun 10, 2019 at 6:13
2

This needs a slightly elaborate filtergraph to do as described.

-filter_complex
    "[0]split[b1][b2];
     [b1]crop=iw/2:ih:0:0[b1];
     [b2]crop=iw/2:ih:iw/2:0[b2];
     [1][b1]overlay=x='0-(W/2)*(t-DUR0)/D':enable=gte(t,DUR0)[ob1];
     [ob1][b2]overlay=x='W/2+(W/2)*(t-DUR0)/D':enable=gte(t,DUR0)[fv]
    "

where 0 is video '1' and 1 is video '2'. DUR0 should be replaced with duration of video '1' and D with duration of the effect.


A curtain effect, like what Paul described, can be done like this:

blend=all_expr='if(lte((W/2-abs(X-SW*W/2))/(SW*W/2),(T-S)/D),B,A)'

where S is start time in seconds. (You may want/need to adjust the timestamps of the top video 'A' beforehand using setpts) and D is duration of effect. These two variables should be replaced with the required numeral values.

I can't test either of these for a few days.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.