как найти индекс устройства внешней камеры для gstreamer? - PullRequest
0 голосов
/ 27 декабря 2018

gst-device-monitor-1.0 отображает только устройства класса Audio / Source.он вообще не отображает видео / исходные устройства,

Кроме того, он не работает, когда явно запрашивается только видеоустройство.

gst-device-monitor-1.0 Video/Source

Probing devices...

0:00:00.023973000 37488 0x7fce61d80350 WARN                 default gstdevicemonitor.c:465:gboolean gst_device_monitor_start(GstDeviceMonitor *):<devicemonitor0> No providers match the current filters
Failed to start device monitor!

, однако работает следующая команда, поэтому он может видеть встроенныев камере, и у меня есть другой, подключенный через USB.

gst-launch-1.0 avfvideosrc device-index=0 ! video/x-raw, framerate=30/1, width=1280, height=720   ! autovideosink

Есть ли другой способ узнать индекс устройства подключенной внешней камеры, чтобы его можно было передать на устройство avfvideosrc?

версия gstreamer:

 gst-launch-1.0 --version
gst-launch-1.0 version 1.14.4
GStreamer 1.14.4
Unknown package origin

Работает в OSX: Sierra 10.12.6

1 Ответ

0 голосов
/ 07 января 2019

Это может быть ошибка.Он отлично работает на Windows 10:

    gst-device-monitor-1.0
Probing devices...


Device found:

        name  : Realtek Digital Output (Realtek(R) Audio)
        class : Audio/Sink
        caps  : audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ];
                audio/x-raw, format=(string)U8, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ];
                audio/x-ac3, framed=(boolean)true;
                audio/x-dts, framed=(boolean)true;
        properties:
                device.api = directsound
                device.guid = "\{4AC70C7D-F592-460B-98A2-EAAC3947DEE6\}"
                directsound.device.driver = "\{0.0.0.00000000\}.\{4ac70c7d-f592-460b-98a2-eaac3947dee6\}"
                directsound.device.description = "Realtek\ Digital\ Output\ \(Realtek\(R\)\ Audio\)"
        gst-launch-1.0 ... ! directsoundsink device="\{4AC70C7D-F592-460B-98A2-EAAC3947DEE6\}"


Device found:

        name  : Speakers (Realtek(R) Audio)
        class : Audio/Sink
        caps  : audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ];
                ... etc ...
        properties:
                device.api = directsound
                device.guid = "\{5C211A4B-03A5-48DF-974A-E209146FDD9D\}"
                directsound.device.driver = "\{0.0.0.00000000\}.\{5c211a4b-03a5-48df-974a-e209146fdd9d\}"
                directsound.device.description = "Speakers\ \(Realtek\(R\)\ Audio\)"
        gst-launch-1.0 ... ! directsoundsink device="\{5C211A4B-03A5-48DF-974A-E209146FDD9D\}"


Device found:

        name  : Primary Sound Driver
        class : Audio/Sink
        caps  : audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ];
                ... etc ...
        properties:
                device.api = directsound
                device.guid = "\(NULL\)"
                directsound.device.driver = ""
                directsound.device.description = "Primary\ Sound\ Driver"
        gst-launch-1.0 ... ! directsoundsink


Device found:

        name  : Microphone (Webcam C170)
        class : Audio/Source
        caps  : audio/x-raw, format=(string){ S16LE, S8 }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ];
        properties:
                device.api = directsound
                device.guid = "\{CF31A819-CCBA-47D4-A669-83CA42CE4DEB\}"
                directsound.device.driver = "\{0.0.1.00000000\}.\{cf31a819-ccba-47d4-a669-83ca42ce4deb\}"
                directsound.device.description = "Microphone\ \(Webcam\ C170\)"
        gst-launch-1.0 directsoundsrc device="\{CF31A819-CCBA-47D4-A669-83CA42CE4DEB\}" ! ...


Device found:

        name  : Primary Sound Capture Driver
        class : Audio/Source
        caps  : audio/x-raw, format=(string){ S16LE, S8 }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2 ];
        properties:
                device.api = directsound
                device.guid = "\(NULL\)"
                directsound.device.driver = ""
                directsound.device.description = "Primary\ Sound\ Capture\ Driver"
        gst-launch-1.0 directsoundsrc ! ...


Device found:

        name  : Webcam C170
        class : Video/Source
        caps  : video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, framerate=(fraction)[ 15/1, 30/1 ], pixel-aspect-ratio=(fraction)1/1;
                ... etc ...
                image/jpeg, width=(int)1024, height=(int)768, framerate=(fraction)[ 15/1, 30/1 ], pixel-aspect-ratio=(fraction)1/1;
        gst-launch-1.0 ksvideosrc device-path="\\\\\?\\usb\#vid_046d\&pid_082b\&mi_00\#9\&19fda08e\&1\&0000\#\{6994ad05-93ef-11d0-a3cc-00a0c9223196\}\\global" ! ...


Device found:

        name  : Microphone (Webcam C170)
        class : Audio/Source
        caps  : audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)44100, channels=(int)1, channel-mask=(bitmask)0x0000000000000000;
        properties:
                device.api = wasapi
                device.strid = "\{0.0.1.00000000\}.\{cf31a819-ccba-47d4-a669-83ca42ce4deb\}"
                wasapi.device.description = "Microphone\ \(Webcam\ C170\)"
        gst-launch-1.0 wasapisrc device="\{0.0.1.00000000\}.\{cf31a819-ccba-47d4-a669-83ca42ce4deb\}" ! ...


Device found:

        name  : Speakers (Realtek(R) Audio)
        class : Audio/Sink
        caps  : audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003;
        properties:
                device.api = wasapi
                device.strid = "\{0.0.0.00000000\}.\{5c211a4b-03a5-48df-974a-e209146fdd9d\}"
                wasapi.device.description = "Speakers\ \(Realtek\(R\)\ Audio\)"
        gst-launch-1.0 ... ! wasapisink device="\{0.0.0.00000000\}.\{5c211a4b-03a5-48df-974a-e209146fdd9d\}"


Device found:

        name  : Realtek Digital Output (Realtek(R) Audio)
        class : Audio/Sink
        caps  : audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)48000, channels=(int)2, channel-mask=(bitmask)0x0000000000000003;
        properties:
                device.api = wasapi
                device.strid = "\{0.0.0.00000000\}.\{4ac70c7d-f592-460b-98a2-eaac3947dee6\}"
                wasapi.device.description = "Realtek\ Digital\ Output\ \(Realtek\(R\)\ Audio\)"
        gst-launch-1.0 ... ! wasapisink device="\{0.0.0.00000000\}.\{4ac70c7d-f592-460b-98a2-eaac3947dee6\}"

И

    gst-device-monitor-1.0 Video/Source
Probing devices...


Device found:

        name  : Webcam C170
        class : Video/Source
        caps  : video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, framerate=(fraction)[ 15/1, 30/1 ], pixel-aspect-ratio=(fraction)1/1;
                ... etc ...
                image/jpeg, width=(int)1024, height=(int)768, framerate=(fraction)[ 15/1, 30/1 ], pixel-aspect-ratio=(fraction)1/1;
        gst-launch-1.0 ksvideosrc device-path="\\\\\?\\usb\#vid_046d\&pid_082b\&mi_00\#9\&19fda08e\&1\&0000\#\{6994ad05-93ef-11d0-a3cc-00a0c9223196\}\\global" ! ...
...