[英]FFmpeg rotate and scale image overlay on video
I have been able to rotate image which overlays on video on android using this comand 我已经能够使用此命令旋转在Android视频上叠加的图像
String[] complexCommand2 = {"-y", "-i", videoFilePath, "-i", imagepath, "-filter_complex","[1:v] rotate=30*PI/180:c=none:ow=rotw(iw):oh=roth(ih) [rotate];[0:v][rotate] overlay=40:10", "-codec:a","copy", outputFilePath};
However I want to also scale the image how can that be done 但是我也想缩放图像怎么办
To scale after the rotate: (just replaced and with desired values. 旋转后缩放:(只需替换并更改为所需的值。
-filter_complex "[1:v] rotate=30*PI/180:c=none:ow=rotw(iw):oh=roth(ih) [rotate];[rotate]scale=<scale_width>:<scale_height>[scale];[0:v][scale] overlay=40:10[out]" -map [out] .......
to scale before the rotate: (just replaced and with desired values. 在旋转之前缩放:(只需替换并更改为所需的值。
-filter_complex "[1:v]scale=<scale_width>:<scale_height>[scale];[scale]rotate=30*PI/180:c=none:ow=rotw(iw):oh=roth(ih) [rotate];[0:v][rotate] overlay=40:10[out]" -map [out] .......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.