# Reconfigure frame rate in realtime

**URL:** <https://forums.developer.nvidia.com/t/reconfigure-frame-rate-in-realtime/59586>\
**Category:** Video Codec, PyNv & OFA\
**Created:** [March 28, 2018, 1:15am UTC](https://forums.developer.nvidia.com/t/reconfigure-frame-rate-in-realtime/59586 "2018-03-28T01:15:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmGo](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hmGo](https://forums.developer.nvidia.com/u/hmGo)\
**Post date:** [March 28, 2018, 1:15am UTC](https://forums.developer.nvidia.com/t/reconfigure-frame-rate-in-realtime/59586/1 "2018-03-28T01:15:07Z")

</div>

Hi,

I’m trying to change video frame rate when encoding takes longer than frame rate.  
For example, when I am encoding 4k video with captured textures at 30 fps, but encoding takes longer than 30 fps(over 0.0333 secs), then I want to change video frame rate and capture cycle(1/15 secs) to 15 fps.  
The reason why I want to do like this is when I encode videos at 30 fps and 30 fps capture cycle(1/30 secs), I can see out of sync issue with audio as I can’t pass all textures for generating 30 fps video.

So now what I wanted to try is using nvEncReconfigureEncoder… but it doesn’t seem to be working for changing fps… Is there anything I need to add more here?

```auto
NVENCSTATUS CNvHWEncoder::NvEncReconfigureFrameRate(const int frameRate) {
	NVENCSTATUS nvStatus = NV_ENC_SUCCESS;	

	NV_ENC_RECONFIGURE_PARAMS stReconfigParams = {0};
	memset(&stReconfigParams, 0, sizeof(stReconfigParams));
	memcpy(&stReconfigParams.reInitEncodeParams, &m_stCreateEncodeParams, sizeof(m_stCreateEncodeParams));
	stReconfigParams.version = NV_ENC_RECONFIGURE_PARAMS_VER;		
	stReconfigParams.resetEncoder = 1;
	stReconfigParams.forceIDR = 1;
	stReconfigParams.reInitEncodeParams.frameRateNum = frameRate; // fps to 15

	nvStatus = m_pEncodeAPI->nvEncReconfigureEncoder(m_hEncoder, &stReconfigParams);
	if (nvStatus != NV_ENC_SUCCESS) {		
		return nvStatus;
	}

	return nvStatus;
}

```

---

<div class="post-metadata">

**Author:** ![rypark](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rypark](https://forums.developer.nvidia.com/u/rypark)\
**Post date:** [March 30, 2018, 7:45pm UTC](https://forums.developer.nvidia.com/t/reconfigure-frame-rate-in-realtime/59586/2 "2018-03-30T19:45:10Z")

</div>

Hi hmGo,

Could you provide us with the following information:

1. Operating System
2. driver version
3. GPU being used
4. Video Codec SDK version being used

Thanks,  
Ryan Park

---

<div class="post-metadata">

**Author:** ![hmGo](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hmGo](https://forums.developer.nvidia.com/u/hmGo)\
**Post date:** [April 2, 2018, 5:25pm UTC](https://forums.developer.nvidia.com/t/reconfigure-frame-rate-in-realtime/59586/3 "2018-04-02T17:25:23Z")

</div>

1. Operating System  
: Windows 10 64 bit
2. driver version  
: 391.01
3. GPU being used  
: GeForce GTX 1070
4. Video Codec SDK version being used  
: How to check the version number? But I got this nvenc sdk in around Nov. 2016.

---

<div class="post-metadata">

**Author:** ![rypark](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rypark](https://forums.developer.nvidia.com/u/rypark)\
**Post date:** [April 2, 2018, 5:31pm UTC](https://forums.developer.nvidia.com/t/reconfigure-frame-rate-in-realtime/59586/4 "2018-04-02T17:31:46Z")

</div>

Hi hmGo,

If you got the Video Codec SDK around November, chances are you are using the Video Codec SDK version 7.0.

Have you tried downloading the newest Video Codec SDK v8.1:

[https://developer.nvidia.com/nvidia-video-codec-sdk#Download](https://developer.nvidia.com/nvidia-video-codec-sdk#Download)

If this doesn’t work, then please follow up on this thread again.

Thanks,  
Ryan Park
