Skip to content

Hardware compression

Hardware compression (if available for the video capture device)
Some video capture devices, e.g. the Dazzle Video Creator, offer hardware compression in various formats.
Depending on the device, this can be handled by TVideoGrabber in 2 ways:

***1st case: ***
the device exposes its hardware-encoded formats through the VideoSubtypes list (they appear e.g. as "divx" or "MPEG2").

In this case:
- set VideoSubtype with the index of the desired format in the VideoSubtypes list,
- keep the RecordingInNativeFormat property enabled (to prevent decompressing the hardware-encoded video stream e.g. if the FrameGrabber is enabled),
- keep CompressionMode = cm_NoCompression (because the compression is selected through the VideoSubtype index).
- invoke StartRecording.

2nd case:

the device exposes its hardware encoder through the VideoCompressors list, and it does not appear in the VideoSubtypes list.

In this case:
- do not change the default value of the VideoSubtype index,
- assign to VideoCompressor the index of the hardware encoder in the VideoCompressors list,
- set CompressionMode = cm_OnTheFly to perform the hardware compression during recording,
- invoke StartRecording.