mediapipe_face_detection_aar_example icon indicating copy to clipboard operation
mediapipe_face_detection_aar_example copied to clipboard

unable to run this git with usb camera attached

Open stewie146 opened this issue 3 years ago • 2 comments

we have a usb camera attached to the dev board running this git, and it give us the following error:

Unable to get ProcessCameraProvider: java.util.concurrent.ExecutionException: androidx.camera.core.InitializationException: java.lang.NumberFormatException: For input string: "/dev/video10"

it seems this error is invoked because the camera is not build-in camera but usb/external camera.

any idea how to solve this problem ? appreciated !

stewie146 avatar May 06 '21 17:05 stewie146

You might need to use UVC Camera and hook up its surfaceTexture and surfaceView herewith mediapipe. Take a look at - https://github.com/saki4510t/UVCCamera or https://github.com/jiangdongguo/AndroidUSBCamera

j-void avatar May 21 '21 06:05 j-void

I was able to integrate all of the code from AndroidUSBCamera with the mediapipe pose detection repo. However, the display frames get stuck on the following code:

mCameraHelper?.setOnPreviewFrameListener(AbstractUVCCameraHandler.OnPreViewResultListener() { nv21Yuv ->

            previewFrameTexture = mUVCCameraView!!.surfaceTexture
        
        })

If I comment the previewFrameTexture assignment, the camera frames are displayed on the screen but I get egl_bad_surface-errors.

romilpunetha avatar Aug 04 '21 10:08 romilpunetha