nvenc

Unit of measure for NV_ENC_PIC_PARAMS.inputDuration


What should I put into NV_ENC_PIC_PARAMS.inputDuration? According to the documentation inputTimeStamp can be any monotonically growing value, but I am struggling to find anything on inputDuration.

Should it just be frame.inputTimeStamp - prevFrame.inputTimeStamp?


Solution

  • You can use whatever unit you choose, it doesn't impact the encoding process at all.

    NV_ENC_PIC_PARAMS inputTimeStamp and inputDuration are copied to NV_ENC_LOCK_BITSTREAM outputTimeStamp and outputDuration respectively to keep track which picture produced which bitstream.

    The inputTimeStamp can be additionally used to invalidate reference frames with NvEncInvalidateRefFrames.