NVENC 6.5 H264 encoder issue

Hiya all,

With so many forums I’m not sure I’m posting in the correct one but I’ll have a go here…

On Win7 x64, using VS2010 C++ and the NVENC 6.5 API.

I’m writing an embedded app that’s not games related but it is using the 750gtx for its hardware h264 encoder abilities which I’m very impressed with at this time. The app records live video to hard drive, while having an ‘always on’ preview so that you can always see what you are or about to be recording ( its for setting up camera angles, focus etc ).

I’m currently using NVidias API with D3D11 to help with the h264 encoding process and everything is working great, until I’ve finished encoding and want release the D3D11 interface. I close the encoder due to the fact that if I dont then when I next start recording… the frame number continues from where it left of with the previous encoding. So I close the encoder and release the d3d11 interface at which point the I get a huge issue with the preview rendering stuttering incredibly. The length of time that the stuttering goes on for is related to the length of time that I was using the gpu for h246 encoding. For eg if i was encoding for 10 mins then the stuttering will occur for ~8 secs. If I dont release the d3d11 interface then everything works out fine, but surely this is a memory leak ( the app is designed with the possibility that it will be always on may not closed for weeks while being used to encode potentially hundreds of recordings ).

So i’m just looking for ideas for resolve this issue. Should I close the encoder, which I’m only doing to get the frame counter to reset to 0 or is there an API call that I can use? Or should I do something else different altogether?

Many thanks.
Dave