ncs
ncs

Reputation: 454

ffmpeg watermark first 30 second

ffmpeg -i v.3gp -acodec copy -vf "movie=w.png [logo]; [in][logo] overlay=10:main_h-overlay_h-10 [out]" nv.3gp

It work's fine, but i want watermark only first 30 seconds. Any ideas?

Upvotes: 8

Views: 14848

Answers (4)

cueloop
cueloop

Reputation: 141

Realize it's late, but as I was looking at a similar problem I managed to solve this one. It fades in with 0.5 sec from start, then fades out at 30 sec

ffmpeg \
-i v.3gp \
-loop 1 -i w.png \
-acodec copy \
-filter_complex \
"[1:v] fade=in:st=0:d=0.5,fade=out:st=30:d=0.5 [logo]; [0:v][logo] overlay=10:main_h-overlay_h-10" \
nv.3gp

Upvotes: 5

sendmoreinfo
sendmoreinfo

Reputation: 592

overlay filter supports timeline editing; you can simply read from a png file and then overlay=enable='lte(t,30)':...

Upvotes: 7

Dmitry Shkuropatsky
Dmitry Shkuropatsky

Reputation: 3965

You can convert the logo into a 30 second video with png codec and alpha channel, and apply the video as overlay.

The duration of the logo video should be specified through the number of frames at the frame rate of the main video (in your case, v.3pg). For example, for 30 fps main video run:

ffmpeg.exe -loop 1 -i w.png -vframes 901 -vf "fade=out:899:1:alpha=1" 
    -vcodec png -pix_fmt rgba w.mov

The logo needs to be faded out; otherwise it will not disappear. Then use the logo video as overlay on another video:

ffmpeg -i v.3gp -acodec copy -vf "movie=w.mov [logo]; [in][logo]
    overlay=10:main_h-overlay_h-10 [out]" nv.3gp

Alternatively, rather then ending abruptly, the logo can be faded out gradually, e.g. within 30 frames using -vf "fade=out:870:30:alpha=1".

Upvotes: 8

Felix Yan
Felix Yan

Reputation: 15269

You may cut the first 30 seconds, apply watermark to it, then join it with the remaining part.

Upvotes: 0

Related Questions