简体   繁体   English

android 工作室的 ffmpeg 中的视频叠加图像

[英]Overlay image on video in ffmpeg for android studio

When i add image on video but my image cut off right side in ffmpeg android studio so how to give image width?当我在视频上添加图像但我的图像在 ffmpeg android 工作室中的右侧被切断时,那么如何提供图像宽度?

[1]: https://i.stack.imgur.com/Y21Si.jpg [1]: https://i.stack.imgur.com/Y21Si.jpg

below is my command:以下是我的命令:

  1. String command = "-i '" + uri.toString() + "'" + " -i '" + layer.getAbsolutePath() + "'" + " -filter_complex "[0:v][1:v]overlay="+getX+":"+getY+"[outVideo],[0:a]volume=1:[audio0]" -map [outVideo] -map [audio0]" + " '" + mDestinationPath + "'";字符串命令 = "-i '" + uri.toString() + "'" + " -i '" + layer.getAbsolutePath() + "'" + " -filter_complex "[0:v][1:v]overlay ="+getX+":"+getY+"[outVideo],[0:a]volume=1:[audio0]" -map [outVideo] -map [audio0]" + " '" + mDestinationPath + "'";

[1]You can getx = 0 so image not cut right side. [1]您可以获取 x = 0,因此图像不会向右切割。

getX = 0;

String command = "-i '" + uri.toString() + "'" + " -i '" + layer.getAbsolutePath() + "'" + " -filter_complex "[0:v][1:v]overlay="+getX+":"+getY+"[outVideo],[0:a]volume=1:[audio0]" -map [outVideo] -map [audio0]" + " '" + mDestinationPath + "'";字符串命令 = "-i '" + uri.toString() + "'" + " -i '" + layer.getAbsolutePath() + "'" + " -filter_complex "[0:v][1:v]overlay ="+getX+":"+getY+"[outVideo],[0:a]volume=1:[audio0]" -map [outVideo] -map [audio0]" + " '" + mDestinationPath + "'";

[1]: https://i.stack.imgur.com/EIBHn.jpg [1]: https://i.stack.imgur.com/EIBHn.jpg

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

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