How to handle pixel format synonyms ("YUYV" is also known as "YUY2")?

Matthew Thyer matthew.thyer at adelaide.edu.au
Fri Aug 31 08:11:26 UTC 2018


On the GstDeviceMonitor API, I'm guessing that I'm not getting GST_MESSAGE_DEVICE_ADDED or GST_MESSAGE_DEVICE_REMOVED messages because I've built my own version of GStreamer 1.14.2 from source.

If I use the Ubuntu 18.04 package for GStreamer i.e. running:
$ /usr/bin/gst-device-monitor-1.0 --follow
It does work (in that I get the "Device removed:" and "Device found:" messages when I hot-plug a V4L2 USB camera - Logitech C270).
However, my hand built version doesn't (in that I don't get the "Device removed:" and "Device found:" messages when I hot-plug).

Both versions will probe an existing device and the difference in output is that my hand built version has "udev-probed = false" in its output where the O.S. version has "udev-probed = true".

The O.S. version also provides a lot of additional lines of output that my hand built version doesn't:
                device.bus_path = pci-0000:00:14.0-usb-0:1:1.0
                sysfs.path = /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/video4linux/video0
                device.bus = usb
                device.subsystem = video4linux
                device.vendor.id = 046d
                device.vendor.name = 046d
                device.product.id = 0825
                device.product.name = "UVC\ Camera\ \(046d:0825\)"
                device.serial = 046d_0825_FC10CF10
                device.capabilities = :capture:

I don't think this is a problem for my application as the camera will not be hot plugged.

It is, however, a problem if I cannot use the GstDeviceMonitor API with genicam industrial cameras (e.g. with aravissrc).
I'll need to find another way to validate the user supplied pixel format as being valid for the camera.

-----Original Message-----
From: Matthew Thyer
Sent: Friday, 31 August 2018 12:33 PM
To: 'Discussion of the development of and with GStreamer' <gstreamer-devel at lists.freedesktop.org>
Subject: RE: How to handle pixel format synonyms ("YUYV" is also known as "YUY2")?

Text "However, if it's" should read:
However, if it's the only genicam camera attached, a pipeline of just:
aravissrc ! capsfilter...
will work.

-----Original Message-----
From: Matthew Thyer
Sent: Friday, 31 August 2018 12:31 PM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Subject: RE: How to handle pixel format synonyms ("YUYV" is also known as "YUY2")?

Thanks Nicolas,

In experimenting with the command line "gst-device-monitor-1.0", I'm wondering how to get it to report on the FLIR (previously Point Grey Research) Blackfly S BFS-U3-13Y3C industrial camera that I need to work with.
This is not a V4L2 device and the GStreamer source element I use for it is "aravissrc" from the "aravis" plugin that I've built for git master from Project Aravis (https://github.com/AravisProject/aravis).
This camera is a "genicam" camera and would typically be addressed by name:
aravissrc name=PointGrey-0115138B ! capsfilter...
However, if it's

I've tried the following:
$ gst-device-monitor-1.0 --gst-plugin-path=/usr/local/aravis-0.5/lib/gstreamer-1.0 --gst-plugin-load=aravis Video/Source:video/x-raw --follow

And then plugging in the USB 3 camera device but nothing appears...
For that matter, I cannot even get the "Logitech HD Webcam C270" V4L2 camera to be reported on via this hot plugging method.
(The Logitech camera will be reported on if it's connected when I run gst-device-monitor-1.0).

Do I need to do something with udev for this?

I currently have a file "/etc/udev/rules.d/aravis.rules" with content:
# Point Grey Research
SUBSYSTEM=="usb", ATTRS{idVendor}=="1e10", MODE:="0666", TAG+="uaccess", TAG+="udev-acl"

Thanks in advance

-----Original Message-----
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On Behalf Of Nicolas Dufresne
Sent: Wednesday, 29 August 2018 9:18 PM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Subject: Re: How to handle pixel format synonyms ("YUYV" is also known as "YUY2")?

Le mercredi 29 août 2018 à 02:28 +0000, Matthew Thyer a écrit :
> I'm working on an application to serve hardware accelerated H.264/AVC
> video via RTSP. I'm using the GStreamer RTSP Server 1.14.2 (built from
> source) and (currently) a Video 4 Linux 2 source.

[snip...]

> This would be fine excepting for the problem of pixel format synonyms
> (i.e. in particular, "YUYV" is also known as "YUY2").

There is no standard for fourcc, as a side effect, the GStreamer chosen one does not match the V4L2 one. Though, this does not matter, the translation is handled by GStreamer. Instead of calling into V4L2 API to enumerate the formats, you should use the GstDeviceMonitor API to track and enumerate cameras. This way, you're application becomes V4L2 agnostic, and a transition to pipewire could be made possible.

[snip...]
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list