NvMedia IJPE gives NVMEDIA_STATUS_ERROR

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.3.10904
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Hi all,

As the successive of this topic, I still couldn’t get IJPE run. Following the sample, my code is like:

/********************************* Initialization *********************************/
// Initialize NvMedia structures
err = NvSciBufModuleOpen(&bufModule);
err = NvSciSyncModuleOpen(&syncModule);
err = NvSciSyncCpuWaitContextAlloc(syncModule, &cpuWaitContext);

imageSize = m_width * m_height * 3;
LOG_DBG("NVDrive: Encode start, imageSize=%d\n", imageSize);

err = NvSciBufAttrListCreate(bufModule, &bufAttributeList);
status = NvMediaIJPEFillNvSciBufAttrList(NVMEDIA_JPEG_INSTANCE_0, bufAttributeList);

status = PopulateNvSciBufAttrList(
        YUV420SP_8bit,
        m_width,
        m_height,
        true,                           // needCpuAccess
        NvSciBufImage_PitchLinearType,
        2,                              // planeCount
        NvSciBufAccessPerm_ReadWrite,
        256U,
        NvSciColorStd_REC709_ER, 
        NvSciBufScan_ProgressiveType,
        bufAttributeList);

err = NvSciBufAttrListReconcile(&bufAttributeList, 1U,
        &bufReconciledList, &bufConflictList);
appBuffer = static_cast<NvMediaAppBuffer*>(malloc(sizeof(NvMediaAppBuffer)));
memset(appBuffer, 0x0, sizeof(NvMediaAppBuffer));
err = NvSciBufObjAlloc(bufReconciledList, &appBuffer->bufObj);
ijpeCtx = NvMediaIJPECreate(bufReconciledList,               
                            n_inputs,                        // maxOutputBuffering
                            MAX_BITSTREAM_SIZE,              // maxBitstreamBytes
                            NVMEDIA_JPEG_INSTANCE_0);        // HW instance id

/* The reconciled list is needed for later */
NvSciBufAttrListFree(bufAttributeList);
NvSciBufAttrListFree(bufConflictList);

status = sAllocEOFNvSciSyncObj(ijpeCtx, syncModule, &eofSyncObj);
status = NvMediaIJPERegisterNvSciSyncObj(ijpeCtx, NVMEDIA_EOFSYNCOBJ, eofSyncObj);
status = NvMediaIJPESetNvSciSyncObjforEOF(ijpeCtx, eofSyncObj);

/*********************************Image Processing*********************************/
// Convert dwImage from CUDA to NvMedia     
CHECK_DW_ERROR_NOTHROW(dwImageStreamer_producerSend(m_cuda_image, m_streamerCUDA2NvMedia[inputNum]));
CHECK_DW_ERROR(dwImageStreamer_consumerReceive(&m_nvmedia_image, 1000, m_streamerCUDA2NvMedia[inputNum]));
  
dwImage_getNvMedia(&dw_nvmedia_image, m_nvmedia_image);
appBuffer->bufObj = dw_nvmedia_image->imgBuf;

// Compress image
status = NvMediaIJPEFeedFrame(ijpeCtx, appBuffer->bufObj, nvmedia_compress_quality, NVMEDIA_JPEG_INSTANCE_0);

// Rest of the code

The NvMediaIJPEFeedFrame() always return a NVMEDIA_STATUS_ERROR, which means all the error code doesn’t apply to this error.

One suspect from my side is from the description of the function NvMediaIJPEFeedFrame: NvMediaIJPESetAttributes() must be called at least once to configure NvMediaIJPE. Although I don’t have Huffmann Table or quantization-table, I tried to set the quality attribute like this:

NvMediaJPEncAttributes attr;
attr.quality = nvmedia_compress_quality;
status = NvMediaIJPESetAttributes(ijpeCtx,
                                  NVMEDIA_IMAGE_JPEG_ATTRIBUTE_QUALITY,
                                  &attr);

But it still doesn’t work . But honestly I don’t think I need to set it since the function NvMediaIJPEFeedFrame already has this argument.

NvMediaIJPEFeedFrame(
    const NvMediaIJPE *encoder,
    NvSciBufObj bufObj,
    uint8_t quality,
    NvMediaJPEGInstanceId instanceId
);

Any help is appreciated, thanks.

Best regards,

Have you referred to the nvm_ijpe_sci sample application? If so, could you confirm if your issue is reproducible based on it?

Additionally, it would be helpful if you could provide the change, the command, necessary files, and output related to your implementation.