AV1 encoder - unexpected 44 byte header at start of encoded bitstream

I am using the v4l2 API to encode with AV1, similar to the examples.

I have noticed that in comparison to when I encode with AV1 on the desktop Video Codec, with the Jetson Multimedia API I get this strange header at the start.

I am using DAV1D to decode, and it falls down trying to parse from the start as the 44 byte header is obviously not a valid part of the bitstream.

I’m not too sure exactly where it is coming from, or what is for, and certainly apps like VLC, or the browser-based parser (see below) are able to skip it, so I’m wondering if anyone can shed some light on what it is or how I can get rid of it, or is it always 44 bytes so I can just skip it?

As can be seen in the HEX in the screenshot below, it includes the string “AV01” so it must be some kind of header information?

As I mentioned, the Video Codec SDK doesn’t have this header, so DAV1D can decode from the start of the stream.

Ok it looks like it must be adding IVF headers by default, so I guess I need to find the flag to turn that off.

As per this post Disabling IVF headers on a VP8 stream the documentation is similarly misleading for AV1.

For V4L2_CID_MPEG_VIDEOENC_AV1_HEADERS_WITH_FRAME it states:

/**

  • Control ID to enable/disable setting for attaching IVF headers.

  • Only to be used for AV1 codec.

  • A boolean value should be supplied with this control.

  • If value is false headers will be disabled and true will enable the headers.

  • @attention This control should be set after setting formats on both the planes

  • and before requesting buffers on either plane.

*/

define V4L2_CID_MPEG_VIDEOENC_AV1_HEADERS_WITH_FRAME (V4L2_CID_MPEG_BASE+569)

However, it only works if the flag is set after setting the capture format but before the output format.

1 Like

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