Open wuhanstudio opened 2 years ago
Interesting discovery. I wonder if there's any way to query the v4l2 device to find out how many buffers it supports. One seems a touch low though. I'd have thought you'd want to double buffer minimum.
Interesting discovery. I wonder if there's any way to query the v4l2 device to find out how many buffers it supports. One seems a touch low though. I'd have thought you'd want to double buffer minimum.
The max number of buffers for v4l2loopback is 2 which is hard-coded according to:
#define V4L2LOOPBACK_DEFAULT_MAX_BUFFERS 2
input_uvc
plugin so that we can set NB_BUFFER
, this plugin should work with v4l2loopback devices. #define NB_BUFFER 2
by default.
Hi,
In continuation to the conversation at https://github.com/jacksonliam/mjpg-streamer/pull/280.
This PR adds support for v4l2loopback devices simply by changing
NB_BUFFER
to 1. It seems like the reasoninput_uvc
does not work is because it uses 4 buffers, while v4l2loopback devices only support 1.This PR is definitely not a good solution, but a simple workaround. It's much better if we can add a parameter for the number of buffers. What do you think?
I agree with you that:
To reproduce, first, we create two virtual cameras (v4l2loopback devices) from one HD camera:
Now, we can stream the video using mjpg-streamer: