Gstreamer v4l2src could not negotiate format

Joel A Fernandes agnel.joel at
Thu Jul 28 22:46:11 PDT 2011

Hi Wim,

> Some snippet from the debug log (it queries the supported formats):
> gstv4l2object.c:1032:gst_v4l2_object_fill_format_list:<v4l2src0>  got 4
> format(s):
>> 0:00:01.588623047   898   0x324050 INFO                    v4l2
>> gstv4l2object.c:1038:gst_v4l2_object_fill_format_list:<v4l2src0>
>> YU12 (emulated)
>> 0:00:01.588684083   898   0x324050 INFO                    v4l2
>> gstv4l2object.c:1038:gst_v4l2_object_fill_format_list:<v4l2src0>
>> YV12 (emulated)
>> 0:00:01.588745118   898   0x324050 INFO                    v4l2
>> gstv4l2object.c:1038:gst_v4l2_object_fill_format_list:<v4l2src0>
>> BGR3 (emulated)
>> 0:00:01.588806153   898   0x324050 INFO                    v4l2
>> gstv4l2object.c:1038:gst_v4l2_object_fill_format_list:<v4l2src0>
>> RGB3 (emulated)
> So the camera supports only 4 formats: YU12, YV12, BGR3 and RGB3 all of them
> emulated.
> Since you are trying to make it produce UYVY with the capsfilter, this will
> fail, as the error message suggests. It does not call VIDEOC_S_FMT because
> the query of the formats revealed that UYVY is not supported.

Thanks for your suggestion. The camera driver supports only UYVY and
YUYV for now so I'm unusure about why (who) is returning these
formats. I dug into this further, and it seems that there are no
query/enumeration related IOCTLs being called during this enumeration
process. libv4l2 I'm guessing is returning some "emulated" formats
which seem to be unsupported.

My questions are:

1. Why does the v4l2src plugin not call the S_FMT function? I'm
guessing because of errors during v4l2s_src_get_caps which fails
because it tries to find the size for unsupported formats by making
IOCTLs to the driver (ioctl TRY_FMT)

2. In this case, how do I override the "format detection" part of v4l2src?

3. Is there something flawed in the way format detection/query is happening?

4. Why does it not use the caps filter parameters I pass in my
pipeline [1] instead of trying to query for formats?

5. Does libv4l2 conditionally make IOCTL system calls, when the
application requests it to do so by calling libv4l2_ioctl? I notice
that there are no ENUM_FMT calls at all when the code that determines
formats was executed, though v4l2src appeared to call libv4l2_ioctl.

Many Thanks,

[1] gst-launch -v v4l2src device=/dev/video2 !
'video/x-raw-yuv,width=640,height=480,format=(fourcc)UYVY' ! TIVidenc1
codecName=mpeg4enc engineName=codecServer ! filesink location=output.m4v

More information about the gstreamer-devel mailing list