I've created a couple of v4l2loopback devices for use as virtual webcams, and have been able to get Chrome to recognize them via navigator.mediaDevices.enumerateDevices(). I've also been able to construct gstreamer pipelines to send video and image data to these virtual webcams. what I haven't been able to do is designate any of these devices as front-facing, as reported by InputDeviceInfo.getCapabilities(). is this possible to do with v4l2loopback parameters? is it possible to do by configuring my gstreamer pipeline somehow?
1 Answer
The generic v4l2 standard doesn't know anything about "front-facing" and "back-facing" or "side-facing" cameras.
Such an attribute mostly (only?) makes sense when it comes to smartphones. It doesn't make sense for my good old analog camera nor my USB Webcam nor my builtin laptop webcam, all of which I've used with v4l2. It doesn't make much sense for my panoramic camera either (as the front/back dichotomy is too coarse in this case), but that is not supported by v4l2 anyhow...
So:
- v4l2 doesn't expose a standard property to communicate that camera orientation
- as a consequence,
v4l2loopbackdoes neither
- as a consequence,
- I've never seen any GStreamer stream that would expose the camera orientation either, but it seems there was discussion about such a thing (and obviously it was turned down due to the lack of a standardized source https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/520)
i guess the answer is: "no, not possible"
- this type of camera orientation does only make sense on smartphone cameras, yes - and that's exactly what I'm attempting to simulate. the gstreamer issue you linked to was very helpful, thanks for that.Dan O– Dan O2021-02-27 00:28:06 +00:00Commented Feb 27, 2021 at 0:28
InputDeviceInfo.getCapabilities()is language/framework specific and neither of the frameworks you mention (v4l2/loopback, gstreamer) does know about this. it's also probably a programming question that should be asked on Stack Overflow