Hi,
I’m trying to create an issue on the gstreamer GitLab.
When I press “Create issue” I get this message:
I would love to solve the reCAPTCHA but no captcha is shown to me at all .
Here is my issue description:
Wrong output buffer size allocated in bayer2rgb
Describe your issue
Running this pipeline in GStreamer 1.24:
videotestsrc ! video/x-bayer,width=1280,height=800,format=grbg ! bayer2rgb ! video/x-raw,format=RGBA,width=1280,height=800 ! fakesink silent=false
I get the following warning & error for every frame:
0:00:00.805114295 189344 0xffffa0000b70 ERROR default video-frame.c:181:gst_video_frame_map_id: invalid buffer size 1024000 < 4096000
0:00:00.805197791 189344 0xffffa0000b70 WARN bayer2rgb gstbayer2rgb.c:789:gst_bayer2rgb_transform:<bayer2rgb0> Could not map buffer, skipping
With GStreamer 1.22, there were no warnings / errors.
(I used v4l2src for testing on 1.22 as there was no support for bayer formats in videotestsrc in that version)
I think the issue is caused by this change:
The calculation of the output buffer size resulted in 4 * width * height
before the change which is correct for the supported 4-bytes-per-pixel output-formats (RGBA, RGBx, BGRA, …).
After the change, the calculated buffer size is just width * height
(for 8 bits per pixel).
This causes the allocated output buffer to be smaller than required and expected by gst_video_frame_map
.
Expected Behavior
The bayer2rgb
element should allocate the correct output buffer size.
Observed Behavior
The bayer2rgb
element allocates too small output buffers and afterwards fails to map them. This results in no conversion being done and black frames being returned.
Setup
- Operating System: Ubuntu 24.04
- Device: x86 computer
- GStreamer Version: 1.24.2
- Command line:
GST_DEBUG=3 gst-launch-1.0 -ve videotestsrc ! video/x-bayer,width=1280,height=800,format=grbg ! bayer2rgb ! video/x-raw,format=RGBA,width=1280,height=800 ! fakesink silent=false
Steps to reproduce the bug
Run the given command line on GStreamer version >= 1.24.
How reproducible is the bug?
Always
Solutions you have tried
Adding an additional videoconvert
fixes the issue:
videotestsrc ! video/x-bayer,width=1280,height=800,format=grbg ! bayer2rgb ! video/x-raw,format=RGBA,width=1280,height=800 ! videoconvert ! video/x-raw,format=BGRA,width=1280,height=800 ! fakesink silent=false
Using this pipeline, the output buffers for the bayer2rgb element seem to be allocated by the following videoconvert element which calculates the buffer size correctly.
However, the additional conversion from RGBA to BGRA impairs the performance of the pipeline.
Any idea why GitLab rejects it or how I can prove that this isn’t spam ?
Best regards,
Mathis