Reputation: 21
thanks to many posts on stack overflow I could come till here: How to add watermark in a gif with ffmpeg? which i can convert mp4 into animated gif with moderate quality and watermark on. But I'd like to add the drawtext too in these lines.
ffmpeg -i in.mp4 -i watermark.png -filter_complex "[0]fps=10,scale=320:-1:flags=lanczos[bg];[bg][1]overlay=W-w-5:H-h-5,palettegen" palette.png
ffmpeg -i in.mp4 -i watermark.png -i palette.png -filter_complex "[0]fps=10,scale=320:-1:flags=lanczos[bg];[bg][1]overlay=W-w-5:H-h-5[x];[x][2]paletteuse=dither=bayer:bayer_scale=3" output.gif
Would it be possible through filter_complex by adding another [ ]? Thanks a lot to everyone
Upvotes: 1
Views: 2250
Reputation: 133833
You can add drawtext after overlay.
ffmpeg -i input.mp4 -i watermark.png -filter_complex "[0]fps=10,scale=320:-1[bg];[bg][1]overlay=main_w-overlay_w-10:main_h-overlay_h-10:format=auto,drawtext=text='your text here':fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif
This will add text centered in video and overlay will be placed in the lower right.
Upvotes: 2