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 683142 - h264parse: should proxy demuxer width+height (incorrectly reports Canon MOV resolution as 1920x1088 instead of 1920x1080)
h264parse: should proxy demuxer width+height (incorrectly reports Canon MOV r...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal major
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-31 23:00 UTC by Jason Gerard DeRose
Modified: 2013-07-24 08:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pipeline without -bad (143.97 KB, image/png)
2012-08-31 23:01 UTC, Jason Gerard DeRose
Details
pipeline with -bad (184.22 KB, image/png)
2012-08-31 23:02 UTC, Jason Gerard DeRose
Details

Description Jason Gerard DeRose 2012-08-31 23:00:16 UTC
If you only have gstreamer1.0-libav installed, you get the correct 1920x1080 resolution.

However, if you also have gstreamer1.0-plugins-bad installed, the h264parse element gets used, which is broken and results in the incorrect 1920x1088 resolution.

Small test file (21 MB, md5 dd6c7f44d666962058343f0732aae509):

http://cdn.novacut.com/MVI_5751.MOV

There was a similar bug in libav that would give height=1088 even when the bad plugins weren't installed. But this has since been fixed in Quantal:

https://bugs.launchpad.net/ubuntu/+source/libav/+bug/937561
Comment 1 Jason Gerard DeRose 2012-08-31 23:01:38 UTC
Created attachment 223112 [details]
pipeline without -bad
Comment 2 Jason Gerard DeRose 2012-08-31 23:02:03 UTC
Created attachment 223113 [details]
pipeline with -bad
Comment 3 Tim-Philipp Müller 2012-10-21 16:32:17 UTC
Still an issue with 1.0.x git. The parser needs to proxy the width/height received from the demuxer, which indicates the resolution to crop to.

GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, ... width=(int)1920, height=(int)1080, ...
avdec_h264:avdec_h264-0.GstPad:sink: caps = video/x-h264, ... width=(int)1920, height=(int)1088, ...
Comment 4 Wim Taymans 2012-12-13 13:15:55 UTC
commit 0e0dd05fd645b32a10b5d5da74f2feb67010ec87
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Thu Dec 13 14:12:52 2012 +0100

    h264parse: use upstream width/height when given
    
    The upstream width and height should override the dimension detected in the
    file.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=683142
Comment 5 Sebastian Dröge (slomo) 2012-12-13 14:10:45 UTC
I don't think this is the right approach for this, especially not without sanity-checking the upstream width/height (also do decoders take the upstream width/height at all?). Would probably be better to let the demuxer put crop metadata on the buffers or something like that.
Comment 6 Tim-Philipp Müller 2012-12-13 19:26:56 UTC
IMHO,

 - sanity checking upstream width/height is "nice", but not really super-important

 - decoders *should* take the provided upstream size and crop (there's a bug about that I think)

 - the commit is needed either way, even if we add crop metadata as well, because:

 - the width/height in the caps should always reflect the effective width/height after cropping. This is the case with videocrop even when using crop meta (hopefully!), and should be the case here as well.

I'm not sure what the crop meta adds in this context, or how it would work exactly.
Comment 7 Sebastian Dröge (slomo) 2012-12-17 09:11:18 UTC
(In reply to comment #6)
> IMHO,
> 
>  - sanity checking upstream width/height is "nice", but not really
> super-important

I wouldn't be surprised if we can produce crashes downstream if a larger width/height than actually present is given in the caps

>  - decoders *should* take the provided upstream size and crop (there's a bug
> about that I think)

Yes, where I gave the same argument ;)

>  - the commit is needed either way, even if we add crop metadata as well,
> because:
> 
>  - the width/height in the caps should always reflect the effective
> width/height after cropping. This is the case with videocrop even when using
> crop meta (hopefully!), and should be the case here as well.

Correct, but the reason why I don't think that just changing the width/height is a good idea is that it's ambigious. With the crop metadata you know which x/y offset and which width/height should be used, with only a different width/height in the caps you don't know anything about that.


I guess something similar to the libav change could be allowed though. Just allowing a width/height that is smaller and that would result in the same number of macro blocks.
Comment 8 Tim-Philipp Müller 2012-12-30 22:58:07 UTC
Ok, so basically we agree that the commit is fine, we just need:

  a) more sanity checking, and

  b) optional crop meta in the (unlikely?) case cropping does not take place at bottom+right ?

Do you have an example codec/case where the usual crop off at bottom/right does not apply?
Comment 9 Sebastian Dröge (slomo) 2012-12-31 07:44:55 UTC
MXF has support for this, in theory JPEG2000 but decoders are already cropping (and don't allow zerocopy).
Comment 10 Tim-Philipp Müller 2013-01-17 16:03:56 UTC
Ok, so to me it seems this is primarily a demuxer/decoder issue then, and we should close this bug, since the original issue has been fixed. The non-0/0 offset cropping is a new feature to be implemented all over the place.
Comment 11 Edward Hervey 2013-07-24 08:07:53 UTC
Yes, closing bug.