简体   繁体   English

android,将图像放在视频帧上

[英]android, put image on video frames

Is there a way to put an image on each video frame? 有没有办法在每个视频帧上放置图像? I was thinking about it and I found one way, extract each frame to bitmap, merge 2 images (video frame and specified image) and save all frames as a video. 我正在考虑,发现了一种方法,将每个帧提取到位图,合并2个图像(视频帧和指定的图像),然后将所有帧另存为视频。 Is it the only way? 这是唯一的方法吗?

You can use ffmpeg library and run something like this: 您可以使用ffmpeg库并运行如下代码:

ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy output.mp4 ffmpeg -i input.mp4 -i logo.png -filter_complex“ overlay =(main_w-overlay_w)/ 2:(main_h-overlay_h)/ 2” -codec:副本output.mp4

https://github.com/WritingMinds/ffmpeg-android-java is a good way for adding ffmpeg to your android project. https://github.com/WritingMinds/ffmpeg-android-java是将ffmpeg添加到您的android项目的好方法。 Check this question for more info on the ffmpeg comand. 检查此问题以获取有关ffmpeg命令的更多信息。

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

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