Page 1 of 1

Unable to use USB camera as reverse camera

Posted: Sun Oct 05, 2025 12:40 pm
by Caiimen
Hello everyone,

I’m having trouble using my USB camera as a reverse camera in Hudiy. I configured the pipeline in the config.json file as described in the documentation:

"reverseCamera": {
"width": 640,
"height": 480,
"x": 0,
"y": 0,
"pipeline": "v4l2src device=/dev/video0 ! image/jpeg,width=640,height=480,framerate=30/1 ! jpegdec ! videoconvert ! video/x-raw,format=RGBA ! glupload ! qml6glsink name=video-sink"
}


When I launch Hudiy, the camera does not display automatically.

I verified that the camera works with gst-launch-1.0, and the feed displays correctly.

I tried different formats (MJPG, YUY2), but nothing works.

The camera does not appear even after enabling “Reverse Mode” via the available actions.

Has anyone successfully used a USB camera as a reverse camera in Hudiy?
I would like to understand how to launch it automatically and have the feed visible in the application.

Thanks in advance for your help!

If you want, I can also make a shorter, more concise version that’s better suited for a technical forum. Do you want me to do that?

Re: Unable to use USB camera as reverse camera

Posted: Sun Oct 05, 2025 2:13 pm
by hudiy
The best way is to start with the simplest pipeline. Does the below one work for you?

Code: Select all

v4l2src device=/dev/video0 ! videoconvert ! glupload ! qml6glsink name=video-sink
For displaying the rear-view camera image, you can either use the built-in surface or create your own control in HTML/JavaScript.

You can show or hide the rear camera feed on the built-in surface using the API. On our GitHub, there’s an example that demonstrates how to control the rear-view camera and the built-in surface. You can extend that example to react to the state of a specific GPIO pin and show or hide the camera view accordingly.

If you choose the HTML/JavaScript control, you can display it e. g. as an overlay and also manage its visibility using Python and the state of a specific GPIO pin.

https://github.com/wiboma/hudiy/blob/ma ... eCamera.py
https://github.com/wiboma/hudiy/blob/ma ... ibility.py
https://github.com/wiboma/hudiy/blob/ma ... amera.html

Re: Unable to use USB camera as reverse camera

Posted: Sun Oct 05, 2025 2:46 pm
by Caiimen
When I run the following command in the terminal:

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! glimagesink


The video feed works perfectly — the camera is detected and the image displays correctly.

However, when I use the same GStreamer pipeline in the reverseCamera config in Hudiy:

"reverseCamera": {
"pipeline": "v4l2src device=/dev/video0 ! videoconvert ! glupload ! qml6glsink name=video-sink"
}


The camera does not display in the Hudiy interface.

Re: Unable to use USB camera as reverse camera

Posted: Sun Oct 05, 2025 4:05 pm
by hudiy
Do you mean that you don't see any image from the camera (for example just a black screen)? How are you trying to display the built-in surface that shows the camera feed?

Re: Unable to use USB camera as reverse camera

Posted: Sun Oct 05, 2025 4:08 pm
by Caiimen
I’m trying to display the rear camera feed using an HTML page with JavaScript (getUserMedia()), but I can't get it to work inside Hudiy. I set up a local HTTP server and I’m loading the HTML page through the WebView, but no image appears.

The same HTML file works fine in a normal browser on the Raspberry Pi, so I think the issue is how Hudiy handles the WebView or permissions for camera access.

Any idea how to make this approach work?

Re: Unable to use USB camera as reverse camera

Posted: Sun Oct 05, 2025 4:34 pm
by hudiy
When using HTML, you don’t need to modify the reverseCamera section in main_configuration.json - that part is only for the built-in surface. By default, Hudiy asks for permission to access the camera (they are granted by default). Under the hood, WebView is just an instance of Chromium engine.

Are you using our example from GitHub to display the camera in HTML, or your own code?

You can also find a thread on the forum where the reverse camera is displayed as an overlay: viewtopic.php?t=38