jiuqiant / mediapipe_face_detection_aar_example

MediaPipe face detection gpu demo with MediaPipe's Android archive library
73 stars 25 forks source link

unable to run this git with usb camera attached #9

Open stewie146 opened 3 years ago

stewie146 commented 3 years ago

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 !

j-void commented 3 years ago

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

romilpunetha commented 3 years ago

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.