After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791385 - RGB24: Broken behavior with non multiple of 4 frame width
RGB24: Broken behavior with non multiple of 4 frame width
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-08 10:12 UTC by Dimitrios Katsaros
Modified: 2018-02-09 10:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
working image (3.00 MB, application/octet-stream)
2017-12-08 10:12 UTC, Dimitrios Katsaros
Details
Broken image (2.99 MB, application/octet-stream)
2017-12-08 10:12 UTC, Dimitrios Katsaros
Details

Description Dimitrios Katsaros 2017-12-08 10:12:00 UTC
I have been testing some video capture hardware using v4l2src. One of the devices I am working with can capture in non multiple of 4 widths. While testing I noticed that RGB24 on a non *4 width, e.g. 1022, would cause the frame to break. After some further investigation and testing I discovered that if you input an RGB24 image with an odd format it would break the pipeline. I would guess that the pipeline is expecting the video to be padded. Below is an example, I am providing the reference images:

this works:
gst-launch-1.0 multifilesrc  location=1024x1024_rgb24_works ! rawvideoparse  format=rgb  width=1024 height=1024 ! videoconvert  ! ximagesink

this breaks:
gst-launch-1.0 multifilesrc  location=1022x1024_rgb24_breaks ! rawvideoparse  format=rgb  width=1022 height=1024 plane-strides='<3072>' ! videoconvert  ! ximagesink

For v4l2src I am doing the following:
gst-launch-1.0 v4l2src device=/dev/video1 io-mode=1 ! video/x-raw,format=RGB,width=1022,height=1024 ! videoconvert ! ximagesink

For io-mode RW and Usrptr the pipeline is broken, for mmap the pipeline functions as intended.
Comment 1 Dimitrios Katsaros 2017-12-08 10:12:29 UTC
Created attachment 365233 [details]
working image
Comment 2 Dimitrios Katsaros 2017-12-08 10:12:52 UTC
Created attachment 365234 [details]
Broken image
Comment 3 Dimitrios Katsaros 2017-12-08 10:13:49 UTC
You can validate the images by adding a PPM header to them.

"P6 1022 1024 255" for the broken image
"P6 1024 1024 255" for the working one
Comment 4 Dimitrios Katsaros 2017-12-08 10:20:18 UTC
Also playing around with the "plane-strides" property doesn't seem to fix it. not setting the stride makes the misiglinment happen more rapidly, while putting 3066(1024*3) makes videoconvert produce this warning:


WARNING: from element /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: Internal GStreamer error: code not implemented.  Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Additional debug info:
../../../../git/gst-libs/gst/video/gstvideofilter.c(289): gst_video_filter_transform (): /GstPipeline:pipeline0/GstVideoConvert:videoconvert0:
invalid video buffer received
Comment 5 Tim-Philipp Müller 2018-01-30 17:52:20 UTC
What version are you using?

This, with stride 3066, works just fine for me with 1.12.4 and git master.

gst-launch-1.0 multifilesrc  location=1022x1024_rgb24_breaks ! rawvideoparse  format=rgb  width=1022 height=1024 plane-strides='<3066>' ! videoconvert  ! xvimagesink
Comment 6 Dimitrios Katsaros 2018-02-09 10:43:43 UTC
I was using 1.12.0. Testing with 1.13.x seems to work fine. Invalidating the ticket.