I am trying to place a watermark.png image on a video with a fade-in effect. This is my command:

ffmpeg -i input_vid.mp4 -c:v libx264 -pix_fmt yuv420p -vf movie=watermark_3.png, scale=144:31 [watermark]; [in][watermark] overlay=5:H-h-15, fade=in:0:30:alpha=1[out] -s 180x320 -preset ultrafast -c:a copy out.mp4

But this makes the whole video fade in from black.. Any idea's?

1 Answer 1



ffmpeg -i input_vid.mp4 \
      -vf "movie=watermark_3.png:loop=0.1,setpts=N/FRAME_RATE/TB,scale=144:31,format=rgba,fade=in:0:30:alpha=1[watermark]; \
           [in][watermark]overlay=5:H-h-15:shortest=1,scale=180x320[out]" \
      -c:v libx264 -pix_fmt yuv420p -preset ultrafast -c:a copy out.mp4

The fade has to be applied in the watermark chain to affect it only. The loop flag is set to a number below one, so that it loops the single image indefinitely. setpts ensures monotonically increasing timestamps.

  • Thank you for the answer, but that makes the watermark disappear :/ any ideas?
    – SebSob
    Commented Apr 17, 2016 at 10:57
  • It fades out? Never appears?
    – Gyan
    Commented Apr 17, 2016 at 11:04
  • It never appears. When i remove fade=in:0:30:alpha=1 it appears, but without fade of course
    – SebSob
    Commented Apr 17, 2016 at 11:12
  • Edited command.
    – Gyan
    Commented Apr 17, 2016 at 11:25
  • 1
    Added shortest flag.
    – Gyan
    Commented Apr 17, 2016 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .