vaapih264enc rate-control-vbr on Intel Cherry Trail

David Manpearl david at gnarbox.com
Wed Jul 31 00:27:41 UTC 2019


Why doesn't vaapih264enc support rate-control-vbr on our Intel Cherry Trail processor (see new information below re gstreamer-vaapi mods)

I have tried similar pipelines in 1.14.1, 1.14.5, and 1.16.0.



This pipeline works with rate-control=constant bitrate:

gst-launch-1.0 -v videotestsrc num-buffers=1000 ! videoconvert ! vaapipostproc width=1280 height=720 ! vaapih264enc rate-control=cbr bitrate=8000 ! mp4mux ! filesink location=video.mp4



This pipeline fails with rate-control=variable bitrate:

gst-launch-1.0 -v videotestsrc num-buffers=1000 ! videoconvert ! vaapipostproc width=1280 height=720 ! vaapih264enc rate-control=vbr bitrate=8000 ! mp4mux ! filesink location=video.mp4

ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.

streaming stopped, reason not-negotiated (-4)

ERROR: pipeline doesn't want to preroll.

 

= = = UPDATE 7/30/2019 = = =

The "Internal data stream error" problem can be bypassed by a modification to gstvaapicontext.c in the function config_create() of the gstreamer-vaapi code base. The fix is to remove the "goto cleanup;" statement when the rate-control selection is excluded in this conditional: "if ((value & va_rate_control) != va_rate_control) {"

Now, I can process using "vaapih264enc bitrate=5000 rate-control=vbr" without error, but the controls such as changes in bitrate do not affect output file size so I believe they are ignored.

The reason for the conditional failing can be traced to vaGetConfigAttributes() indicating support for only CBR 0x02 (constant-bitrate) and CQP 0x10 (constant-quality). vaGetConfigAttributes comes from the core VA-API library as documented here: http://intel.github.io/libva/group__api__core.html#gae51cad2e388d6cc63ce3d4221798f9fd. Therefore, I can't think of how to follow the trail any further. Please share your ideas, knowledge, and experience.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190730/ce47b1f3/attachment.html>


More information about the gstreamer-devel mailing list