I’ve got several videos to which I’d like to add ‘outro’ animations to, using FFMPEG.

The outro animation itself is a sequence of 41 frames of alpha PNG images named consecutively, from Outro.00000.pngOutro.00040.png. I’d like this sequence to overlay the end of the video, using a multiply blending mode.

To give an idea this is one of the frames with alpha transparency

Image from PNG sequence

To ensure the animation doesn't cut off any of the actual video content my idea was to extend the final frame of the video by 30 seconds first—then the outro would start at the beginning of this 30 second extension.

The other 28 seconds would be filled keeping the final solid black last PNG image, so it would just be a black screen.

To give an example, if my video was exactly 5m long.

I’d like to extend the final frame of this video by 30 seconds, so the final video length would be 5m30s

At exactly the 5m mark I’d like the outro sequence of PNG files to overlay the next 41 frames, ending with the solid black PNG image, which would then continue to the end of the video.

So far I’ve only found a way to extend the length of the video using

ffmpeg -i test-video.mp4 -vf tpad=stop_mode=clone:stop_duration=30 test-video-longer.mp4

And a way to overlay the image sequence on top of the video at the right scale to match the video—but the multiply blending effect makes the result green, instead of the treatment it should, this is the filter

ffmpeg -i test-video.mp4 -i  outro-frames/Outro.%05d.png -filter_complex "[1:v][0:v]scale2ref=iw:-2[scaled][ref];[ref][scaled]blend=all_mode=multiply[m];[0][m]overlay=x=0:y=0" test-video-outro.mp4

And this is the resulting video

Green image after filter

I’m struggling with the next part and not very familiar with ffmpeg coding—so any advice would be really appreciated.

My final, final point :) is I would also like to include a short audio file at the same point the PNG sequence starts to match the animation—but that would really be the cherry on the cake.

Thanks in advance for any help!

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.