[FFmpeg-devel] vhook, watermark and padding

Luke Scott luke
Sun May 13 03:27:15 CEST 2007

When using ffmpeg to convert video's to flv I resize the video to  
480x360, but instead of stretching it I keep the aspect ratio the  
same. If there is any extra space I add padding where it's needed.  
For example if the video got resized to 480x340 I would add "-padtop  
10 -padbottom 10".

I have a watermark image that is 480x360. Most of the image is blank  
accept for the logo in the bottom right hand corner. The problem is  
vhook is placing the watermark within the 480x340 area so not only is  
stretching the watermark, but it doesn't overlap over the video and  

The only way I've been able to fix this is by encoding the video once  
with the padding, and then running it through a second time with just  
the watermark. This works, but I would much rather have it happen all  
at once. Not only does it take twice as long, even more quality is lost.

I suspect I could change watermark.c to take into account the padding  
as part of the total width. But I'm not even sure if vhook looks at  
the video after the padding has been added or not. Then again, I  
don't know very much C/C++....

Anyone know how I may be able to do this in one shot?


More information about the ffmpeg-devel mailing list