How to get the supported video resolution

34 views
Skip to first unread message

yihao wu

unread,
Apr 10, 2023, 7:19:03 AM4/10/23
to Android CameraX Discussion Group
When using androidx.camera.video.VideoCapture, how can you know which video resolutions the camera supports before turning on the camera?

Leo Huang

unread,
Apr 10, 2023, 11:33:37 AM4/10/23
to yihao wu, Android CameraX Discussion Group
You can query if a quality is supported on the device by QualitySelector.isQualitySupported(CameraInfo, Quality) and use QualitySelector.getResolution(CameraInfo, Quality) to get the resolution.

However, the resolution is still constrained by use case combination. In general if you only bind Preview + VideoCapture, the resolution can be adopted. If you bind one more UseCase, it will find a feasible Quality from the specified Quality list or it could fail to bind to lifecycle if all specified Qualities are not feasible.

yihao wu <wuy...@insta360.com> 於 2023年4月10日 週一 下午7:19寫道:
When using androidx.camera.video.VideoCapture, how can you know which video resolutions the camera supports before turning on the camera?

--
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/d022cf98-4726-4c38-9795-5eccd4733f4en%40android.com.

yihao wu

unread,
Apr 10, 2023, 9:58:48 PM4/10/23
to Android CameraX Discussion Group, leoh...@google.com, Android CameraX Discussion Group, yihao wu
But I want to know the supported resolution before turning on the camera, that is, without camraInfo, can this be done?
Just like the old VideoCapture.

Leo Huang

unread,
Apr 11, 2023, 9:25:32 PM4/11/23
to yihao wu, Android CameraX Discussion Group
Reply all
Reply to author
Forward
0 new messages