cduguet
cduguet

Reputation: 427

ffmpeg: sliding overlay for filter comparison

I am trying to get the effect demonstrated in this video: https://www.youtube.com/watch?v=xrMZSLb_gPs

Most of the sliding overlay solutions I've seen are for a sliding fixed image, but not for a progressive crop of each part of the video.

I've tried doing:

ffmpeg -i video1.mp4 -i video2.mp4 \
 -filter_complex "[0]crop='min(iw*(1+n)/100,iw)':ih:0:0[left];[1]crop='max((1-n/100)*iw,1)':ih:1-'max((1-n/100)*iw,1)':0[right];[left][right]hstack[out]" -map '[out]' -y out.mp4

But it still does not work. Is there a way?

Thank you!

Upvotes: 0

Views: 452

Answers (1)

llogan
llogan

Reputation: 133983

Use the xfade filter:

ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "xfade=transition=wiperight:duration=5:offset=1" output.mp4
  • transition chooses the style/effect.
  • duration is how long the transition lasts.
  • offset is number of seconds before transition begins.

Upvotes: 1

Related Questions