I am trying to encode each frame as an I-Frame. The purpose of this is to capture Instant Replay and store in a .avi container. The problem is that Initial two frames are not appearing in the bitstream. The third frame type = IDR and the rest of the frames type is I. The nvStatus of nvEncEncodePicture is NV_ENC_SUCCESS for every frame. Still initial two frames are nil. I am unable to understand where the things are going wrong.
Following are the parameters that have set.
- Codec GUID = NV_ENC_CODEC_H264_GUID
- Preset GUID = NV_ENC_PRESET_DEFAULT_GUID
- Profile GUID = NV_ENC_H264_PROFILE_MAIN_GUID
- goplength = 1
- frameIntervalP = 0
- enablePTD = 0
- idrPeriod = NVENC_INFINITE_GOPLENGTH (To avoid any IDR frame insertion)
- pictureType = NV_ENC_PIC_TYPE_I
- encodePicFlags = NV_ENC_PIC_FLAG_FORCEINTRA ( for every frame)
- encodePicFlags = (NV_ENC_PIC_FLAG_OUTPUT_SPSPPS | NV_ENC_PIC_FLAG_FORCEINTRA) (for the first frame only)
- refPicFlag = 1 (for the first frame only, 0 for remaining frame)
- displayPOCSyntax = IframCnt (Incremental)
- frameIdx = IframCnt (Incremental)
- rateControlMode = NV_ENC_PARAMS_RC_CONSTQP