Skip to main content

Posts

Showing posts from March, 2020

Overlaying the animated gif logo file on corner of mp4 video using FFmpeg command

  Sometimes, I inspire from some online videos that their logo continiously animated throughtout their length. Hence tried this work and FFmpeg command essentially takes two files as input - mp4 video file and an animated gif, apply various filters and then overlays the gif on the mp4, loops the gif infinitely and saves the final output as mp4 file (without audio). ffmpeg -i input.mp4 -stream_loop -1 -i animals.gif -filter_complex "[1]colorchannelmixer=aa=1,scale=iw*1:-1[a];[0][a]overlay=x='35':y='35':shortest=1" -c:v libx264 -an output2.mp4 Breaking it down -stream_loop -1 - This option tells ffmpeg to loop the gif file indefinitely. -filter_complex - this option is used to specify a complex filtergraph, a chain of filter in a single instance. This complex filtergraph is composed of two filters: a. [1]colorchannelmixer=aa=1 - This filter changes the color channel of the gif file. b. scale=iw*1:-1[a] - this filter changes the scale of the gif. [0][a]overlay=x=