本文介绍了在camerax中捕获没有音频的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用camerax api在应用内相机中捕获没有音频的视频

I want to capture video without audio in in-app camera using camerax api

我使用的是 beta10 的 camerax api

I am using camerax api of beta10

我尝试过设置音频缓冲区大小和音频源等.

I have tried by setting audio buffer size and audio sources etc.

推荐答案

目前还不支持这个答案,但是当使用camerax库的视频录制完全发布时就可以了.

At the time of this answer is not supported yet, but it will be possible when video recording using the camerax library is fully released.

最好的方法是等待官方支持版本发布,因为您发现的任何解决方法都只是可能在不同设备上工作或不工作的黑客,最终会过时.

The best approach is to wait for the official support release, as any workaround you find would be just hacks that may or not work in different devices, and that eventually will become obsolete.

查看谷歌最近的回答:

https://groups.google.com/a/android.com/g/camerax-developers/c/fsY3j4x_lA0/m/921lFEqyAgAJ

作为临时替代方案,同时 CameraX API 不完全支持视频,您可以直接使用 camera2 API 对其进行编码.正如您在官方示例中所见,实际上非常简单且不需要太多编码.

As a temporary alternative, meanwhile video isn't fully supported by the CameraX API, you could code it by directly using the camera2 API. As you can see in the official sample, is actually quite simple and doesn't require too much coding.

如果您担心 CameraX 和 Camera2 API 之间的区别,请注意 CameraX 是 Camera2 API 的包装器,因此无需担心.

If you are concerned about the difference between the CameraX and Camera2 APIs, note that CameraX is a wrapper around the Camera2 API, so no need to worry.

这篇关于在camerax中捕获没有音频的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 22:39