1

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?

0

Use

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 Apr 17 '16 at 10:57
  • It fades out? Never appears? – Gyan Apr 17 '16 at 11:04
  • It never appears. When i remove fade=in:0:30:alpha=1 it appears, but without fade of course – SebSob Apr 17 '16 at 11:12
  • Edited command. – Gyan Apr 17 '16 at 11:25
  • It now stays in an infinite loop saying: Incoming frame (time:24.8) from link #1 n:266.000000 t:8.856576 pos:161470.00000 x:10.000000 xi:10 y:145.000000 yi:144 *** dropping frame 268 from stream 0 at ts 266 Stream finished, looping. – SebSob Apr 17 '16 at 12:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.