MJPEG USB camera to H264 Encoding Pipeline

Alexandru Stefan alexandru.n.stefan at gmail.com
Thu Jul 7 05:46:11 UTC 2022


Thank you both for the suggestions! I have run with debugging focussed on
CAPS and, to my untrained eyes, it looks like it is indeed a format
problem. However, it seems to be a mismatch between the v4l2src and the
jpegdecoder element (UYVY from the camera, compared to BT709 which is
expected by the JPEG decoder and H264 encoder). I did try a videoconvert
element with filter caps at either end, but to no avail.

root at apalis-imx8-06959030:~# gst-launch-1.0 v4l2src device=/dev/video2 !
jpegparse ! v4l2jpegdec ! v4l2h264enc ! fakesink -v
--gst-debug=*:3,GST_CAPS:5

0:00:00.439860561   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2src0:src> get pad caps with filter
(NULL)
0:00:00.440151426   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2src0:src> query returned
image/jpeg; video/mpeg, mpegversion=(int)4, systemstream=(boolean)false;
video/mpeg, mpegversion=(int){ 1, 2 }; video/mpegts,
systemstream=(boolean)true; video/x-bayer, format=(string){ bggr, gbrg,
grbg, rggb }, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-cavs; video/x-divx,
divxversion=(int)[ 3, 6 ]; video/x-dv, systemstream=(boolean)true;
video/x-flash-video, flvversion=(int)1; video/x-fwht; video/x-h263,
variant=(string)itu; video/x-h264, stream-format=(string){ byte-stream, avc
}, alignment=(string)au; video/x-h265, stream-format=(string)byte-stream,
alignment=(string)au; video/x-pn-realvideo; video/x-pwc1, width=(int)[ 1,
32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1
]; video/x-pwc2, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){
RGB16, BGR, RGB, RGBA, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU,
UYVY, Y42B, Y41B, v308, YUV9, NV12_10LE, NV12_64Z32, NV24, NV61, NV16,
NV21, NV12, I420, xRGB, BGRA, BGRx, ARGB, BGR15, RGB15 }, width=(int)[ 1,
32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1
]; video/x-sonix, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-vp6-flash; video/x-vp8;
video/x-vp9; video/x-wmv, wmvversion=(int)3; video/x-xvid
0:00:00.440240923   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<jpegparse0:sink> get pad caps with
filter (NULL)
0:00:00.440305420   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<jpegparse0:sink> query returned
image/jpeg
0:00:00.440385168   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2src0:src> get pad caps with filter
(NULL)
0:00:00.440566036   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2src0:src> query returned
image/jpeg; video/mpeg, mpegversion=(int)4, systemstream=(boolean)false;
video/mpeg, mpegversion=(int){ 1, 2 }; video/mpegts,
systemstream=(boolean)true; video/x-bayer, format=(string){ bggr, gbrg,
grbg, rggb }, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-cavs; video/x-divx,
divxversion=(int)[ 3, 6 ]; video/x-dv, systemstream=(boolean)true;
video/x-flash-video, flvversion=(int)1; video/x-fwht; video/x-h263,
variant=(string)itu; video/x-h264, stream-format=(string){ byte-stream, avc
}, alignment=(string)au; video/x-h265, stream-format=(string)byte-stream,
alignment=(string)au; video/x-pn-realvideo; video/x-pwc1, width=(int)[ 1,
32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1
]; video/x-pwc2, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){
RGB16, BGR, RGB, RGBA, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU,
UYVY, Y42B, Y41B, v308, YUV9, NV12_10LE, NV12_64Z32, NV24, NV61, NV16,
NV21, NV12, I420, xRGB, BGRA, BGRx, ARGB, BGR15, RGB15 }, width=(int)[ 1,
32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1
]; video/x-sonix, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-vp6-flash; video/x-vp8;
video/x-vp9; video/x-wmv, wmvversion=(int)3; video/x-xvid
0:00:00.440646033   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<jpegparse0:sink> get pad caps with
filter (NULL)
0:00:00.440702406   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<jpegparse0:sink> query returned
image/jpeg
0:00:00.440865651   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2277:gst_pad_link_check_compatible_unlocked:<v4l2src0:src> src
caps image/jpeg; video/mpeg, mpegversion=(int)4,
systemstream=(boolean)false; video/mpeg, mpegversion=(int){ 1, 2 };
video/mpegts, systemstream=(boolean)true; video/x-bayer, format=(string){
bggr, gbrg, grbg, rggb }, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768
], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-cavs; video/x-divx,
divxversion=(int)[ 3, 6 ]; video/x-dv, systemstream=(boolean)true;
video/x-flash-video, flvversion=(int)1; video/x-fwht; video/x-h263,
variant=(string)itu; video/x-h264, stream-format=(string){ byte-stream, avc
}, alignment=(string)au; video/x-h265, stream-format=(string)byte-stream,
alignment=(string)au; video/x-pn-realvideo; video/x-pwc1, width=(int)[ 1,
32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1
]; video/x-pwc2, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw, format=(string){
RGB16, BGR, RGB, RGBA, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU,
UYVY, Y42B, Y41B, v308, YUV9, NV12_10LE, NV12_64Z32, NV24, NV61, NV16,
NV21, NV12, I420, xRGB, BGRA, BGRx, ARGB, BGR15, RGB15 }, width=(int)[ 1,
32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1
]; video/x-sonix, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-vp6-flash; video/x-vp8;
video/x-vp9; video/x-wmv, wmvversion=(int)3; video/x-xvid
0:00:00.440938773   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2279:gst_pad_link_check_compatible_unlocked:<jpegparse0:sink> sink
caps image/jpeg
0:00:00.440980271   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2297:gst_pad_link_check_compatible_unlocked: caps are compatible
0:00:00.441121517   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<jpegparse0:src> get pad caps with
filter (NULL)
0:00:00.441200764   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3182:gst_pad_query_caps_default:<jpegparse0:src> query caps caps
query: 0xaaaaffae0a30, GstQueryCaps, filter=(GstCaps)"NULL",
caps=(GstCaps)"NULL";
0:00:00.441237762   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3200:gst_pad_query_caps_default:<jpegparse0:src> fixed pad caps:
trying pad caps
0:00:00.441271511   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3206:gst_pad_query_caps_default:<jpegparse0:src> trying pad
template caps
0:00:00.441356883   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3235:gst_pad_query_caps_default:<jpegparse0:src> using caps
0xaaaaff905190 image/jpeg, format=(string){ I420, Y41B, UYVY, YV12 },
width=(int)[ 0, 2147483647 ], height=(int)[ 0, 2147483647 ],
framerate=(fraction)[ 0/1, 2147483647/1 ], parsed=(boolean)true
0:00:00.441439505   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<jpegparse0:src> query returned
image/jpeg, format=(string){ I420, Y41B, UYVY, YV12 }, width=(int)[ 0,
2147483647 ], height=(int)[ 0, 2147483647 ], framerate=(fraction)[ 0/1,
2147483647/1 ], parsed=(boolean)true
0:00:00.441493128   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2jpegdec0:sink> get pad caps with
filter (NULL)
0:00:00.441555876   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3103:gst_pad_peer_query_caps:<v4l2jpegdec0:src> get pad peer
caps with filter (NULL)
0:00:00.441691246   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2jpegdec0:sink> query returned
image/jpeg, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.441781368   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<jpegparse0:src> get pad caps with
filter (NULL)
0:00:00.441854491   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3182:gst_pad_query_caps_default:<jpegparse0:src> query caps caps
query: 0xaaaaffae0ca0, GstQueryCaps, filter=(GstCaps)"NULL",
caps=(GstCaps)"NULL";
0:00:00.441899364   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3200:gst_pad_query_caps_default:<jpegparse0:src> fixed pad caps:
trying pad caps
0:00:00.441939488   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3206:gst_pad_query_caps_default:<jpegparse0:src> trying pad
template caps
0:00:00.442012860   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:3235:gst_pad_query_caps_default:<jpegparse0:src> using caps
0xaaaaff905190 image/jpeg, format=(string){ I420, Y41B, UYVY, YV12 },
width=(int)[ 0, 2147483647 ], height=(int)[ 0, 2147483647 ],
framerate=(fraction)[ 0/1, 2147483647/1 ], parsed=(boolean)true
0:00:00.442092482   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<jpegparse0:src> query returned
image/jpeg, format=(string){ I420, Y41B, UYVY, YV12 }, width=(int)[ 0,
2147483647 ], height=(int)[ 0, 2147483647 ], framerate=(fraction)[ 0/1,
2147483647/1 ], parsed=(boolean)true
0:00:00.442146480   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2jpegdec0:sink> get pad caps with
filter (NULL)
0:00:00.442201603   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3103:gst_pad_peer_query_caps:<v4l2jpegdec0:src> get pad peer
caps with filter (NULL)
0:00:00.442309599   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2jpegdec0:sink> query returned
image/jpeg, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.442384847   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2277:gst_pad_link_check_compatible_unlocked:<jpegparse0:src> src
caps image/jpeg, format=(string){ I420, Y41B, UYVY, YV12 }, width=(int)[ 0,
2147483647 ], height=(int)[ 0, 2147483647 ], framerate=(fraction)[ 0/1,
2147483647/1 ], parsed=(boolean)true
0:00:00.442450220   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2279:gst_pad_link_check_compatible_unlocked:<v4l2jpegdec0:sink>
sink caps image/jpeg, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ],
framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.442502718   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2297:gst_pad_link_check_compatible_unlocked: caps are compatible
0:00:00.442589965   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2jpegdec0:src> get pad caps with
filter (NULL)
0:00:00.442678836   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2jpegdec0:src> query returned
video/x-raw, format=(string){ NV12, NV12_10LE }, width=(int)[ 1, 32768 ],
height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.442734334   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2h264enc0:sink> get pad caps with
filter (NULL)
0:00:00.442811582   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2h264enc0:sink> query returned
video/x-raw, format=(string)NV12, width=(int)[ 1, 32768 ], height=(int)[ 1,
32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.442891204   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2jpegdec0:src> get pad caps with
filter (NULL)
0:00:00.442973451   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2jpegdec0:src> query returned
video/x-raw, format=(string){ NV12, NV12_10LE }, width=(int)[ 1, 32768 ],
height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.443025824   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2h264enc0:sink> get pad caps with
filter (NULL)
0:00:00.443099822   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2h264enc0:sink> query returned
video/x-raw, format=(string)NV12, width=(int)[ 1, 32768 ], height=(int)[ 1,
32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.443171444   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2277:gst_pad_link_check_compatible_unlocked:<v4l2jpegdec0:src> src
caps video/x-raw, format=(string){ NV12, NV12_10LE }, width=(int)[ 1, 32768
], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.443237442   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2279:gst_pad_link_check_compatible_unlocked:<v4l2h264enc0:sink>
sink caps video/x-raw, format=(string)NV12, width=(int)[ 1, 32768 ],
height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:00.443288815   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2297:gst_pad_link_check_compatible_unlocked: caps are compatible
0:00:00.443372812   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2h264enc0:src> get pad caps with
filter (NULL)
0:00:00.443446309   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2h264enc0:src> query returned
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au
0:00:00.443498057   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<fakesink0:sink> get pad caps with
filter (NULL)
0:00:00.443558930   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<fakesink0:sink> query returned ANY
0:00:00.443628178   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2h264enc0:src> get pad caps with
filter (NULL)
0:00:00.443696300   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2h264enc0:src> query returned
video/x-h264, stream-format=(string)byte-stream, alignment=(string)au
0:00:00.443747299   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<fakesink0:sink> get pad caps with
filter (NULL)
0:00:00.443807672   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<fakesink0:sink> query returned ANY
0:00:00.443864920   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2277:gst_pad_link_check_compatible_unlocked:<v4l2h264enc0:src> src
caps video/x-h264, stream-format=(string)byte-stream, alignment=(string)au
0:00:00.443911668   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2279:gst_pad_link_check_compatible_unlocked:<fakesink0:sink> sink
caps ANY
0:00:00.443953541   969 0xaaaaffac8690 DEBUG               GST_CAPS
gstpad.c:2297:gst_pad_link_check_compatible_unlocked: caps are compatible
Setting pipeline to PAUSED ...
0:00:00.447318172   969 0xaaaaffac8690 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.447393920   969 0xaaaaffac8690 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.447641786   969 0xaaaaffac8690 WARN                    v4l2
gstv4l2object.c:4400:gst_v4l2_object_probe_caps:<v4l2h264enc0:src> Failed
to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
0:00:00.449083360   969 0xaaaaffac8690 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.449140483   969 0xaaaaffac8690 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.449620591   969 0xaaaaffac8690 WARN                    v4l2
v4l2_calls.c:547:gst_v4l2_subscribe_event:<v4l2src0> Cannot subscribe
V4L2_EVENT_SOURCE_CHANGE or V4L2_EVENT_EOS event for device '/dev/video2'.
Pipeline is live and does not need PREROLL ...
0:00:00.450787175   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2src0:src> get pad caps with filter
(NULL)
0:00:00.451088414   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2src0:src> query returned
image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1; image/jpeg,
width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)120/1; image/jpeg, width=(int)640, height=(int)360,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)1285718/4945
0:00:00.451150162   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3103:gst_pad_peer_query_caps:<v4l2src0:src> get pad peer caps
with filter (NULL)
Setting pipeline to PLAYING ...
0:00:00.451214535   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3110:gst_pad_peer_query_caps:<v4l2src0:src> peer query returned
image/jpeg
New clock: GstSystemClock
0:00:00.463314982   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2732:gst_pad_get_current_caps:<v4l2src0:src> get current pad caps
(NULL)
0:00:00.463516850   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3140:gst_pad_query_accept_caps:<jpegparse0:sink> accept caps of
image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1,
colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
0:00:00.463601972   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<jpegparse0:sink> get pad caps with
filter image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1,
colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = image/jpeg,
width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1,
framerate=(fraction)60/1, colorimetry=(string)2:4:7:1,
interlace-mode=(string)progressive
0:00:00.463706218   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<jpegparse0:sink> query returned
image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1,
colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
0:00:00.463858713   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2732:gst_pad_get_current_caps:<v4l2src0:src> get current pad caps
image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1,
colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstJpegParse:jpegparse0.GstPad:sink: caps =
image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1,
colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
0:00:00.463973459   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2732:gst_pad_get_current_caps:<v4l2src0:src> get current pad caps
image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1,
colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
0:00:00.499340458   969 0xaaaaffae0940 WARN          v4l2bufferpool
gstv4l2bufferpool.c:813:gst_v4l2_buffer_pool_start:<v4l2src0:pool:src>
Uncertain or not enough buffers, enabling copy threshold
0:00:00.831607837   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2732:gst_pad_get_current_caps:<jpegparse0:sink> get current pad
caps image/jpeg, width=(int)1920, height=(int)1080,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)60/1,
colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive
0:00:00.837091143   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3140:gst_pad_query_accept_caps:<v4l2jpegdec0:sink> accept caps
of image/jpeg, parsed=(boolean)true, framerate=(fraction)60/1
0:00:00.837221388   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2jpegdec0:sink> get pad caps with
filter image/jpeg, parsed=(boolean)true, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstJpegParse:jpegparse0.GstPad:src: caps =
image/jpeg, parsed=(boolean)true, framerate=(fraction)60/1
0:00:00.837376508   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3103:gst_pad_peer_query_caps:<v4l2jpegdec0:src> get pad peer
caps with filter video/x-raw, framerate=(fraction)60/1
0:00:00.837547627   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3110:gst_pad_peer_query_caps:<v4l2jpegdec0:src> peer query
returned video/x-raw, framerate=(fraction)60/1, format=(string)NV12,
width=(int)[ 64, 1920, 16 ], height=(int)[ 48, 1920, 2 ],
interlace-mode=(string)progressive, colorimetry=(string){ bt709 }
0:00:00.837830992   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2jpegdec0:sink> query returned
image/jpeg, width=(int)[ 64, 1920, 16 ], height=(int)[ 48, 1920, 2 ],
framerate=(fraction)60/1, colorimetry=(string)bt709, parsed=(boolean)true
0:00:00.838436845   969 0xaaaaffae0940 WARN                    v4l2
gstv4l2object.c:4400:gst_v4l2_object_probe_caps:<v4l2jpegdec0:src> Failed
to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
0:00:00.838564716   969 0xaaaaffae0940 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.838633838   969 0xaaaaffae0940 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.838853080   969 0xaaaaffae0940 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.838918203   969 0xaaaaffae0940 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.839371687   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2704:gst_pad_has_current_caps:<jpegparse0:src> check current pad
caps image/jpeg, parsed=(boolean)true, framerate=(fraction)60/1
0:00:00.839458184   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2732:gst_pad_get_current_caps:<jpegparse0:src> get current pad
caps image/jpeg, parsed=(boolean)true, framerate=(fraction)60/1
/GstPipeline:pipeline0/v4l2jpegdec:v4l2jpegdec0.GstPad:sink: caps =
image/jpeg, parsed=(boolean)true, framerate=(fraction)60/1
0:00:00.890482880   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3140:gst_pad_query_accept_caps:<v4l2jpegdec0:sink> accept caps
of image/jpeg, parsed=(boolean)true, format=(string)UYVY, width=(int)1920,
height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/GstJpegParse:jpegparse0.GstPad:src: caps =
image/jpeg, parsed=(boolean)true, format=(string)UYVY, width=(int)1920,
height=(int)1080, framerate=(fraction)60/1
0:00:00.890609126   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3057:gst_pad_query_caps:<v4l2jpegdec0:sink> get pad caps with
filter image/jpeg, parsed=(boolean)true, format=(string)UYVY,
width=(int)1920, height=(int)1080, framerate=(fraction)60/1
0:00:00.890721372   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3103:gst_pad_peer_query_caps:<v4l2jpegdec0:src> get pad peer
caps with filter video/x-raw, width=(int)1920, height=(int)1080,
framerate=(fraction)60/1
0:00:00.890846617   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3110:gst_pad_peer_query_caps:<v4l2jpegdec0:src> peer query
returned video/x-raw, width=(int)1920, height=(int)1080,
framerate=(fraction)60/1, format=(string)NV12,
interlace-mode=(string)progressive, colorimetry=(string){ bt709 }
0:00:00.891008862   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstutils.c:3064:gst_pad_query_caps:<v4l2jpegdec0:sink> query returned
image/jpeg, width=(int)1920, height=(int)1080, framerate=(fraction)60/1,
colorimetry=(string)bt709, parsed=(boolean)true, format=(string)UYVY
0:00:00.891237604   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2704:gst_pad_has_current_caps:<jpegparse0:src> check current pad
caps image/jpeg, parsed=(boolean)true, format=(string)UYVY,
width=(int)1920, height=(int)1080, framerate=(fraction)60/1
/GstPipeline:pipeline0/v4l2jpegdec:v4l2jpegdec0.GstPad:sink: caps =
image/jpeg, parsed=(boolean)true, format=(string)UYVY, width=(int)1920,
height=(int)1080, framerate=(fraction)60/1
0:00:00.894478739   969 0xffff9c003590 WARN                    v4l2
gstv4l2object.c:4400:gst_v4l2_object_probe_caps:<v4l2jpegdec0:src> Failed
to probe pixel aspect ratio with VIDIOC_CROPCAP: Invalid argument
0:00:00.894536362   969 0xffff9c003590 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.894564486   969 0xffff9c003590 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.894644233   969 0xffff9c003590 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.894672482   969 0xffff9c003590 WARN                    v4l2
gstv4l2object.c:2031:gst_v4l2_object_get_interlace_mode: Driver bug
detected - check driver with v4l2-compliance from
http://git.linuxtv.org/v4l-utils.git

0:00:00.894790603   969 0xffff9c003590 DEBUG               GST_CAPS
gstutils.c:3103:gst_pad_peer_query_caps:<v4l2jpegdec0:src> get pad peer
caps with filter video/x-raw, format=(string)NV12, framerate=(fraction)0/1,
width=(int)1920, height=(int)1080, interlace-mode=(string)progressive,
pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2,
colorimetry=(string)bt709
0:00:00.894845726   969 0xffff9c003590 DEBUG               GST_CAPS
gstutils.c:3110:gst_pad_peer_query_caps:<v4l2jpegdec0:src> peer query
returned EMPTY
0:00:00.894877100   969 0xffff9c003590 ERROR           v4l2videodec
gstv4l2videodec.c:656:gst_v4l2_video_dec_loop:<v4l2jpegdec0> not negotiated
0:00:00.896224927   969 0xaaaaffae0940 DEBUG               GST_CAPS
gstpad.c:2704:gst_pad_has_current_caps:<jpegparse0:src> check current pad
caps image/jpeg, parsed=(boolean)true, format=(string)UYVY,
width=(int)1920, height=(int)1080, framerate=(fraction)60/1
0:00:00.896551791   969 0xaaaaffae0940 WARN                 basesrc
gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: Internal data stream
error.
0:00:00.896620163   969 0xaaaaffae0940 WARN                 basesrc
gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: streaming stopped,
reason not-negotiated (-4)
0:00:00.896859405   969 0xaaaaffae0940 ERROR           videodecoder
gstvideodecoder.c:1141:gst_video_decoder_sink_event_default:<v4l2jpegdec0>
No valid frames decoded before end of stream

On Tue, Jul 5, 2022 at 3:19 PM Marianna Smidth Buschle <msb at qtec.com> wrote:

> Try running with '-v' and/or '--gst-debug=*:3,GST_CAPS:5' in order to
> inspect the CAPS and try to see where it is failing.
>
> Alternatively try reducing the pipeline to see if you can pinpoint which
> part is failing and why:
>
> gst-launch-1.0 v4l2src device=/dev/video2 ! jpegparse ! fakesink -v
> --gst-debug=*:3,GST_CAPS:5
> gst-launch-1.0 v4l2src device=/dev/video2 ! jpegparse ! v4l2jpegdec !
> fakesink -v --gst-debug=*:3,GST_CAPS:5
> gst-launch-1.0 v4l2src device=/dev/video2 ! jpegparse ! v4l2jpegdec !
> videoconvert ! v4l2h264enc ! fakesink -v --gst-debug=*:3,GST_CAPS:5
>
> ...
>
> Best Regards
> Marianna
>
> On 05.07.2022 14.03, gstreamer-devel-request at lists.freedesktop.org wrote:
> > Hi,
> >
> > I'm running gstreamer on an i.MX8QM with H264 and JPEG HW
> > encoding/decoding. My end goal is to process two MJPEG streams from two
> > different USB cameras, do some light processing in OpenCV and then encode
> > it in H264. My first step was to simply create a gstreamer pipeline to
> > transcode the frames coming from the camera into H264 and write them to a
> > file. Small proof-of-concept. However, I'm running into issues linking
> > the v4l2jpegdec v4l2h264enc elements.  This is the pipeline I'm using
> (it's
> > taken from NXP's official user guide on using i.MX8 with GStreamer [1]).
> > Have tried a lot of variations, but the results (even with detailed
> > logging) have looked very similar:
> >
> > gst-launch-1.0 v4l2src device=/dev/video2 ! jpegparse ! v4l2jpegdec !
> queue
> > ! videoconvert ! v4l2h264enc ! h264parse ! matroskamux ! filesink
> > location=out.mkv
> >
> > And this is the output I'm getting:
> > Setting pipeline to PAUSED ...
> > Pipeline is live and does not need PREROLL ...
> > Setting pipeline to PLAYING ...
> > New clock: GstSystemClock
> > ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal
> > data stream error.
> > Additional debug info:
> > ../git/libs/gst/base/gstbasesrc.c(3072): gst_base_src_loop ():
> > /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
> > streaming stopped, reason not-negotiated (-4)
> >
> > I have a 7MB log file obtained by running GST_DEBUG_LEVEL=6, but I'm not
> > sure if the correct etiquette is to attach it to this email. I've also
> > tried using caps filtering and used gst-inspect to make sure the src of
> the
> > jpegdecoder matches the sink of the h264 encoder. Not looking for a
> > straight response, but a few hints on where I can look next, as I'm
> feeling
> > a bit lost.
> >
> > Also, since my goal is to have the OpenCV app between the MJPEG decoder
> and
> > the H264 encoder, should I just abandon the goal of having a manual
> > pipeline working first and simply start testing straight with the
> > application?
> >
> > Thirdly, is it feasible to expect the i.MX8QM to be able to decode the
> > streams from two MJPEG cameras (1080p at 60FPS), combine them and then
> encode
> > the result using H264? Or do I need a different processor?
> >
> > Thank you!
> >
> > [1]
> >
> https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8-GStreamer-User-Guide/ta-p/1098942
>
> --
> Best regards / Med venlig hilsen
> “Marianna Smidth Buschle”
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220707/d3eaaeb2/attachment-0001.htm>


More information about the gstreamer-devel mailing list