GNOME Bugzilla – Bug 791385
RGB24: Broken behavior with non multiple of 4 frame width
Last modified: 2018-02-09 10:43:43 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.
Created attachment 365233 [details] working image
Created attachment 365234 [details] Broken image
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
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
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
I was using 1.12.0. Testing with 1.13.x seems to work fine. Invalidating the ticket.