JP7.2 - 15_multivideo_encode reports NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9

Hi all,

I am doing parallel multivideo encoding on AGX Orin and updated to JP7.2 for argus stability

It seems there is some multivideo encoder instability on jp7.2. When i run the mmapi example 15 i get logs like this:
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 0
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 0
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9

And sometimes those even crash my camera producer

I can recreate the issue readily by running:

W=960 H=600 FRAMES=300

truncate -s $((W*H*3/2*FRAMES)) /tmp/vid1.nv12
truncate -s $((W*H*3/2*FRAMES)) /tmp/vid2.nv12

./multivideo_encode num_files 2 \
  /tmp/vid1.nv12 "$W" "$H" H264 /tmp/vid1.h264 \
  /tmp/vid2.nv12 "$W" "$H" H264 /tmp/vid2.h264 \
  --sp \
  -br 2500000 \
  -rc cbr \
  -ifi 120 \
  -idri 120 \
  -fps 60 1 \
  -hpt 1 \
  --blocking-mode 1 \
  -mem_type_oplane 3 \
  -alloc_type_oplane 0 \
  -s 3

where i get output like

NvMMLiteOpen : Block : BlockType = 4
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
NvMMLiteBlockCreate : Block : BlockType = 4
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Opening in BLOCKING MODE
Opening in BLOCKING MODE
875967048
842091854
875967048
842091854
H264: Profile = 66 Level = 51
H264: Profile = 66 Level = 51
NVMEDIA: Need to set EMC bandwidth : 752000
NVMEDIA: Need to set EMC bandwidth : 752000
NvVideo: bBlitMode is set to TRUE
NvVideo: bBlitMode is set to TRUE
Could not read complete frame from input file
File read complete.
Could not read complete frame from input file
File read complete.
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteOpen : Block : BlockType = 4
NvMMLiteBlockCreate : Block : BlockType = 4
Got 0 size buffer in capture
Got 0 size buffer in capture
Instance 0 executed successfully.
Instance 1 executed successfully.
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Opening in BLOCKING MODE
Opening in BLOCKING MODE
875967048
842091854
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091854
H264: Profile = 66 Level = 51
H264: Profile = 66 Level = 51
NVMEDIA: Need to set EMC bandwidth : 752000
NVMEDIA: Need to set EMC bandwidth : 752000
NvVideo: bBlitMode is set to TRUE
NvVideo: bBlitMode is set to TRUE
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
Could not read complete frame from input file
File read complete.
Could not read complete frame from input file
File read complete.
NvMMLiteOpen : Block : BlockType = 4
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
NvMMLiteBlockCreate : Block : BlockType = 4
Got 0 size buffer in capture
Got 0 size buffer in capture
Instance 1 executed successfully.
Instance 0 executed successfully.
Creating Encoder in blocking mode
Creating Encoder in blocking mode
Opening in BLOCKING MODE
Opening in BLOCKING MODE
875967048
842091854
875967048
842091854
H264: Profile = 66 Level = 51
H264: Profile = 66 Level = 51
NVMEDIA: Need to set EMC bandwidth : 752000
NVMEDIA: Need to set EMC bandwidth : 752000
NvVideo: bBlitMode is set to TRUE
NvVideo: bBlitMode is set to TRUE
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 0
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 0
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
NvMedia2D operation failed in NvMedia2DGetComposeParameters with status: 9
Could not read complete frame from input file
File read complete.
Could not read complete frame from input file
File read complete.
Got 0 size buffer in capture
Got 0 size buffer in capture
Instance 0 executed successfully.
Instance 1 executed successfully.
App run was successful

Does anyone know the source of these errors? TIA

Hi,
For information, do you get valid h264 files? It looks like application terminates successfully, despite the error prints.

yes, it seems to exit correctly, and i suspect the videos are fine but i haven’t watched them (this example is just 300 black frames). I’m encoding the video as part of another application and the encoded video i get out of that application looks good. but when i notice the logs in that application i sometimes see green flickering (not always), and sometimes have faults in my application. then i noticed sample 15 did it too (the logs, not the faults)

if it would be helpful i could look into a sample to reproduce, lmk