Skip to content

PlayerForcedCodec

property

Delphi
property PlayerForcedCodec: string read GetPlayerForcedCodec write SetPlayerForcedCodec;
C++Builder
__property System::UnicodeString PlayerForcedCodec = {read=GetPlayerForcedCodec, write=SetPlayerForcedCodec};
C#
public string PlayerForcedCodec { get; set; }
VB.NET
Public Property PlayerForcedCodec As String
C++/Qt
wchar_t *GetPlayerForcedCodec ();
void SetPlayerForcedCodec (wchar_t *Value);

Specifies particular codecs to be used by TVideoGrabber during playback. TVideoGrabber automatically selects the appropriate default codec to play a given clip; however, in some cases a different codec can be preferred.

Codecs can also be added to the graph by invoking ThirdPartyFilter_AddToList (tpf_AddToGraph).

To use the default codecs, leave PlayerForcedCodec empty.

To force the use of a given codec, assign the name of the codec (DirectShow filter name) or its CLSID string to this property, e.g.:

VideoGrabber1.PlayerForcedCodec = "Microsoft DTV-DVD Video Decoder"

or:

VideoGrabber1.PlayerForcedCodec = "{212690FB-83E5-4526-8FD7-74478B7939CD}"

The following keywords are also supported:

PlayerForcedCodec = "LAV": forces the use of the LAV filters (the local files are opened by the LAV filters first).

PlayerForcedCodec = "NOLAV": prevents TVideoGrabber from using the LAV filters.

PlayerForcedCodec = "MF": the local files in the Windows Media Foundation formats (MP4, MOV, M4A, 3GP, MKV, WebM, FLAC, AAC, AVI, WAV, MP3, MPEG, ASF / WMV / WMA...) are opened first by the Media Foundation source of TVideoGrabber (demultiplexers and decoders of Windows, Datastead GPU decoders), before the LAV filters, in every case.

This is also the default order, except when the playback asks for DirectShow components: PlayerForcedCodec = "LAV" or "LAVFIRST", a codec name or CLSID assigned to PlayerForcedCodec, a filter added by ThirdPartyFilter_AddToList (tpf_AddToGraph), a deprecated deinterlacing (di_DScaler, di_AVISynth, di_FFDShow, di_ThirdPartyDeinterlacer), AudioStreamNumber / VideoStreamNumber >= 0, or PlayerHwAccel = hw_None. The local files are then opened by the LAV filters first and by the Media Foundation source right after them (with the di_FFDShow deinterlacing: by the other sources first, as in the previous versions). A clip the Media Foundation source cannot open is opened by the LAV filters when they are installed, then by the other sources.

PlayerForcedCodec = "LAVFIRST": the local files are opened by the LAV filters first (when they are installed), then by the Media Foundation source of TVideoGrabber, then by the other sources (default order of the previous versions).

PlayerForcedCodec = "NOMF": prevents TVideoGrabber from using its Media Foundation source.

PlayerForcedCodec = "DTSTDRTSP": the clip is opened by the Datastead RTSP/RTMP/HTTP/ONVIF DirectShow Source Filter (installed separately), which decodes it with its own decoders. This filter is also used automatically, when it is installed, for a local clip opened by OpenPlayer whose HEVC (H.265) video has no decoder (no HEVC decoder of Windows or DirectShow HEVC decoder installed).

To restore the default value of these non-default settings, set PlayerForcedCodec = "".

Reading the PlayerForcedCodec string does not reflect the state of these keywords: only codec names or codec CLSIDs appear in the PlayerForcedCodec string.