How to select the device-path for videosrc

张欣 seanzhangxinsh at gmail.com
Thu Feb 23 06:21:49 UTC 2023


My laptop has 1 integrated cam, but when I run gst-device-monitor-1.0.exe
to get device path, there are 2 device-paths for same device, and it seems
one device-path is for ksvideosrc, it class is "class : Video/Source", the
other one is for mfvideosrc, class is "Source/Video". My question is how to
programally select a correct device for mfdevice? I pasted a part of output
of "gst-device-monitor-1.0.exe" as below:
Device found:

name  : Integrated Camera
class : Video/Source
caps  : image/jpeg, width=1280, height=720, framerate=30/1,
pixel-aspect-ratio=1/1
     ...
       image/jpeg, width=320, height=180, framerate=30/1,
pixel-aspect-ratio=1/1
       video/x-raw, format=YUY2, width=1280, height=720, framerate=10/1,
pixel-aspect-ratio=1/1
      ...
       video/x-raw, format=YUY2, width=320, height=180, framerate=30/1,
pixel-aspect-ratio=1/1
gst-launch-1.0 ksvideosrc
device-path="\\\\\?\\usb\#vid_174f\&pid_2435\&mi_00\#6\&1a775b38\&1\&0000\#\{6994ad05-93ef-11d0-a3cc-00a0c9223196\}\\global"
! ...

Device found:

name  : Integrated Camera
class : Source/Video
caps  : video/x-raw, format=BGR, width=1280, height=720, framerate=10/1,
pixel-aspect-ratio=1/1
       video/x-raw, format=BGR, width=960, height=540, framerate=15/1,
pixel-aspect-ratio=1/1
 ...
       video/x-raw, format=BGR, width=320, height=180, framerate=30/1,
pixel-aspect-ratio=1/1
       video/x-raw, format=NV12, width=1280, height=720, framerate=30/1,
pixel-aspect-ratio=1/1, colorimetry=1:4:0:1
       video/x-raw, format=NV12, width=960, height=540, framerate=30/1,
pixel-aspect-ratio=1/1, colorimetry=1:4:0:1
...
       image/jpeg, width=320, height=180, framerate=30/1,
pixel-aspect-ratio=1/1, colorimetry=1:4:0:1
properties:
device.api = mediafoundation
device.path =
\\?\usb#vid_174f&pid_2435&mi_00#6&1a775b38&1&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\global
device.name = Integrated Camera
gst-launch-1.0 mfvideosrc
device-path="\\\\\?\\usb\#vid_174f\&pid_2435\&mi_00\#6\&1a775b38\&1\&0000\#\{e5323777-f976-4f5b-9b55-b94699c46e44\}\\global"
! ...

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230223/e244d73d/attachment-0001.htm>


More information about the gstreamer-devel mailing list