[FFmpeg-user] How to improve result of transitions

Rob Hallam ffmpeg at roberthallam.com
Mon Jun 21 23:46:20 EEST 2021


On Mon, 21 Jun 2021 at 21:07, <iburman at compuscience.com> wrote:
>
> Attached is a result of a transition using two videos, one totally black and
> one totally white, using radial transition.
>
> Each video has 9 seconds and the transition command is:
>
> Ffmpeg -i black.mp4 -i white.mp4 -filter_complex
> "xfade=transition=radial:duration=4:offset=7"  -pix_fmt yuv420p
> trans_radial_4.mp4
>
> So based on the above I expect the transition to start at t=7 and end at
> t=11, and as it is a radial transition I expect the transition to move
> uniformly for 0 to 360 degree during these 4 seconds.
>
> If I look to the video, it seems to me that the transition worked fine for
> the first half (from t=7 to t = 9 while the circle goes from 0 to 180
> degree. But once this point is reached, it immediately gets white, like the
> second part of the transition is not happening.

I was able to reproduce your issue with lavfi color generators as inputs [1].

> Is something wrong with my command? What do I need to do to get the full
> transition working?

Your first input finishes before the transition is completed. Choose a
different offset (eg [2]) or duration (eg [3]).

Cheers,
Rob

---

[1] ffmpeg  -f lavfi -i color=black:640x480:d=9 -f lavfi -i
color=white:640x480:d=9 -c:v h264 -crf 20 -an -pix_fmt yuv420p
-filter_complex "xfade=transition=radial:duration=4:offset=7"
/tmp/wb4.mkv

[2] ffmpeg -f lavfi -i color=black:640x480:d=9 -f lavfi -i
color=white:640x480:d=9 -c:v h264 -crf 20 -an -pix_fmt yuv420p
-filter_complex "xfade=transition=radial:duration=4:offset=5"
/tmp/wb4.mkv

[3] ffmpeg -f lavfi -i color=black:640x480:d=9 -f lavfi -i
color=white:640x480:d=9 -c:v h264 -crf 20 -an -pix_fmt yuv420p
-filter_complex "xfade=transition=radial:duration=2:offset=7"
/tmp/wb4.mkv


More information about the ffmpeg-user mailing list