简体   繁体   English

ffmpeg 转置源和缩放水印以适应不同的视频大小

[英]ffmpeg transpose source and scale watermark to fit on different video sizes

I'm using already using the line below to transpose the source, but I'm facing a problem of the watermark being out of proportion when the video resolution is different我已经使用下面的行来转置源,但是当视频分辨率不同时,我面临水印不成比例的问题

How can I make watermark fit on different video sizes?如何使水印适合不同的视频尺寸?

ffmpeg -i input  -i watermark.png -filter_complex "transpose=1,overlay=-40:300"  -vb 370k -minrate 300k -maxrate 350k -bufsize 350k -aspect "720:1280" -s "360x640" -c:v libx264 -profile:v "Main" -level "3.1" -r 25 -g 25 -keyint_min 50 -x264opts "keyint=50:min-keyint=50:no-scenecut" -c:a aac -strict experimental -b:a 32000 -ar 32000 -ac 1 output

The scale2ref filter is meant for this use case. scale2ref过滤器适用于此用例。

-filter_complex "[0]transpose=1[v];[1][v]scale2ref=oh*mdar:ih/8[w][v];[v][w]overlay=X:Y"

The watermark's height will be resized to 1/8th the height of the video.水印的高度将调整为视频高度的 1/8。 The width will be proportionally resized.宽度将按比例调整大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM