Query (problem) using format 'RGB3' in caps filter

Antonio Ospite ao2 at ao2.it
Tue Oct 14 00:56:55 PDT 2014


On Tue, 14 Oct 2014 18:29:36 +1100
Anthony Buckley <tony.buckley000 at gmail.com> wrote:

> I have a problem trying to use RGB3 (also BGR3) format in a caps filter.
> I'm doing this in C, but the problem shows also if I use gst-launch thus:
>
> gst-launch-1.0 -e v4l2src !  video/x-raw, format=RGB3, width=640,
> height=480, framerate=10/1 ! videoconvert ! autovideosink
> 
> 0:00:00.023981006  3556      0x1ae0a10 ERROR           GST_PIPELINE
> ./grammar.y:624:gst_parse_perform_link: could not link v4l2src0 to
> videoconvert0
> WARNING: erroneous pipeline: could not link v4l2src0 to videoconvert0
>

GStreamer doesn't know the format name RGB3, you can verify that
looking in the SRC template in the output of:

gst-inspect-1.0 v4l2src

> I know the webcam can accept RGB3 as I've another program just using v4l2
> that takes snapshots using RGB3. Also running 'gucvview' shows the
> available formats are JPEG, YV12, YU12, RGB3, BGR3. JPEG is the native pix
> format of the camera and the others I think are available conversions added
> from v4l2. The above pipeline works fine with YV12 and I420 (YU12 ?), but
> not the others. Curiously, if I just use format=RGB it also works.
>

In v4l2 RGB3 is the name of the standard 24bpp RBG format,
see /usr/include/linux/videodev2.h:

#define V4L2_PIX_FMT_RGB24   v4l2_fourcc('R', 'G', 'B', '3') /* 24  RGB-8-8-8     */

in GStreamer this format is called just RGB,
see /usr/include/gstreamer-1.0/gst/video/video-format.h

 * @GST_VIDEO_FORMAT_RGB: rgb

The v4l2src element maps GStreamer formats to v4l2 formats:
http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/sys/v4l2/gstv4l2object.c#n1464

> I'm sure I'm doing something wrong or have some misunderstanding and was
> hopeful that someone could possibly provide some insight for me.
>

It's just that GStreamer and v4l2 call the same format with different
names.

The other apps you used were specific to v4l2 so it makes sense for them
to use the v4l2 format names, but Gstreamer is more generic; when using
GStreamer use the GStreamer format names, not the v4l2 format names.

Ciao,
   Antonio

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


More information about the gstreamer-devel mailing list