How to change file during videocapture?


I have another question about videocaptre, example CameraDemo. I use Colibri T20, WinCE7.

Please explain me, how during the recording of the video at some point to close the current file and start next file? As I understand it, I should:

  1. set property NvPropertyId_MuxWriterReinitializefilename in filter m_pFileSinkFilter (for video)
  2. set property “VIDEO_IFRAME_INSERT” in filter m_pEncoderFilterVideo

But I can’t. Code is here, I get error E_FAIL (on call pPropertyBag->Write())

    IPropertyBag *pPropertyBag = NULL;

    hr = m_pEncoderFilterVideo->QueryInterface(IID_IPropertyBag, (void**)&pPropertyBag);
    FAILEDHR(hr, "QueryInterface for IPropertyBag failed.\n", CleanUp);

    const WCHAR *NameProp = L"VIDEO_IFRAME_INSERT";
    VARIANT var;
    var.vt = VT_BOOL;
    var.boolVal = TRUE; 
    hr = pPropertyBag->Write(NameProp, &var);
    FAILEDHR(hr, "Write IPropertyBag failed.\n", CleanUp);

Seting of NvPropertyId_MuxWriterReinitializefilename is successful, the file name changes, but then loses sync, the recording is not ongoing.

What am I doing wrong?

Can I somehow get documentation NVIDIA to work with their DirectShow filters? Iinformation on Toradex website is not enough.


Error when writing property “VIDEO_IFRAME_INSERT” I solved. It turns out that it is of type VT_I4. Although the comments in the file nvdshow_encode.h indicates the type VT_BOOL.

But to change the file for video recording is still not possible. The second file is created, but the stream recording it is not happening (its size is a few kilobytes). The player does not play the second file.

Also I checked what happens if exceeding the maximum file size, if it is set to property NvPropertyId_EncodedFileSize. The writing in the original file is terminated, but the new file is not automatically created.

Therefore, the main question remains: how to correctly complete the record current video and start the next? Maybe there are some examples from NVIDIA?

Yes, I did same, temporarily. I stop the video stream, change the file name and run again. It works. I don’t like that there is a big pause in the video - for about three seconds.

It would be great, if you can debug the function continuous recording.

Thank you for reply and documentation.