Creating a CUDA -> nveglstreamsrc gstreamer pipeline

I would like to connect a CUDA producer to a gstreamer pipeline. Right now, my CUDA producer repeatedly calls cuEGLStreamProducerPresentFrame to present egl frames to the gstreamer pipeline. The gstreamer pipeline looks something like this: nveglstreamsrc → omxh264enc → appsink. This works for exactly 63 frames, but after that, cuEGLStreamProducerPresentFrame fails with error code 999.

My guess is that the consumer (in this case, nveglstreamsrc), is not releasing the frame, so the egl stream queue grows until capacity, after which calls to cuEGLStreamProducerPresentFrame fail. Is this accurate? How can I fix this issue? I have already tried connecting the Argus api to the same gstreamer pipeline (as done in the gstVideoEncode sample) and it works without problems.

Hi,
Please refer to
[url]https://devtalk.nvidia.com/default/topic/1044444/jetson-tx1/problem-with-nveglstreamsrc/post/5300639/#5300639[/url]

On R28.2.1/TX2, it requires to replace libgstnveglstreamsrc.so. On r28.3, the issue is fixed and it should run fine with default libgstnveglstreamsrc.so.

Hi DaneLLL,
I tried replacing libgstnveglstreamsrc.so, but ran into more errors: “NvEglStreamSrcInitializeEgl: Cannot find function NvEglRegClientApi” and “NvEGLStreamSrc: NvEglStreamSrcInitializeEgl function failed: err=8”. For reference, I am running with Jetpack 4.2, which I believe runs L4T 32.1.

Hi,
You don’t need the prebuilt lib on r32.1 and the sample should work fine. However, it is eglstream producer and may not be your usecase.

For running CUDA producer, we have a sample and you can execute

$ /usr/local/cuda/bin/cuda-install-samples-10.0.sh ~/

and refer to

~/NVIDIA_CUDA-10.0_Samples/3_Imaging/EGLStreams_CUDA_Interop/

Hi,
Please also refer to
[url]https://devtalk.nvidia.com/default/topic/1023481/jetson-tx2/frames-returned-from-nveglstreamsrc-via-egl-stream-out-of-order/post/5209249/#5209249[/url]
Calling cuEGLStreamProducerReturnFrame() accordingly is necessary.