[in][watermark] overlay=main_w/2-overlay_w/2:main_h/2-overlay_h/2 [out], scale=480:-1"
..has [out]
in the wrong place, which renders the filtergraph meaningless. It should be:
[in][watermark] overlay=main_w/2-overlay_w/2:main_h/2-overlay_h/2, scale=480:-1[out]"
Personally I dislike the movie filter, for purely aesthetic reasons (I think it makes the command-line look less clear). I would do this using filter_complex instead:
ffmpeg -i Wildlife.wmv -i /tmp/icon.png \
-filter_complex '[0:v][1]overlay=W/2-w/2:H/2-h/2,scale=480:-1[outv]' \
-map [outv] -map 0:a -c:a libvorbis -b:a 128k -c:v libvpx -b:v 384k output.webm
Note that filter_complex is incompatible with [in]
, since by its nature it takes multiple inputs.
I've removed -ar 44100
and -r 25
, since you probably don't need them - if your input source has a frame rate of 25fps and an audio rate of 44100, the output will inherit those settings by default. And if it doesn't, you probably won't gain anything by changing them.
To scale the video first, and then add a watermark, you could use something like this:
-vf 'movie=/tmp/icon.png[wm];[in]scale=480:-1[int];[int][wm]overlay=W/2-w/2:H/2-h/2[out]'
I'm not actually sure if that would work; personally, I'd use filter_complex, as above:
ffmpeg -i Wildlife.wmv -i /tmp/icon.png \
-filter_complex '[0:v]scale=480:-1[int];[int][1]overlay=W/2-w/2:H/2-h/2[outv]' \
-map [outv] -map 0:a -c:a libvorbis -b:a 128k -c:v libvpx -b:v 384k output.webm
if i wanna first scale and then add water mark what must i do?
[in][watermark] scale=480:-1,overlay=main_w/2-overlay_w/2:main_h/2-overlay_h/2[out]
did not work. – sweb – 2013-02-05T19:16:42.840can you aid me to solve it ? – sweb – 2013-02-05T19:24:04.590
1@sweb I've appended instructions on how to do that onto the answer – evilsoup – 2013-02-05T19:44:15.073
ty again for great aid man. – sweb – 2013-02-05T19:50:11.577