How to reset NvVideoEncoder VideoEncoder object?

Hi,

I’m use argus sample frontend VideoEncoder.h to encode video from camera image, it works fine.
And now I want to save different videos per 2000 frame. But after I called encoder.encodeFromFd(-1) to close previous video, encoder.encodeFromFd(image_dma_id) not work. My process like this:

encoder.encodeFromFd(A);
encoder.encodeFromFd(B);
encoder.encodeFromFd©;
encoder.encodeFromFd(-1);
encoder.reset();// how to coding it?
encoder.encodeFromFd(D);
encoder.encodeFromFd(E);
encoder.encodeFromFd(F);

Or,may I know what is the length of video header from first frame? Then I can write header to every video file. Then I can change to below:
encoder.encodeFromFd(A);
encoder.encodeFromFd(B);
encoder.encodeFromFd©;
Write:header,A,B,C

encoder.encodeFromFd(D);
encoder.encodeFromFd(E);
encoder.encodeFromFd(F);
Write:header,D,E,F

Hi,
PLease refer to 01_video_encode. It demonstrates complete function of video encoding. Also it is verified in stress test. You can set below option:

-s <loop-count>       Stress test [Default = 1]