Building for Jetpack 6.1

I’m crosscompiling for Jetpack 6.1, using a build image with Jetpack 6.1 packages installed from Index.
Specifically, this package is used for multimedia API - nvidia-l4t-jetson-multimedia-api_36.4.0-20240912212859_arm64.deb

Building the same code that had been compiling for Jetpack 5.1 now fails with the errors similar to

In file included from /home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/samples/common/classes/NvVideoEncoder.cpp:31:
In file included from /home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/NvVideoEncoder.h:50:
In file included from /home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/NvV4l2Element.h:50:
In file included from /home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/NvV4l2ElementPlane.h:53:
In file included from /home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/NvBuffer.h:43:
/home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/v4l2_nv_extensions.h:200:37: error: field has incomplete type 'struct v4l2_h264_weight_factors'
    struct v4l2_h264_weight_factors weight_factors[2];
                                    ^
/home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/v4l2_nv_extensions.h:200:12: note: forward declaration of 'v4l2_h264_weight_factors'
    struct v4l2_h264_weight_factors weight_factors[2];
           ^
/home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/v4l2_nv_extensions.h:258:32: error: field has incomplete type 'struct v4l2_h264_dpb_entry'
    struct v4l2_h264_dpb_entry dpb[16];
                               ^
/home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/v4l2_nv_extensions.h:258:12: note: forward declaration of 'v4l2_h264_dpb_entry'
    struct v4l2_h264_dpb_entry dpb[16];
           ^

Inspecting /home/insectoidsombrero/nvidia/jetson6.1/usr/src/jetson_multimedia_api/include/v4l2_nv_extensions.h shows those structs indeed haven’t been defined.

What’s the best way to work around or fix this?

v4l2_nv_extensions.h.txt (113.2 KB)

This is the header file in question. As you may see, it indeed uses the structs in question without ever declaring them. Older versions of this file did contain the declarations.

So, as an additional data point – using packages from both 36.4.0-20240912212859 and 36.3.0-20240506102626 versions of multimedia API fail for the same reason. Building against 35.6.0-20240828020325 (version from JP5.1.4) works, but I’m not sure if that’d be considered compatible when ran on JP6.1.

Hi,
It looks like versions of Jetpack and jetson_multimedia_api samples are mismatched. Please install it through

$ sudo apt install nvidia-l4t-jetson-multimedia-api

And see if you can compile the samples successfully:

/usr/src/jetson_multimedia_api/

I cannot just install it on the build system; as I’ve mentioned I’m crosscompiling, using DEB packages above to setup the toolchain.

Which version of nvidia-l4t-jetson-multimedia-api is appropriate for 6.1? Is it available for download anywhere?

Alternatively, is there a downside to using nvidia-l4t-jetson-multimedia-api from 5.1.4 to build binaries targeting 6.1? Is it ABI-compatible?

Hello,
I have the same problem. In file v4l2_nv_extensions.txt in line 200 there is using of v4l2_h264_weight_factors, but there is no declaration before

struct v4l2_h264_pred_weight_table {
    __u8 luma_log2_weight_denom;
    __u8 chroma_log2_weight_denom;
    struct v4l2_h264_weight_factors weight_factors[2];
};

In older versions of Jetpack there is a declaration
What is a solution?

1 Like

Hi,
The samples are installed on Jetson device. You can install it through apt install command or SDKMAnager. And they are installed to

/usr/src/jetson_multimedia_api

And for setting cross-compiling environment, please refer to

Jetson Linux API Reference: Setting Up Cross-Platform Support | NVIDIA Docs

You need to confirm the samples can be successfully built on Jetson device, clone the image out and mount it on the host PC.
Or use NGC docker.

Again, not building on Jetson device. Please see for yourself. Don’t even try to build:

wget https://repo.download.nvidia.com/jetson/common/pool/main/n/nvidia-l4t-jetson-multimedia-api/nvidia-l4t-jetson-multimedia-api_36.4.3-20250107174145_arm64.deb
dpkg-deb -x nvidia-l4t-jetson-multimedia-api_36.4.3-20250107174145_arm64.deb nvidia-l4t-jetson-multimedia-api_36.4.3-20250107174145_arm64_installed
cd nvidia-l4t-jetson-multimedia-api_36.4.3-20250107174145_arm64_installed
vi ./usr/src/jetson_multimedia_api/include/v4l2_nv_extensions.h

The header in question:

  1. Uses v4l2_h264_weight_factors structure
  2. Does not define v4l2_h264_weight_factors structure
  3. Does not include any other headers

Now repeat this exercise with an earlier multimedia API package (say, for version 35.6.0-20240828020325 used in Jetpack 5.1), and you will see this is NOT the case, and v4l2_h264_weight_factors is defined before use.

In the new version, it isn’t defined anywhere (including the toolchain you link to). Please advise.

I’ve mounted the current published SD card image, to check the state of things there. Same situation:

  • /usr/src/jetson_multimedia_api/include/v4l2_nv_extensions.h leaves v4l2_h264_weight_factors undefined
  • v4l2_h264_weight_factors is defined in /usr/include/linux/v4l2-controls.h which isn’t included by any file in multimedia API
  • v4l2_nv_extensions.h references v4l2-controls.h in the line
/*---------------Below are changes from the v4l2-controls.h----------------------*/