Android Question Recording video with Camera2 hangs on specific hardware

biometrics

Active Member
Licensed User
Longtime User
I'm recording video using the Camera2 library and the CamEx2 class.

It works correctly on most hardware and cameras I've tested with but on a specific device (https://www.viatech.com/en/boards/3-5-inch-sbc/vab-630/) and camera (https://www.amazon.ca/KAYETON-62mmx9mm-Megapixel-support-Smartphone/dp/B01NARSOJR) when I call StopVideoRecording in CamEx2 the app hangs. The specific line of code is MediaRecorder.RunMethod("stop", Null). It enters the function and never returns. So unfortunately there is not stack trace to post. So preview and start recording works but stop recording hangs the app.

The standard camera app included with the OS (Android 5) and device records video correctly with that camera. Using other cameras (Logitec C310 and Logitech QuickCam PTZ) on that device with my app works correctly.

Any idea how I can solve this?
 

biometrics

Active Member
Licensed User
Longtime User
I guess that the support level for Camera2 of this device is LEGACY (you can see it in the logs). Such devices might have issues with Camera2. Worth trying lowering the resolution.
Indeed it is LEGACY.

Resolution is currently 640x480, 15 fps, 1 Mbps bit-rate. So quite low.

We tested this camera on another Android device and it works fine there.
 
Upvote 0
Top