How to change the type of AudioSource when using VideoCapture

67 views
Skip to first unread message
Assigned to leoh...@google.com by wuj...@google.com

yihao wu

unread,
May 18, 2023, 10:10:47 PM5/18/23
to Android CameraX Discussion Group
Hello, I am using androidx.camera.core.VideoCapture now. I hope to change the audioSource in AudioRecord to MediaRecorder.AudioSource.DEFAULT to support external recording equipment. Is there any way to modify it? I think CAMCORDER is used in API.

yihao wu

unread,
May 19, 2023, 4:15:33 AM5/19/23
to Android CameraX Discussion Group, yihao wu

Who can tell me what to do?

Leo Huang

unread,
May 19, 2023, 10:31:12 AM5/19/23
to yihao wu, Android CameraX Discussion Group
Hi,
The core/VideoCapture hard code audio source so not able to be changed. (core/VideoCapture is not maintained anymore.)

For video/VideoCapture, although there is not yet a public API to set audio source, but currently one workaround can be used. See https://groups.google.com/a/android.com/g/camerax-developers/c/RSU5iJEme5M/m/Cchhq-hnAgAJ

yihao wu <wuy...@insta360.com> 於 2023年5月19日 週五 下午4:15寫道:

Who can tell me what to do?
在2023年5月19日星期五 UTC+8 10:10:47<yihao wu> 写道:
Hello, I am using androidx.camera.core.VideoCapture now. I hope to change the audioSource in AudioRecord to MediaRecorder.AudioSource.DEFAULT to support external recording equipment. Is there any way to modify it? I think CAMCORDER is used in API.

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/75767160-9b99-452f-9c0c-fd4547937a92n%40android.com.

yihao wu

unread,
May 19, 2023, 10:44:15 PM5/19/23
to Android CameraX Discussion Group, leoh...@google.com, Android CameraX Discussion Group, yihao wu
Hi,Can I copy core.VideoCapture to customize my own VideoCapture, and then bind it to bind?
I have tried the second way, and I upgraded to the latest version for this, just to solve the problem of mirroring after recording the video.
But there is a problem I can't accept after using the new VideoCapture, that is, we can use the 4K lens before, but we can't support the 4K lens after using the new VideoCapture. This is a very serious problem for us, so I'm not going to use the new API.

Leo Huang

unread,
May 21, 2023, 11:35:20 PM5/21/23
to yihao wu, Android CameraX Discussion Group


yihao wu <wuy...@insta360.com> 於 2023年5月20日 週六 上午10:44寫道:
Hi,Can I copy core.VideoCapture to customize my own VideoCapture, and then bind it to bind?

I actually don't expect this to work, as it's never been suggested nor done before as far as I know. I think there could be some compile errors that aren't able to be resolved?


I have tried the second way, and I upgraded to the latest version for this, just to solve the problem of mirroring after recording the video.
But there is a problem I can't accept after using the new VideoCapture, that is, we can use the 4K lens before, but we can't support the 4K lens after using the new VideoCapture. This is a very serious problem for us, so I'm not going to use the new API.

Sorry to hear about the resolution problem, we will prioritize this feature request https://issuetracker.google.com/263961771, to support 4K video as much as possible. We will also consider making the audio source settings as public API.

yihao wu

unread,
May 25, 2023, 6:49:28 AM5/25/23
to Android CameraX Discussion Group, leoh...@google.com, Android CameraX Discussion Group, yihao wu
thank you I would like to ask you another question. VideoCapture pre video of the old version is mirrored. Is there any way to modify it?

Leo Huang

unread,
May 25, 2023, 11:24:40 PM5/25/23
to yihao wu, Android CameraX Discussion Group
I don't quite sure about the question, does it mean Preview is mirrored on the front camera?

By default, Preview is not mirrored on the rear camera and is mirrored on the front camera.

This is inconsistent with VideoCapture by default, which is always not mirrored on both front and rear cameras.

If you just want to mirror Preview, you can use View.setScaleX(-1.0f) if you are using TextureView or PreviewView with COMPATIBLE mode.

If you want to mirror VideoCapture, not possible in core/VideoCapture. But VideoCapture.Builder.setMirrorMode(int) in video/VideoCapture.


yihao wu <wuy...@insta360.com> 於 2023年5月25日 週四 下午6:49寫道:
Reply all
Reply to author
Forward
0 new messages