Conversation
|
Thanks! I do have a duplicate cam listing issue on my Linux machine, so I can test this. Maybe not now though as I just came back from organising and running a gaming convention + show. Will need some time to recover. |
|
OK, I thought duplicate cam listing was an issue on my side, but obsiously no :) I dug a bit and saw that this is a normal behavior. As explained on https://askubuntu.com/a/1191209 Linux kernel creates a second device for metadata and stuff. Instead of listing /sys/class/video4linux, I found that we should ask for capabilities for every device. This can be done by using ioctl, asking for VIDIOC_QUERYCAP data and check if the V4L2_CAP_VIDEO_CAPTURE flag is set. I changed the source code in order to check for this. |
This PR has been made in order to fix an issue on capture device listing in the settings menu on linux.
Video devices are listed in /sys/class/video4linux with "video<ID>".
When adding or removing a new webcam, a new folder video<ID> is created or deleted, but there is some edge cases where ID are not contiguous (example: plug two devices and remove the first one).
As the code is currently a range(0, <number of folder>), in these edge cases, capture devices are not properly detected.
To fix this, I changed
get_input_devicesto properly list every folders.As a side effect, I had to set
enumerateintoget_input_devicesinstead ofget_all_video_capture_devicesPlease note that, as I don't have any Windows available, tests were made only on Linux, but these changes should not break Autosplit on Windows.