GNOME Bugzilla – Bug 758620
x264enc: allow bitrates higher than 100Mbps
Last modified: 2015-11-26 16:09:05 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'
Want to propose a patch ? Please update x265enc at the same time.
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.
It seems to cap i_bitrate it to 2000000: http://git.videolan.org/?p=x264.git;a=blob;f=encoder/encoder.c;h=c87d79de2436776e5ac866570ece87f6be5296fb;hb=HEAD#l876
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
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.
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