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 684991 - videobox: sometimes incorrectly crops producing visual artifacts, and green instead of black border
videobox: sometimes incorrectly crops producing visual artifacts, and green i...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.0.0
Other Linux
: Normal normal
: 1.0.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-27 18:07 UTC by Stirling Westrup
Modified: 2012-12-03 19:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stirling Westrup 2012-09-27 18:07:23 UTC
I was unable to capture a screenshot, but the following gst-launch invocation consistently produces a video where the top (black) border quickly fills with color, a region the same height as the top border and directly below it becomes stripey, and the entire video color scheme goes off.

gst-launch-1.0 filesrc location=~/Videos/TimeScapes4K2560p.mp4 ! decodebin ! videobox top=-110 bottom=901 right=961 left=961 ! xvimagesink


The video in question is a freely available QuadHD teaser video, which may, or may not, have something to do with the cause of the bug. It can be downloaded here:

http://red.cachefly.net/TimeScapes4K2560p.mp4
Comment 1 Tim-Philipp Müller 2012-11-24 19:37:08 UTC
This works fine for me now after fixing the border fill colour. There have been some other commits since you filed this bug, which have probably taken care of the other issue (which sounds stride-related):

commit efaa80fbc6700e2f02cbac3a5f8b66e24cdab934
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Sat Nov 24 19:32:51 2012 +0000

    videobox: fix border filling for planar YUV formats
    
    We would get a green border instead of a black one, for
    example.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684991

commit 3ef7c8ab93fade5ab5a0410d6ab3ec580f3e3656
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Wed Oct 17 09:36:50 2012 +0200

    videobox: use out_info for out properties

commit 63716151ef873cb992718c409a327fcf50705683
Author: Michael Smith <msmith@rdio.com>
Date:   Tue Sep 18 10:34:03 2012 -0700

    videobox: Fix U/V strides for a number of cases.
Comment 2 Stirling Westrup 2012-11-26 04:26:08 UTC
Testing videobox with GStreamer 1.0.2, I do see major improvements, but there are still use cases I have that show strange cropping artifacts. One example I just ran across is this:

gst-launch-1.0 filesrc location=~/Videos/BigBuckBunny1080p.avi ! decodebin ! videobox top=0 bottom=540 right=959 left=-2 ! xvimagesink

This produces a color-distorted image with diagonal stripes of bright color across the image. My debug dump shows that I420 is the image format being cropped.

Here is an ffprobe of my copy of BigBuckBunny, in case that is useful:

Input #0, avi, from '~/Videos/BigBuckBunny1080p.avi':
  Metadata:
    encoder         : AVI-Mux GUI 1.17.7, Aug  8 2006  20:59:17
    JUNK            : 
  Duration: 00:09:56.45, start: 0.000000, bitrate: 12455 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 24 tbr, 24 tbn, 24 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), s16, 448 kb/s


Big Buck Bunny can be freely downloaded here, if you don't already have a copy.
http://www.bigbuckbunny.org/index.php/download/
Comment 3 Stirling Westrup 2012-11-26 04:37:55 UTC
... and now I found a use case that actually crashes videobox with a segmentation fault:

Same video, cropping Left:27, Right:995, Top:575, Bottom:0
Comment 4 Tim-Philipp Müller 2012-11-26 14:44:46 UTC
I should add that my commit not only fixed the colour, but also possibly invalid memory access (memset for u/v planes was done with double the number of bytes and might hence write beyond the end of the allocate image).
Comment 5 Tim-Philipp Müller 2012-12-02 16:03:48 UTC
I have re-tested that bigbuckbunny clip with the pipeline and configurations you mentioned, and it works fine for me now. It's also valgrind-clean, so I think the issues you were seeing were caused by the invalid memory access that I fixed.

Closing again. Please re-open if you still have problems with git master or 1.0.4, once it's out. (It is possible to build the GStreamer stack in an uninstalled setup for testing purposes, for what it's worth).
Comment 6 Stirling Westrup 2012-12-03 15:56:41 UTC
I built the latest GStreamer from Git over the weekend and ran some tests, and was still able to get video corruption, green borders, and even crashes with videobox. I'll try to comment with some specific examples today.
Comment 7 Tim-Philipp Müller 2012-12-03 16:02:23 UTC
Hrm, ok.

Maybe you could provide some valgrind logs (with G_SLICE=always-malloc)?
Comment 8 Stirling Westrup 2012-12-03 18:51:44 UTC
I spent the morning building the lastest GStreamer from git and narrowing down the parameters which caused video corruption and/or segfaults.

To my surprise, it turned out it WASN'T videocrop or videobox that were the culprits, but xvimagesink. It seems that when it decides to rescale a video to a window, sometimes it fails spectacularly.

So, you can close this bug, and I will go and post a bug against xvimagesink.
Comment 9 Tim-Philipp Müller 2012-12-03 19:24:29 UTC
Cool, thanks.