Hello all !
I'm trying to have a simple JS app to open the camera and to display it on localhost a webpage.
Opening the camera and setting the resolution works fine with a simple :
My issue is that using this code the camera doesn't use autofocus...
So I've been exploring the libcamera options.Nicely displays the camera with focus-mode set to continuous.
Opted solution :
Setting up a v4l2 loopback device with :Then using a GStreamer pipeline using libcamerasrc:With the af-mode=continuous I finally get what I want on my /dev/video123 opened with VLC.
But now I'm unable to see the v4l2loopback interface in Chromium nor Firefox...
So my questions are :
Is there a way to default the /dev/video0 to a certain resolution and focus mode ?
Is there a way to have Chromium or Firefox detecting the V4l2loopback device ?
I'm struggling on this since quite a while and it kinda blew my mind ^^"
Many thanks !
I'm trying to have a simple JS app to open the camera and to display it on localhost a webpage.
Opening the camera and setting the resolution works fine with a simple :
Code:
navigator.mediaDevices.getUserMedia({ video: { frameRate: { ideal: 30, max: 30 } , width: 4608, height: 2592 } }) .then(stream => { video.srcObject = stream; }) .catch(err => { console.error("Error accessing webcam:", err); });So I've been exploring the libcamera options.
Code:
libcamera-helloOpted solution :
Setting up a v4l2 loopback device with :
Code:
sudo modprobe v4l2loopback video_nr=123 card_label="VirtualCam" exclusive_caps=1Code:
gst-launch-1.0 libcamerasrc af-mode=continuous ! "video/x-raw,format=BGRx,width=4608,height=2592" ! queue ! videoconvert ! v4l2sink device=/dev/video123But now I'm unable to see the v4l2loopback interface in Chromium nor Firefox...
So my questions are :
Is there a way to default the /dev/video0 to a certain resolution and focus mode ?
Is there a way to have Chromium or Firefox detecting the V4l2loopback device ?
I'm struggling on this since quite a while and it kinda blew my mind ^^"
Many thanks !
Statistics: Posted by TooT — Mon May 05, 2025 9:53 am — Replies 0 — Views 44