NvBuffer -> CUDA -> File

Hello!

I am running the following test program to write the Y frame of a YUV NvBuffer to file. It writes a garbage file. Is converting to an EGLImage still the way to do it?

main.cpp (6.0 KB)

compile with:
clang++ main.cpp /usr/src/jetson_multimedia_api/samples/common/classes/NvElement.o /usr/src/jetson_multimedia_api/samples/common/classes/NvElementProfiler.o /usr/src/jetson_multimedia_api/samples/common/classes/NvLogging.o /usr/src/jetson_multimedia_api/samples/common/classes/NvEglRenderer.o -I/usr/src/jetson_multimedia_api/include -I/usr/src/jetson_multimedia_api/argus/samples/utils/ -I/usr/local/cuda/include -L/usr/lib/aarch64-linux-gnu/tegra -L/usr/local/cuda/lib64 -lnvargus -lEGL -lnvbuf_utils -lpthread -lGL -lX11 -lcuda -lcudart

convert grayscale output to png:
convert -depth 8 -size 2048x1080 out.mono out.png

Hi,
The code looks OK. Not sure where the problem is. Could you try dump_dmabuf() in

/usr/src/jetson_multimedia_api/samples/common/classes/NvUtils.c

See if the function works.

dump_dmabuf() creates the same result. Have you tried running the code? Maybe its a hardware issue

Just tried it on a different nano/carrier board and it worked. Thanks

1 Like