SPS & PPS IDs in older NVenc versions


I’m using NVenc v7.0 (for compatibility with older systems).
My code has spsId and .ppsId set to 0 on the NV_ENC_CONFIG_H264 structure.
Here and there in my output H.264 files I’m seeing non-zero values; 1, 2, 3, etc.
even when no values on the sequence/picture parameter sets change.
I understand that in v7.0 the values are reserved and must be set to 0 so I’m guessing NVenc chooses the actual IDs.
Note: I am calling NvEncReconfigureEncoder a lot.

A few questions relating to this:

  1. What exactly causes the numbers to increment?
  2. If I use a more recent NVenc version (where these values are not reserved anymore) and leave these values as 0, will it always then force them to 0?
  3. To upgrade to use, say, NVenc 8.0 (to take advantage of the spsId/ppsId field funtionality), can I get away with just setting NVENCAPI_MAJOR_VERSION to 8, as long as I’m not using any deprecated fields or features removed from the newer version?
  4. If I call NvEncGetSequenceParams passing spsId=0 and ppsId=0 via the NV_ENC_SEQUENCE_PARAM_PAYLOAD structure, I get a bitstream that seems to ignore those parameters. What then is the point of those parameters?

Thanks in advance,


As far as I can tell, you can request whichever version of the SDK you want, and as long as the driver is recent enough, it should support it. So if I’m on Linux and I have driver version 450.51, I can create an encoder of any version up to Video Codec SDK 10.0. Seems like the headers are future compatible, so I can just use the same nvEncodeAPI.h file in my code and it won’t cause any conflict.

That said, I tried setting NV_ENC_CONFIG_H264::spsId and ::ppsId to a specific value, but here and there the encoder would output bitstreams with varying spsid’s and ppsid’s . I was mostly using the Reconfigure API, though it’s unclear if that’s why.

So it seems like that answers 2 and 3 above (though please let me know if something I wrote seems unexpected).