<v4l2src0> lost frames detected

Nicolas Dufresne nicolas at ndufresne.ca
Mon Jun 22 19:25:02 UTC 2020


Le lundi 22 juin 2020 à 12:35 -0500, Aniket0987 a écrit :
> Hi Nicolas, 
> Thanks for the reply.
> I've tried removing do-timestamp and jpegparse. I've also added drop-only
> property for videorate. Things are now working fine for 5 fps. No lost
> frames detected warning and things work fine. However, when I switch to 30
> fps. I start getting following after 8-9 minutes.
> 
> 0:10:02.477399906  2534  0x183ecc0 WARN            videodecoder gstvideodecoder.c:4136:_gst_video_decoder_error:<jpegdec0> error: Failed to
> decode JPEG image
> 0:10:02.477503386  2534  0x183ecc0 WARN            videodecoder gstvideodecoder.c:4138:_gst_video_decoder_error:<jpegdec0> error: Decode error #53: Not a JPEG file: starts with 0x0f 0x34
> 0:10:02.477808862  2534  0x183ecc0 DEBUG                v4l2src gstv4l2src.c:925:gst_v4l2src_create:<v4l2src0> ts: 1:30:18.919096000 now 1:30:18.941779324 delay 0:00:00.022683324
> 0:10:02.477902305  2534  0x183ecc0 INFO                 v4l2src gstv4l2src.c:961:gst_v4l2src_create:<v4l2src0> sync to 0:05:04.533330288 out ts 0:10:01.930956297
> 0:10:02.477975748  2534  0x183ecc0 WARN                 v4l2src gstv4l2src.c:980:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:10:01.930956297
> 
> Could this be due to removal of jpegparse?

The driver has been giving you a corrupted JPEG. Imho, for compressed image, UVC
driver should report the error but not return the corrupted buffer. But eh,
drivers have bugs, just like userspace do.

Now, let's see if this corrupted buffer is minimally reported by the driver. If
it is, v4l2src will produce buffers with the GST_BUFFER_FLAG_CORRUPTED flag set,
and that can be dropped using identity.

  v4l2src ! identity drop-buffer-flags=corrupted ! jpegedec ! ...

It's better to drop as jpegdec can be pretty fragile. It won't make the lost
frame go away. It's not clear if your camera queue goes full, or if some
firmware error happens (corrupted frames) and then the drops are just caused by
a HW reset. You would have to investigate at a kernel level at this point.

Nicolas



More information about the gstreamer-devel mailing list