Watermarking video from the Linux command line

不羁的心 提交于 2019-12-09 05:59:53

问题


does anyone know how to watermark video from the Linux command line using a simple tool?

Watermarking in ffmpeg isn't supported in the current version, and requires a custom compile.

Max.


回答1:


ffmpeg -y -i 'inputFile.mpg' -vhook '/usr/lib/vhook/watermark.so -f /home/user/logo.gif'

Make note of the "-vhook" parameter; watermark.so path may vary.




回答2:


Another simple way to do this is updating ffmpeg to the newest version and adding the overlay video filter:

ffmpeg -y -i video.mp4 -i watermark.png -filter_complex "overlay=(main_w-overlay_w):(main_h-overlay_h)" watermark.mp4

This also gives you more options on where to place the watermark as well. For example, if you wanted to place the watermark in the center of the video you would use:

-filter_complex "overlay=(main_w-overlay_w/2):(main_h-overlay_h/2)"


来源:https://stackoverflow.com/questions/4033401/watermarking-video-from-the-linux-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!