GNOME Bugzilla – Bug 569611
GStreamer videobox element draws thin green lines on edge of yuv video
Last modified: 2009-05-04 09:28:42 UTC
Please describe the problem: When the width of the bottom or right border is odd, videobox outputs video with a thin green line on the bottom or right hand edge of the video stream. Steps to reproduce: 1. I've only recreated it in a complicated system we have here. But you can recreate it this way: 2. Size a test video to 299 x 480. Note that the video MUST be yuv format. 3. Use videobox to add a top border of 90 pixels and a bottom border of 91 pixels. 4. Pass the video into some kind of viewer. Actual results: A thin green line appears on the bottom edge of the output. If you look closely there is a slightly green line above that also. Expected results: The border color (default black) should extend all the way down to the bottom of the video. Does this happen every time? Yes. Other information: The bug occurs because the last plane fills for u and v, on the right or bottom of the image, are not completed properly if the width is odd. This leaves 0's in the last row and column which leaves us with the characteristic green associated with yuv chrominance values of 0. Adding these lines to videobox.c right after the first call to gst_video_box_copy_plane_i420() will fix the problem: /* The right and bottom borders must be adjusted so that the the u and v planes */ /* are filled completely. If we don't do this, little green stripes sneak in. */ if( br / 2 < out_width / 2 - crop_width / 2 - bl / 2 ) br++; if( bb / 2 < out_height / 2 - crop_height / 2 - bt / 2 ) bb++; There's probably a nice gstreamer way of doing this, but it works for me. Note that you can't combine the divides otherwise you will just end up in a different broken place.
In step 2, I meant 640 x 299. With the top and bottom borders of 90 and 91 this will make a 640 x 480 stream.
commit 9ea2c113bacfe8d13d0c6e4fd479cd2b1ca6c6f1 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Mon May 4 11:26:56 2009 +0200 videobox: draw the complete U and V planes Round up the scaled U and V width and height so that we always draw the correct amount of pixels to fill the complete image. Fixes #569611