Nonzero SPS and PPS id in H.264 bitstream from NVENC

164 Views Asked by At

In what cases will NVENC choose nonzero SPS and PPS ids for a bitstream? I have a bitstream that should only have one SPS and one PPS and yet it's choosing '2' for both seq_parameter_set_id and pic_parameter_set_id.

EDIT: Indeed the NV_ENC_CONFIG_H264 structure has parameters spsId and ppsId, but in older versions like v7.0 (which I'm bound to for the time being) these values are reserved and must be set to 0 (which I assume means that the driver decides).

1

There are 1 best solutions below

1
On

I am guessing it is matter of correctly setting up the ENVIDIA encoder. The encoder has a number of nested configuration structs. I'd try to set spsId/ppsId to '0'

In Video_Codec_SDK_11.0.10/include/nvEncodeAPI.h

typedef struct _NV_ENC_CONFIG_H264
{
[snip]
    uint32_t spsId; /**< [in]: Specifies the SPS id of the sequence header */
    uint32_t ppsId; /**< [in]: Specifies the PPS id of the picture header */
[snip]
} NV_ENC_CONFIG_H264;