how to combine/merge a video and a Gif using FFMPEG?

I want to merge a video and Gif. My video is a picture and a song during 45 seconds and my Gif is a equalizer animation.

I want to combine video and Gif , Gif opacity be 50%. Thanks a lot.

1

1 Answer

Example:

ffmpeg -i input.mp4 -i eq.gif -filter_complex "[1]format=rgba,colorchannelmixer=aa=0.5[front];[0][front]overlay=x=(W-w)/2:y=H-h,format=yuv420p" output.mp4

Uses these filters:

  • format - Selects a pixel format with alpha (transparency).
  • colorchannelmixer - Sets the alpha channel to 50%.
  • overlay - Places one video over another.
  • format (again) - Sets a compatible pixel format. May be redundant, depending on several factors including input format and encoder, but won't hurt to include it for MP4 output.
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like