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 574461 - mpeg2dec: Lower rank and make avdec_mpeg2video PRIMARY
mpeg2dec: Lower rank and make avdec_mpeg2video PRIMARY
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Linux
: Normal enhancement
: 1.7.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-07 10:47 UTC by Sebastian Dröge (slomo)
Modified: 2016-01-21 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2009-03-07 10:47:52 UTC
Hi,
we should lower the rank of mpeg2dec and make ffdec_mpeg2video PRIMARY as it's much faster and I'm not aware of any issues with it.

Comments? :)
Comment 1 Edward Hervey 2009-03-07 10:49:54 UTC
In addition to being faster, it does direct-rendering in all cases, whereas mpeg2dec will only do it if the output width/height are multiples of 16 (basically this breaks for all HD content with a height of 1080 (mpeg2dec will decode internally to a height of 1088).
Comment 2 Tim-Philipp Müller 2009-03-07 10:51:23 UTC
> Comments? :)

Let's do that *after* the releases, not five minutes before we release .. 

Comment 3 Jan Schmidt 2009-03-09 23:22:20 UTC
Agree with Tim. Removing blocker flag
Comment 4 Sebastian Dröge (slomo) 2009-05-12 08:59:40 UTC
Maybe we can do this now? If nobody has arguments against this I'll do it :)
Comment 5 Edward Hervey 2009-05-12 09:12:37 UTC
100% ok with me !
Comment 6 Sebastian Dröge (slomo) 2009-05-12 09:21:43 UTC
commit 40c87181c5e9289c43ace1ceeca1b064755a4151
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue May 12 11:19:00 2009 +0200

    mpeg2dec: Lower rank to MARGINAL to make ffdec_mpeg2video the default
    
    ffdec_mpeg2video is much faster, fixes bug #574461.


commit 2dd5e8f983e09b5a5d2977aa1cfad9f5cdb7e2ab
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Tue May 12 11:20:08 2009 +0200

    ffdec: Update rank of ffdec_mpeg2video to SECONDARY to make it the default
    
    ffdec_mpeg2video is much faster, fixes bug #574461.
Comment 7 Edward Hervey 2009-05-13 15:11:28 UTC
This might have been a bad idea in the end:

* on amd64 I'm seeing ffdec_mpeg2video being 10-20% slower than mpeg2dec (on any video size)
* the interlaced format handling in ffmpeg is bad/poor
* the colorspace isn't properly respected (it clamps the values)
* the timestamping is a mess in ffmpeg to say the least (EVEN after the X-th attempt at fixing it in gst-ffmpeg)
* mpeg2dec *HAS* a documented exhaustive API
* mpeg2dec has always been more resilient to errors.


Shoot me, we need to revert the situation... NOW !
Comment 8 Edward Hervey 2009-05-13 17:35:32 UTC
commit 83bf3a9f37f4a5d3f56a727db19fb668d8482408
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Wed May 13 19:32:16 2009 +0200

    mpeg2dec: Revert ranking switch with ffdec_mpeg2video. Fixes #574461


commit 9fdc5a5d64cd7fd71d1bd568423b24c56461eacb
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Wed May 13 19:35:32 2009 +0200

    gstffmpegdec: demote mpeg2 video decoding back to MARGINAL. Fixes #574461

Comment 9 Mart Raudsepp 2011-12-07 01:07:37 UTC
Reopening because we never got to track down any of the issues then to be able to swap mpeg2dec and ffdec_mpeg2video ranks, with no open bugs to track this. libmpeg2 is not really maintained at all, so I believe we need some parties to step up and maintain it, or get the maintained backing code ffdec_mpeg2video preferred at least.
Comment 10 Sebastian Dröge (slomo) 2013-07-17 12:19:27 UTC
Edward, any news on this?
Comment 11 Edward Hervey 2013-07-17 13:00:17 UTC
Still requires investigation :( quite a few issues from comment 7 still apply.
Comment 12 Edward Hervey 2013-07-28 13:25:22 UTC
Yah, we really should switch back to having the libav decoder as PRIMARY. libmpeg2 hasn't been maintained in ... 7 years :(

Items to check before switching:

(In reply to comment #7)
> * on amd64 I'm seeing ffdec_mpeg2video being 10-20% slower than mpeg2dec (on
> any video size)

[FIXED] It's now faster, by 50%.

> * the interlaced format handling in ffmpeg is bad/poor

That is a generic issue (See also bug #687684)

> * the colorspace isn't properly respected (it clamps the values)

Check colorimetry.

> * the timestamping is a mess in ffmpeg to say the least (EVEN after the X-th
> attempt at fixing it in gst-ffmpeg)

[FIXED]

> * mpeg2dec *HAS* a documented exhaustive API

[FIXED]

> * mpeg2dec has always been more resilient to errors.

Debatable nowadays :)
Comment 13 Edward Hervey 2013-07-28 13:43:40 UTC
Regarding colorimetry, after verifying on a few samples, the result seems correct
Comment 14 Tim-Philipp Müller 2013-07-28 21:28:13 UTC
As before, something to try in 1.3, not shortly before 1.2.

Also, both should work fine in all circumstances. If some decoder is broken in some way, lowering the rank is not helping, since it may still be plugged if the higher rank one is not installed.
Comment 15 Edward Hervey 2016-01-21 16:40:57 UTC
Only 2 and a half year late :)

commit e9a04cd1539d153b487f4606644d4d7c44fcb03e
Author: Edward Hervey <edward@centricular.com>
Date:   Thu Jan 21 17:34:38 2016 +0100

    mpeg2dec: Demote rank to SECONDARY
    
    https://bugzilla.gnome.org/show_bug.cgi?id=574461

commit da335a0ea368d2f71e2824adc3e027332db8a58c
Author: Edward Hervey <edward@centricular.com>
Date:   Thu Jan 21 17:35:51 2016 +0100

    avvidec: Bring mpeg video decoders up to PRIMARY rank
    
    We should have done that ages ago ...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=574461
Comment 16 Nicolas Dufresne (ndufresne) 2016-01-21 18:40:48 UTC
Ok, seems fair. We'll see of it goes, maybe ;-P About the direct rendering, I believe the ffmpeg stuff is a bit worst then the mpeg2dec current state, but with a 50% faster decoding speed, this is clearly not relevant.

(In reply to Edward Hervey from comment #13)
> Regarding colorimetry, after verifying on a few samples, the result seems
> correct

Colorimetry information is not currently passed from libav to gstreamer. So if your stream has default colorimetry for the frame size, it will be fine, otherwise, it will be wrong. libmpeg2 didn't expose the colorimetry of the decoded stream.