简体   繁体   中英

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?

[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 + "'";

[1]You can getx = 0 so image not cut right side.

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 + "'";

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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