Disabling IVF headers on a VP8 stream


I am trying to use the v4l2_nv_extensions on a Nano w/ r32.6.1 to encode a VP8 stream but am having issues with headers. I was expecting to get an elementary stream however the first frame in the stream has an extra 44 bytes and subsequent frames have an extra 12 bytes which seems consistent with IVF headers getting added. I have tried calling VIDIOC_S_EXT_CTRLS with V4L2_CID_MPEG_VIDEOENC_VPX_HEADERS_WITH_FRAME and the value 0 but it doesn’t seem to have changed anything. I have also verified that data_offset of the buffer from the capture plane is 0. Am I missing something required to disable these headers? This application is a port of a gstreamer based application and I have not experienced the same header issue in the output from the nvv4l2vp8enc element.

I also came across this older post which claims on the TX2 that VP9 should include the IVF headers by default but VP8 should be the raw stream, is this also the case on the Nano?



I have discovered the fix after browsing the source of gstv4l2videoenc.c and a lot of guess and test. The documentation for V4L2_CID_MPEG_VIDEOENC_VPX_HEADERS_WITH_FRAME says This control should be set after setting formats on both the planes and before requesting buffers on either plane. however this appears to be incorrect, the control only seems to work when applied after setting the capture plane format but before setting the output plane format or requesting buffers.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.