[prev in list] [next in list] [prev in thread] [next in thread]
List: gstreamer-devel
Subject: Re: How to select the device-path for videosrc
From: Edgar Thier via gstreamer-devel <gstreamer-devel () lists ! freedesktop ! org>
Date: 2023-02-23 13:15:22
Message-ID: VI1PR09MB44638425235FCFE57D3DD1558AAB9 () VI1PR09MB4463 ! eurprd09 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
To open a device via a GstDeviceProvider use the GstDevice it offers:
https://gstreamer.freedesktop.org/documentation/gstreamer/gstdevice.html?gi-language=c#gst_device_create_element
The classes listed by a provider are just unsorted categories. "Video/Source" and \
"Source/Video" can be seen as identical. They exist to allow for filtering ( \
gst_device_monitor_add_filter(monitor, "Video/Source/something", NULL); ).
I am not familiar with these source elements so i cannot comment on them \
specifically. If you get muliple elements for a piece of hardware you can probably \
choose the first one and be fine. Alternatively you will have to look at the offered \
properties to make decisions programatically e.g. device.api = mediafoundation.
- Edgar
________________________________
From: gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org> on behalf of \
ÕÅÐÀ via gstreamer-devel <gstreamer-devel@lists.freedesktop.org>
Sent: Thursday, February 23, 2023 07:21
To: gstreamer-devel@lists.freedesktop.org <gstreamer-devel@lists.freedesktop.org>
Cc: ÕÅÐÀ <seanzhangxinsh@gmail.com>
Subject: How to select the device-path for videosrc
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<http://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
[Attachment #3 (text/html)]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof"> \
<br> </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof"> \
To open a device via a GstDeviceProvider use the GstDevice it offers:<br> </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof \
ContentPasted0"> <a href="https://gstreamer.freedesktop.org/documentation/gstreamer/gstdevice.html?gi-language=c#gst_device_create_element" \
id="LPlnk194210">https://gstreamer.freedesktop.org/documentation/gstreamer/gstdevice.html?gi-language=c#gst_device_create_element</a></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof \
ContentPasted0"> <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof \
ContentPasted0"> The classes listed by a provider are just unsorted categories. \
"Video/Source" and "Source/Video" can be seen as identical.</div> \
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof \
ContentPasted0 ContentPasted1"> They exist to allow for filtering ( \
gst_device_monitor_add_filter(monitor, "Video/Source/something", NULL); \
).</div> <div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: \
12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" \
class="elementToProof ContentPasted0 ContentPasted1"> <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof \
ContentPasted0 ContentPasted1"> I am not familiar with these source elements so i \
cannot comment on them specifically.</div> <div style="font-family: Calibri, Arial, \
Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: \
rgb(255, 255, 255);" class="elementToProof ContentPasted0 ContentPasted1"> If you get \
muliple elements for a piece of hardware you can probably choose the first one and be \
fine.</div> <div style="font-family: Calibri, Arial, Helvetica, sans-serif; \
font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" \
class="elementToProof ContentPasted0 ContentPasted1 ContentPasted2"> Alternatively \
you will have to look at the offered properties to make decisions programatically \
e.g. device.api = mediafoundation.</div> <br>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof"> \
<div class="elementToProof"><span>- Edgar<br> </span></div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof"> \
<br> </div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" \
style="font-size:11pt" color="#000000"><b>From:</b> gstreamer-devel \
<gstreamer-devel-bounces@lists.freedesktop.org> on behalf of ÕÅÐÀ via \
gstreamer-devel <gstreamer-devel@lists.freedesktop.org><br> <b>Sent:</b> \
Thursday, February 23, 2023 07:21<br> <b>To:</b> \
gstreamer-devel@lists.freedesktop.org \
<gstreamer-devel@lists.freedesktop.org><br> <b>Cc:</b> ÕÅÐÀ \
<seanzhangxinsh@gmail.com><br> <b>Subject:</b> How to select the device-path \
for videosrc</font> <div> </div>
</div>
<div>
<div dir="ltr">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: <div>Device found:<br>
<br>
name : Integrated Camera<br>
class : Video/Source<br>
caps : image/jpeg, width=1280, height=720, framerate=30/1, \
pixel-aspect-ratio=1/1<br> ...<br>
image/jpeg, width=320, height=180, framerate=30/1, \
pixel-aspect-ratio=1/1<br> video/x-raw, format=YUY2, \
width=1280, height=720, framerate=10/1, pixel-aspect-ratio=1/1<br> \
...<br> video/x-raw, format=YUY2, width=320, \
height=180, framerate=30/1, pixel-aspect-ratio=1/1<br> gst-launch-1.0 ksvideosrc \
device-path="\\\\\?\\usb\#vid_174f\&pid_2435\&mi_00\#6\&1a775b38\&1\&0000\#\{6994ad05-93ef-11d0-a3cc-00a0c9223196\}\\global" \
! ...<br> </div>
<div><br>
</div>
<div>Device found:<br>
<br>
name : Integrated Camera<br>
class : Source/Video<br>
caps : video/x-raw, format=BGR, width=1280, height=720, framerate=10/1, \
pixel-aspect-ratio=1/1<br> video/x-raw, format=BGR, \
width=960, height=540, framerate=15/1, pixel-aspect-ratio=1/1<br> ...<br>
video/x-raw, format=BGR, width=320, height=180, \
framerate=30/1, pixel-aspect-ratio=1/1<br> video/x-raw, \
format=NV12, width=1280, height=720, framerate=30/1, pixel-aspect-ratio=1/1, \
colorimetry=1:4:0:1<br> video/x-raw, format=NV12, \
width=960, height=540, framerate=30/1, pixel-aspect-ratio=1/1, \
colorimetry=1:4:0:1<br>
...<br>
image/jpeg, width=320, height=180, framerate=30/1, \
pixel-aspect-ratio=1/1, colorimetry=1:4:0:1<br> properties:<br>
device.api = mediafoundation<br>
device.path = \\?\usb#vid_174f&pid_2435&mi_00#6&1a775b38&1&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\global<br>
<a href="http://device.name">device.name</a> = Integrated Camera<br>
gst-launch-1.0 mfvideosrc \
device-path="\\\\\?\\usb\#vid_174f\&pid_2435\&mi_00\#6\&1a775b38\&1\&0000\#\{e5323777-f976-4f5b-9b55-b94699c46e44\}\\global" \
! ...<br> </div>
<div><br>
</div>
<div>Thanks</div>
</div>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic