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 758620 - x264enc: allow bitrates higher than 100Mbps
x264enc: allow bitrates higher than 100Mbps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Linux
: Normal enhancement
: 1.6.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-24 22:13 UTC by Arjen Veenhuizen
Modified: 2015-11-26 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch allows x264enc to accept bitrates up to 2Gbps (587 bytes, patch)
2015-11-26 08:15 UTC, Arjen Veenhuizen
committed Details | Review

Description Arjen Veenhuizen 2015-11-24 22:13:40 UTC
Currently, the x264enc element allows bitrates in the range: Unsigned Integer. Range: 1 - 102400 Default: 2048

E.g., up to approx. 100Mbps. To my knowledge, libx264, does not impose such limit and can easily go over 600 Mbps. For our tests we experiment with 4K in AVC I-only format, for which we need this kind of high bitrates. My suggestion would be to increase the limits of this property. Currently we have to resort to libx264/ffmpeg to meet these needs.

Observed behavior when bitrate is set to above 102400: element defaults to 2048 and shows a warning: (gst-launch-1.0:517): GLib-GObject-WARNING **: value "200000" of type 'guint' is invalid or out of range for property 'bitrate' of type 'guint'
Comment 1 Nicolas Dufresne (ndufresne) 2015-11-24 22:40:15 UTC
Want to propose a patch ? Please update x265enc at the same time.
Comment 2 Arjen Veenhuizen 2015-11-24 22:47:54 UTC
I have been checking the various libx264 docs, but up until now I haven't found the maximum bitrate imposed by it. For now I just upped the maximum of the bitrate property of x264enc to 1000Mbps and it doesn't seem to complain. Will keep you posted and suggest a patch.
Comment 4 Arjen Veenhuizen 2015-11-26 08:11:18 UTC
Unfortunately it turns out to be more complex than just one hard limit.
According to the official AVC spec (see [1] as well), bitrate limits are profile related and capped at 720Mbps for High10-I-only 4K. But apparently even x264 does not follow suit. In that case I would propose to stretch the limit on our x264enc in line with x264 and disregard the limits imposed by the spec.

In case of x265, the highest bitrate is 76Gbps (!) according to the official spec and [2].

[1] https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels
[2] https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding_tiers_and_levels
Comment 5 Arjen Veenhuizen 2015-11-26 08:15:33 UTC
Created attachment 316288 [details] [review]
Patch allows x264enc to accept bitrates up to 2Gbps

This simple patch changes the x264enc bitrate property limit maximum value from 100Mbps to 2000Mbps.
Comment 6 Tim-Philipp Müller 2015-11-26 16:08:47 UTC
Thanks for the patch. Next time, please make a git commit locally and then submit a patch in git format-patch format (then we don't have to type in author and commit messages), thanks!

commit f037e7e59eca096c0a2b372044afc380cd3490f5
Author: Arjen Veenhuizen <arjen.veenhuizen@tno.nl>
Date:   Thu Nov 26 15:49:47 2015 +0000

    x264enc: increase bitrate limit from 100Mbps to 2Gbps
    
    Don't artificially limit the bitrate, x264enc allows much
    higher bitrates, and for intra-only 4k AVC they are needed.
    x264 clips to 2Gbps internally, so use that as limit for now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758620