[Bug 796714] v4l2: add min-buffers properties

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Jun 29 12:15:52 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=796714

--- Comment #6 from Peter Seiderer <ps.report at gmx.net> ---
(In reply to Nicolas Dufresne (ndufresne) from comment #2)
> My usual answer is no for that feature. You may want to file a bug with the
> actual situation were you have buffer starvation, and only if that cannot be
> resolved by fixing the allocation query implementation then maybe, but that
> has never happen.

Use case is to reduce frame drops while using gst-launch pipelines (on i.mx6
you need the following kernel patches [1], [2] to enable gstreamer frame drop
detection), e.g. (17 frame dropee in 1.3 seconds):


    $ GST_DEBUG=*:3 gst-launch-1.0 -v v4l2src
device=/dev/v4l/by-path/platform-capture-subsystem-video-index4 io-mode=dmabuf
! \
        video/x-raw,format=YUY2,width=1920,height=1080,framerate=60000/1001 ! \
        kmssink connector-id=47
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 0
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 0
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw,
format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw,
format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
0:00:01.230732333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2
- ts: 0:00:00.272967653
0:00:01.330239333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.339703987
0:00:01.364204000  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2
- ts: 0:00:00.406437653
0:00:01.430929000  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.473165987
0:00:01.497655333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.539894653
0:00:01.564386000  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.606622987
0:00:01.631112333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.673351987
0:00:01.697845666  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.740082653
0:00:01.764580333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.806809653
0:00:01.831302333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.873539987
0:00:01.898026333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.940269320
0:00:01.964755000  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:01.006997653
0:00:02.031484667  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:01.073726653
0:00:02.098214333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:01.140456653
0:00:02.164946333  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:01.207185986
0:00:02.231672667  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:01.273914653
0:00:02.298400667  4124  0x17dc380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:01.340644653
[...]


With e.g. min-buffers=5 frame drops are reduced (17 frame drops in 21 seconds):

    $ GST_DEBUG=*:3 gst-launch-1.0 -v v4l2src
device=/dev/v4l/by-path/platform-capture-subsystem-video-index4 min-buffers=5
io-mode=dmabuf ! \
        video/x-raw,format=YUY2,width=1920,height=1080,framerate=60000/1001 ! \
        kmssink connector-id=47
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 0
/GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 0
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw,
format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw,
format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080,
framerate=(fraction)60000/1001, colorimetry=(string)bt709,
interlace-mode=(string)progressive
0:00:01.254071333  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:00.286977643
0:00:03.854201333  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:02.889443976
0:00:03.937533000  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:02.972848310
0:00:04.020857000  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:03.056261977
0:00:04.104186667  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:03.139665976
0:00:04.187511000  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:03.223086977
0:00:04.270874667  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:03.306574976
0:00:04.354201000  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:03.389895976
0:00:04.437528000  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:03.473351976
0:00:20.554175669  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:19.588418310
0:00:21.687521002  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:20.722823976
0:00:21.770856336  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:20.806232977
0:00:21.854190002  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:20.889637310
0:00:21.937511002  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:20.973050310
0:00:22.020899669  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:21.056469310
0:00:22.104184336  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:21.139869976
0:00:22.187528336  4131   0xa99380 WARN                 v4l2src
gstv4l2src.c:968:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1
- ts: 0:00:21.223287309
[...]


[1] https://patchwork.linuxtv.org/patch/47946/
[2] https://patchwork.linuxtv.org/patch/47947/

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list