Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am successfully adding an overlay with x264 and -vf with this command:


ffmpeg -i /private/youtube/$i -acodec aac -ac 2 -strict experimental -vf 'movie=/user_ftp/1037/watermarks/w640X360.png [logo];[in][logo] overlay=0:0 [out]' -crf 24 -ab 160k -s 640x360 -vcodec libx264 -preset faster -profile:v baseline -level 30 -maxrate 1500k -bufsize 2200k -b:v 1200k -f mp4 -threads 0 -y  /user_ftp/1037/$i.mp4

However, with my 2 pass webm encode and the same code, the video encodes, but no watermark is placed. Does -vf not work when encoding to webm?


Webm pass 1

ffmpeg -i /youtube/$mediaboxid/$i -codec:v libvpx -quality good -vf 'movie=/media/raid2/uploads/user_ftp/1037/watermarks/w400X224.png [logo];[in][logo] overlay=0:0 [out]' -filter:v scale=400:224 -cpu-used 0 -b:v 500k -qmin 10 -qmax 42 -maxrate:v 500k -bufsize:v 1000k -threads 0  -an -pass 1 -f webm -y /dev/null

Webm pass 2

ffmpeg -i /youtube/$mediaboxid/$i -codec:v libvpx -quality good -vf 'movie=/user_ftp/1037/watermarks/w640X360.png [logo];[in][logo] overlay=0:0 [out]' -filter:v scale=640x360 -cpu-used 0 -b:v 500k -qmin 10 -qmax 42 -maxrate:v 500k -bufsize:v 1000k -threads 0 -an -pass 2 -f webm -y /user_ftp/1037/$i.webm

Are there any known issues here with webm specifically?

share|improve this question

migrated from stackoverflow.com Mar 13 '13 at 6:38

This question came from our site for professional and enthusiast programmers.

Please include the complete console output for the not working command(s). Also, you are applying -filter (-vf and -filter:v) twice and ffmpeg may ignore one. –  LordNeckbeard Mar 12 '13 at 21:06
add comment

1 Answer

There should be no special issues with WebM encoding. As mentioned by LordNeckbeard, your WebM command lines have both a -vf option and a -filter:v option, but these are the same thing (two different ways to specify the set of filters to apply to the video). You can use multiple video filters, but specify them using a single -vf or -filter:v option.

You should use -filter_complex instead of -vf for filtering involving multiple inputs: this is the difference between a simple and complex filtergraph. It is also easier to make sense of because you can avoid the movie source filter.

If you wanted the scale filter to be applied to the result of the overlay:

ffmpeg -i video.mp4 -i logo.png -filter_complex overlay,scale=640:-1 ... output

If you wanted the scale to be applied only to the original input, and not the overlay then just switch the location of the filters:

ffmpeg -i video.mp4 -i logo.png -filter_complex scale=640:-1,overlay ... output
share|improve this answer
Problemo solved!! Thanks very much for your help. Did not realize that -vf and filter:v were the exact same thing. Thanks guys for taking the time to answer. –  Craig Lillard Mar 13 '13 at 4:00
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.