h264parse causes v4l2src warnings flood
Describe your issue
Recently v4l2src/v4l2bufferpool was modified to detect when buffers where re-queued while still "used", so now when you have a h264 usb camera and insert h264parse after v4l2src you get a continuous flood of warnings:
v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 1 is not free
Probably h264parse keeps a reference of some data from input buffers (codec_data?) for a long time, while v4l2src usually use 2 or 4 internal buffers from the allocator, and this causes it to re-use buffers still marked as used.
Expected Behavior
No warnings from v4l2bufferpool.
Observed Behavior
Warnings flood from v4l2bufferpool.
Setup
- Operating System: Fedora 35
- Device: Computer
- GStreamer Version: 1.20.0 (1.20.1 has the same problem)
- Command line: gst-launch-1.0 -ve --gst-debug-level=2 v4l2src device=/dev/video4 io-mode=2 ! h264parse config-interval=-1 ! fakesink silent=true
Steps to reproduce the bug
gst-launch-1.0 -ve --gst-debug-level=2 v4l2src device=/dev/video4 io-mode=2 ! h264parse config-interval=-1 ! fakesink silent=true
How reproducible is the bug?
Always
Screenshots if relevant
Solutions you have tried
Related non-duplicate issues
Additional Information
Impostazione della pipeline a PAUSED ...
La pipeline è viva e non necessita il PREROLL ...
La pipeline è in PREROLLED ...
Impostazione della pipeline a PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1, parsed=(boolean)true
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1, parsed=(boolean)true
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1
0:00:00.703358547 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:842:gst_v4l2_buffer_pool_start:v4l2src0:pool0:src Uncertain or not enough buffers, enabling copy threshold
0:00:01.441193098 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 0 is not free
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, profile=(string)main, level=(string)4.1
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)2:4:5:1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, profile=(string)main, level=(string)4.1
Ridistribuzione latenza...
0:00:01.473093395 90007 0x561ae084e760 WARN v4l2src gstv4l2src.c:1123:gst_v4l2src_create: lost frames detected: count = 1 - ts: 0:00:00.768484822
0:00:01.473299319 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 1 is not free
0:00:01.505234606 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 2 is not free
0:00:01.541372974 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 3 is not free
0:00:01.573066147 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 0 is not free
0:00:01.605399409 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 1 is not free
0:00:01.641357457 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 2 is not free
0:00:01.673262469 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 3 is not free
0:00:01.705317422 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 0 is not free
0:00:01.741053388 90007 0x561ae084e760 WARN v4l2bufferpool gstv4l2bufferpool.c:477:gst_v4l2_buffer_pool_alloc_buffer:v4l2src0:pool0:src newly allocated buffer 1 is not free