如何将任何 Android MLKIT 检测记录到视频中?

发布于 2025-01-13 12:08:48 字数 475 浏览 2 评论 0原文

我正在构建使用cameraX在用户身体上显示实时滤镜的应用程序,但我不知道什么是录制/捕获带有叠加层的视频的最佳方式。我尝试过屏幕捕获,但它不起作用,我尝试了多种其他方法,但尚未成功

对于代码参考,我正在使用此示例代码 - https://github.com/android/camera-samples/tree/main/CameraXAdvanced

例如,我想做一个记录类似这样的内容,并在屏幕上显示所有叠加层/细节在此处输入图像描述

I'm building app that uses cameraX to display real-time filter on users body, but I am not aware of what would be best way to record/capture video with overlays on it. I've tried screencapturing, but it does not work, I've tried multiple other methods, but no success yet

For code reference, I'm using this sample code - https://github.com/android/camera-samples/tree/main/CameraXAdvanced

For example, I'd like to make a recording of something like this with all overlays/details on the screenenter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゞ记忆︶ㄣ 2025-01-20 12:08:48

我经过大量研究和测试后编写了这个应用程序
带有车牌和面部模糊的行车记录仪
该逻辑是一项为 mlkit 实时获取相机并为叠加层创建位图的服务。
叠加层无法实时应用于视频来保存它,因此我通过 MediaRecorder 中的 createVirtualDisplay 将叠加层实时叠加到屏幕中的视频上。
这真是一团糟,但它确实有效。
注意:服务的逻辑可以直接移至 MainActivity 中,但我已经将其放在 Jarvis 应用程序中(私有),所以我保留了它。

I wrote this app after a lot of study and testing
Dashcam with license plate and face blurring
The logic is a service that takes the camera in real-time for mlkit and creates bitmaps for the overlay.
The overlay cannot be applied to the video in real-time to save it so I superimpose the overlay to the video in real-time in the screen that the video of this via createVirtualDisplay in the MediaRecorder.
It's a real mess but it works.
NB: the logic of the service could be moved directly into the MainActivity but I already had it in the Jarvis app (private) so I kept that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文