Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gst-plugins-bad gst-plugins-bad
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 973
    • Issues 973
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 103
    • Merge requests 103
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamerGStreamer
  • gst-plugins-badgst-plugins-bad
  • Issues
  • #1531
Closed
Open
Issue created Feb 18, 2021 by Marianna Smidth Buschle@msb.qtec

v4l2src: CAPS not being updated

Our camera doesn't support odd frame width or height. Our driver auto adjusts to the nearest option: fx height=1079->1080.

However gstreamer doesn't seem to be notified of this change, so it still reports the CAPS with the original width or height.

root@qt5122:~# GST_DEBUG="*:3" gst-launch-1.0 v4l2src io-mode=2 hw-center-crop=true device=/dev/qt5023_video0 num-buffers=30 ! "video/x-raw,width=1920,height=1079,format=NV12,framerate=30/1" ! fakesink -v
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1079, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1079, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1079, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1079, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
Got EOS from element "pipeline0".
Execution ended after 0:00:01.058133202
Setting pipeline to NULL ...
Freeing pipeline ...

It also seems to cause some allocation errors: fx when width=1921->1922, because it doesn't allocate enough memory.

root@qt5122:~# GST_DEBUG="*:3" gst-launch-1.0 v4l2src io-mode=2 hw-center-crop=true device=/dev/qt5023_video0 num-buffers=30 ! "video/x-raw,width=1921,height=1080,format=NV12,framerate=30/1" ! fakesink -v
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1921, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1921, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw, width=(int)1921, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1921, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt709
0:00:00.150126298   807 0x559c1b410770 ERROR                default video-frame.c:181:gst_video_frame_map_id: invalid buffer size 3113640 < 3116880
0:00:00.150228334   807 0x559c1b410770 ERROR         v4l2bufferpool gstv4l2bufferpool.c:162:gst_v4l2_buffer_pool_copy_buffer:<v4l2src0:pool0:src> could not map buffer
0:00:00.150264239   807 0x559c1b410770 ERROR         v4l2bufferpool gstv4l2bufferpool.c:2078:gst_v4l2_buffer_pool_process:<v4l2src0:pool0:src> failed to copy buffer
0:00:00.150324154   807 0x559c1b410770 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:00.150344681   807 0x559c1b410770 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../gstreamer-1.18.2/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason error (-5)
Execution ended after 0:00:00.090777396
Setting pipeline to NULL ...
Freeing pipeline ...
Assignee
Assign to
Time tracking