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 757419 - openh264enc: add support for cabac entropy coding
openh264enc: add support for cabac entropy coding
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-01 00:26 UTC by Nicola
Modified: 2018-11-03 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
initial patch (8.38 KB, patch)
2015-11-01 00:26 UTC, Nicola
none Details | Review
patch v2 (16.04 KB, patch)
2015-11-02 11:58 UTC, Nicola
none Details | Review
patch v3 (16.11 KB, patch)
2015-11-03 08:40 UTC, Nicola
none Details | Review

Description Nicola 2015-11-01 00:26:19 UTC
Created attachment 314569 [details] [review]
initial patch

openh264 introduced support for cabac entropy coding.

Initial patch to add support for cabac to openh264enc plugin, please review
Comment 1 Sebastian Dröge (slomo) 2015-11-01 09:20:15 UTC
The profile should be negotiated with downstream via caps
Comment 2 Nicola 2015-11-01 09:34:55 UTC
(In reply to Sebastian Dröge (slomo) from comment #1)
> The profile should be negotiated with downstream via caps

For what I understand cabac generate an h264 stream with "high" profile while cavlc a "baseline" profile. I don't think we can have cavlc and high profile or cabac and baseline profile. Do you mean we need to use cabac/cavlc without a property but based on downstream caps or both?

we need to mantain compatibility with openh264 version < 1.5? (no cabac there)
Comment 3 Sebastian Dröge (slomo) 2015-11-01 09:44:50 UTC
(In reply to Nicola from comment #2)
> (In reply to Sebastian Dröge (slomo) from comment #1)
> > The profile should be negotiated with downstream via caps
> 
> For what I understand cabac generate an h264 stream with "high" profile
> while cavlc a "baseline" profile. I don't think we can have cavlc and high
> profile or cabac and baseline profile.

AFAIK high profile allows cabac and cavlc. And high profile also includes lots of other features that are not in baseline.

> Do you mean we need to use
> cabac/cavlc without a property but based on downstream caps or both?

If downstream wants baseline profile but the property is set, we should either ignore the property or error out.

> we need to mantain compatibility with openh264 version < 1.5? (no cabac
> there)

Yes
Comment 4 Nicola 2015-11-02 11:58:38 UTC
Created attachment 314628 [details] [review]
patch v2

here are the results with this patch:

gst-launch-1.0 -v videotestsrc ! openh264enc entropy-coding=1 ! fakesink

will produce h264 high profile

gst-launch-1.0 -v videotestsrc ! openh264enc entropy-coding=0 ! fakesink

will produce h264 baseline profile as before


gst-launch-1.0 -v videotestsrc ! openh264enc entropy-coding=1 ! video/x-h264,profile=baseline ! fakesink

will produce baseline profile and entropy coding is resetted to CAVLC with this log

baseline profile requested in downstream caps, entropy codec resetted to CAVLC

gst-launch-1.0 -v videotestsrc ! openh264enc entropy-coding=1 ! video/x-h264,profile=high ! fakesink

will produce high profile with cabac entropy coding

gst-launch-1.0 -v videotestsrc ! openh264enc entropy-coding=0 ! video/x-h264,profile=high ! fakesink

will produce high profile with cavlc entropy coding.

Regarding openh264 < 1.4

1) GST_OPENH264_CABAC so the property cannot be setted
2) in negotiate method, negotiation is not allowed and so the profile is setted to baseline since cavlc is the only option
Comment 5 Nicola 2015-11-02 12:24:36 UTC
Some corrections:

Regarding openh264 < 1.5

1) GST_OPENH264_CABAC is hidden so the property cannot be setted
2) in negotiate method, negotiation is not allowed and so the profile is setted to baseline since cavlc is the only option
Comment 6 Nicola 2015-11-03 08:40:00 UTC
Created attachment 314700 [details] [review]
patch v3

Minor modification, test with openh264 1.4 too, here are the results

gst-inspect-1.0 openh264enc
....
....
entropy-coding      : Entropy coding mode. CABAC mode require openh264 1.5 or better
                        flags: readable, writable
                        Enum "GstOpenh264encEntropyCodingMode" Default: 0, "CAVLC"
                           (0): CAVLC            - Context-adaptive variable-length coding

so only CAVLC is possibile

gst-launch-1.0 -v videotestsrc ! openh264enc entropy-coding=1 ! fakesink

0:00:00.025827574 26595      0x163ea70 ERROR           GST_PIPELINE grammar.y:454:gst_parse_element_set: could not set property "entropy-coding" in element "openh264enc0" to "1"
WARNING: erroneous pipeline: could not set property "entropy-coding" in element "openh264enc0" to "1"

and no downstream caps negotiation is possibile (as before this patch)

gst-launch-1.0 -v videotestsrc ! openh264enc entropy-coding=0 ! video/x-h264,profile=high ! fakesink

...
gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason not-negotiated (-4)
...
Comment 7 GStreamer system administrator 2018-11-03 13:42:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/319.