Getting encoded metadata such as frame type and QP

Please provide the following info (tick the boxes after creating this topic):
Software Version
[+] 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-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.1.10844
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

How do I get/extract additional data of an encoded frame?

Meaning that I’m using NvMediaIEPFeedFrame to feed a frame to the encoder and NvMediaIEPGetBits to get the encoded data back. Now I want to get additional information such as the frame type (IDR/PFrame/BFrame/etc), QP or any other data that the encoder can supply.
I couldn’t find any function in the SDK that returns such data.

Thanks

Please refer to NvMediaIEPFeedFrame() and its picParams parameter in the API documentation to under what picture parameters can be passed to the function. You may also find it helpful to look at the relevant implementation in the nvm_iep_sci sample application.

I followed the sample code and I’m indeed using the picParams to request IDR frame, but since the encoding process is asynchronous, I can’t be sure if the frame I received with NvMediaIEPGetBits is of the type I requested.
Additionally, parameters like the actual QP can only be retrieved after the encoder had encoded the frame.
For instance, let’s say I want to write a logic that triggers only when QP gets higher than X or only when IDR frame arrives - I can’t rely on the input I give the encoder, but rather on what the encoder actually produced.

I recommend using the NvMediaIEPGetStatus() function to get the status of the encoded frame, which includes its frame type and QP. In addition, you can check the extradata parameter in the NvMediaIEPGetBits() function for further information. This should allow you to determine the actual frame type and QP of the encoded frame, which you can then use to trigger your logic accordingly.

I totally missed the extradata parameter.
This is exactly what I needed.
Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.