GNOME Bugzilla – Bug 769797
videoparse: format i420, invalid buffer size (regression)
Last modified: 2016-08-18 06:23:23 UTC
The following pipeline with gst-plugins-bad 1.8.2 works fine gst-launch-1.0 filesrc location=foreman_cif.yuv ! videoparse height=288 width=352 framerate=25/1 ! xvimagesink If I install gst-plugins-bad 1.9.1 then it works not so fine. ERROR default video-frame.c:175:gst_video_frame_map_id: invalid buffer size 119040 < 152064 ERROR default video-frame.c:175:gst_video_frame_map_id: invalid buffer size 119040 < 152064 ERROR default video-frame.c:175:gst_video_frame_map_id: invalid buffer size 119040 < 152064 ERROR default video-frame.c:175:gst_video_frame_map_id: invalid buffer size 119040 < 152064 and so on... The foreman_cif.yuv file you can download from https://media.xiph.org/video/derf/
It's also still a problem with the new rawvideoparse in GIT master.
Sounds like a regression, marking as blocker.
The problem is that the plane offsets and strides are only set initially in gst_raw_video_parse_init_config() and would be updated from caps or property. But they are not updated when e.g. changing the width/height. gst_raw_video_parse_update_info() is then using the 320x240 I420 values, which gives us the wrong results.
gst_raw_video_parse_update_info() also assumes that the last plane is the physically last one. For YV12 that's not necessarily true (V comes before U).
Should've been introduced by https://bugzilla.gnome.org/show_bug.cgi?id=760270
Created attachment 333376 [details] [review] Compute plane strides&offsets if no custom ones are set (In reply to Sebastian Dröge (slomo) from comment #4) > gst_raw_video_parse_update_info() also assumes that the last plane is the > physically last one. For YV12 that's not necessarily true (V comes before U). This patch fixes the reported problems, except this detail. I currently do not know how would I get the physically last plane. Any ideas?
Also, once this issue is resolved, we should apply https://bugzilla.gnome.org/show_bug.cgi?id=769637 as well. Its second hunk will need an update due to the new test, but this is an easy fix.
(In reply to Carlos Rafael Giani from comment #6) > Created attachment 333376 [details] [review] [review] > Compute plane strides&offsets if no custom ones are set > > (In reply to Sebastian Dröge (slomo) from comment #4) > > gst_raw_video_parse_update_info() also assumes that the last plane is the > > physically last one. For YV12 that's not necessarily true (V comes before U). > > This patch fixes the reported problems, except this detail. I currently do > not know how would I get the physically last plane. Any ideas? The old code in videoparse did that. It iterated over all planes and remembered the physically last one. Also looking at gst_video_frame_copy() might be useful
Created attachment 333393 [details] [review] Compute plane strides&offsets if no custom ones are set v2 Here is the updated patch with the last plane offset change.
commit 91cf5ac69f9c99fe41d60f42b4174915dd135e7b Author: Carlos Rafael Giani <dv@pseudoterminal.org> Date: Tue Aug 16 09:31:40 2016 +0200 rawvideoparse: Compute plane offsets & strides if no custom ones are set This is useful to ensure that the offsets and strides are computed if only width, height, format etc. in the property config are set. https://bugzilla.gnome.org/show_bug.cgi?id=769797