Skip to content

TVideoCompression_int

type

TVideoCompression_int = ( vc_DataRate, vc_KeyFrameRate, vc_Quality, vc_RateControl, vc_PeakDataRate, vc_BufferSize_ms, vc_Profile, vc_LowLatency_bool, vc_HardwareFallback_bool, vc_Info_HardwareEncoder_readonly, vc_Info_HardwareFallback_Occurred_readonly, vc_Info_RateControl_readonly, vc_Info_DataRate_readonly, vc_Info_KeyFrameRate_readonly, vc_Info_Profile_readonly, vc_Info_EncodedFrames_readonly, vc_Info_DroppedFrames_readonly, vc_Info_GPUVendor_readonly, vc_Info_SettingsRefused_readonly );

Settings of the Media Foundation video encoders (VideoCompressors list) and of the MP4 recording without video compression, set with VideoCompression_SetInt and read with VideoCompression_GetInt.

Set with VideoCompression_SetInt before starting the recording, e.g. VideoCompression_SetInt (vc_RateControl, 1) and VideoCompression_SetInt (vc_DataRate, 4000000) for a constant bit rate of 4 Mb/s, and read with VideoCompression_GetInt.

These settings apply to the Media Foundation encoder entries of the VideoCompressors list (e.g. "H264 (Auto)", "H264 GPU (Nvidia)", also the "H264 (Auto)" encoder of an MKV recording without video compression) and to the H.264 encoder of the MP4 recording without video compression (built-in MP4 writer), from the next recording. As soon as one of them is assigned with VideoCompression_SetInt, the settings saved with ShowDialog (dlg_VideoCompressor) for the Media Foundation encoder entries are not used (see VideoCompression_SetInt). A setting without effect for the encoder used is reported by OnLog and by vc_Info_SettingsRefused_readonly.

vc_DataRate, vc_KeyFrameRate and vc_Quality are the values of the VideoCompression_DataRate, VideoCompression_KeyFrameRate and VideoCompression_Quality (x 100) properties: the last value assigned, by the function or by the property, is used. They also apply to the other DirectShow compressors; the other settings apply to the encoders above only.

-1: not set (default of the encoder, or setting saved with ShowDialog when no setting is assigned with VideoCompression_SetInt). Suffixes: _bool: 1 or 0; _ms: milliseconds; _readonly: read with VideoCompression_GetInt only, value of the encoder of the current recording (-1 when no recording runs, with another compressor, or when the value is not known).

The audio settings are listed in TAudioCompression_int. The Datastead Multipurpose Encoder is configured with Encoder_SetInt.

Value Description
vc_DataRate mean bit rate, in bits per second (10000 at least), same value as VideoCompression_DataRate; -1 or 0: not set
vc_KeyFrameRate number of frames per key frame, 0: automatic (a key frame every 2 seconds), same value as VideoCompression_KeyFrameRate; -1: not set (VideoCompression_KeyFrameRate back to its default value 15, not applied to these encoders). Assigned by VideoCompression_SetInt, 15 is applied too
vc_Quality constant quality, 0 to 100 (JPEG quality for the MJPEG entries), VideoCompression_Quality x 100; -1: not set (VideoCompression_Quality back to its default value 1.0, not applied to these encoders). Assigned by VideoCompression_SetInt, 100 is applied too. Used when vc_RateControl is 2, or not set without vc_DataRate
vc_RateControl rate control: 0 VBR (vc_DataRate), 1 CBR (constant bit rate, vc_DataRate, else automatic bit rate), 2 constant quality (vc_Quality). Not set: VBR, or constant quality when vc_Quality is set without vc_DataRate
vc_PeakDataRate peak bit rate of the VBR mode (vc_RateControl 0 or not set), in bits per second (10000 at least): peak-constrained VBR. Not used by CBR, by the constant quality, nor by the MP4 recording without video compression; -1 or 0: not set
vc_BufferSize_ms size of the encoder buffer, in milliseconds at the bit rate of the mode (vc_DataRate in CBR, vc_PeakDataRate in peak-constrained VBR), 1 to 60000: the smaller the buffer, the more constant the bit rate. H.264 only; not used by the MP4 recording without video compression; -1 or 0: not set
vc_Profile profile, FFmpeg profile number as Enc_Video_Profile: H.264 66 (Baseline), 578 (Constrained Baseline), 77 (Main), 100 (High). Not set: High, else Main, else Baseline; a profile refused by the encoder: profile of the encoder. MP4 recording without video compression: 66, 77, 100 (578: 66); -1 or 0: not set
vc_LowLatency_bool 1: low latency mode of the encoder (default); 0: default mode of the encoder. Not used by the MP4 recording without video compression
vc_HardwareFallback_bool 1: when the GPU encoder selected cannot be used (session limit, driver), the software encoder of the same codec is used (default); 0: the encoder refuses its input connection, the recording does not start. Not used by the MP4 recording without video compression
vc_Info_HardwareEncoder_readonly 1: GPU encoder, 0: software encoder
vc_Info_HardwareFallback_Occurred_readonly 1: the GPU encoder selected could not be used, the software encoder is used (Media Foundation entries only)
vc_Info_RateControl_readonly rate control applied (vc_RateControl values)
vc_Info_DataRate_readonly bit rate given to the encoder, in bits per second (automatic bit rate included); 0 with the constant quality
vc_Info_KeyFrameRate_readonly number of frames per key frame given to the encoder
vc_Info_Profile_readonly profile of the encoded stream (vc_Profile values)
vc_Info_EncodedFrames_readonly number of frames encoded since the encoder started (start of the recording; for the MP4 recording without video compression: since the current file was opened)
vc_Info_DroppedFrames_readonly number of frames not encoded because the encoder did not keep up with the video source (the frames lost by the capture are reported by DroppedFrames)
vc_Info_GPUVendor_readonly PCI vendor ID of the GPU encoder (4318 (0x10DE) NVIDIA, 32902 (0x8086) Intel, 4098 (0x1002) AMD), 0: software encoder (Media Foundation entries only)
vc_Info_SettingsRefused_readonly bit mask of the settings assigned but not applied (refused by the encoder, or without effect in the rate control mode or for the encoder used): the bit of value 2^n is set for the setting of rank n (vc_DataRate = 0, vc_KeyFrameRate = 1...); 0: all applied