Using appsrc w/ __cuda_array_interface__ in Python

Related reference: Getting the pointer to CUDAMemory of a buffer

Trying to construct a pipeline in which the appsrc fills the buffer with a cupy array in Python. This cupy array data is already on GPU.

Currently I have a pipeline that works with numpy arrays but this requires a GPU to CPU copy followed immediately by CPU to GPU copy with nvvidconv. I’d like to avoid this but directly using the cuda_array_interface which is supported by cupy, numba, pytorch, pycuda, and several other python libraries. CUDA Array Interface (Version 3) — Numba 0+untagged.2155.g9ce83ef.dirty documentation

I tried setting the appsrc caps to video/x-raw(memory:NVMM) but I’m not sure if that is possible.

Using Gstreamer 1.20.3 on a Nvidia Jetson with Jetpack 6.

1 Like