Hi i’m trying to make BufferOutputStream work with NvBufferColorFormat_ABGR32. I’m testing sample code under jetson_multimedia_api/argus/samples/eglimage.
and the program hangs. If I uncomment the NV12 line, then it works again.
I want to get ABGR format because I followed this tutorial and successfully converted the eglframe to opencv mat. However, when I’m using NV12, the converted format is wrong. I’m not sure how I can convert the NV12 formated frame to a opencv mat.
But 09 is not using BufferOutputStream. For EGLOutputStream it works fine. However, the EGLOutputStream is slower than the BufferOutputStream and sometimes it’s dropping frames.
Hi, i’m trying to locate the source code of this copyToNvBuffer but I can only find the header file ImageNativeBuffer.h I couldn’t find the implementation of this header file. Where I can get that? Thanks
I’m not sure if I understand your answer. Do you just want me to create a Buffer with the create method in NvNativeBuffer.cpp file? but just use ABGR color format? I have tried that. it didn’t work. If I directly change the color format from NV12 to ABGR, the BufferOutputStream will just be stuck at acquireBuffer method. main.cpp (26.6 KB)
I’m sharing the code here.
If I directly change NvBufferColorFormat_NV12 with NvBufferColorFormat_ABGR32, the acquireBuffer just halts there. I don’t know what else I need to do. Although currently, I made the code work with NV12, the NV12 data conversion is not something I preferred. I do prefer using ABGR for some other use cases.
Hi,
If changing the format in NvNativeBuffer doesn’t work, the format is not supported in this mode. You have to use the method demonstrated in 09 sample.
Hi,
Format conversion is supported. You can grep it in the samples and see some reference code. For example, in 12_camera_v4l2_cuda, frame data in YUV422(YUYV or UYVY) is converted to YUV420 for rendering.