Medialooks Knowledge Base Support Center

Contact Us

MFPreview object properties

The properties are stored in the system registry:

[HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFPreview]

and can be set with the PropsSet method. Please refer to this article about prefixes for properties.

 Name
 Default value
 Description
" rate_control "
" false "
Makes the MFPreview object to control playback rate
" preview.background "
" checker "
Sets default background for preview.
Possible values:
  • "checker" - checker board as background is used
  • a path to a local file 
  • a hex-code of a color
" preview.skip_fields "
"0"
Sets a mode for skipping fields (for interlaced video only).
Possible values:
  • 0 - don't skip frames
  • 1 - skip top fields
  • 2 - skip bottom fields
" preview.downscale "
"1"
Downscales preview video to optimize performance.
Possible values:
  • 0 - don't use downscaling. In this mode, preview receives a full-sized frame (so if your preview panel is, for example, 640x480, it receives a fullHD frame of 1920x1080 and then the image is scaled according to the control size). It leads to higher performance of preview, but it is recommended for a full-screen preview where quality matters.
  • 1 - downscale vertically only. In this mode, preview receives an image with cut each other horizontal line (so instead of 1920x1080 frame, it receives 1920x540 surface that is scaled to the control size). It reduces CPU usage of a preview and keeps preview quality acceptable for controls that aren't big (not full screen).
  • 2 - downscale both vertically and horizontally. In this mode, preview receives an image that is 2 times reduced vertically and horizontally. It leads to lower CPU usage of preview process, but preview quality is poor in this case. Recommended for really small preview controls where quality is not important.
" preview.drop_frames "
" false "
Once enabled, an MPreview object can drop frames in case frame processing takes a long time.
" preview.buffers "
"0"
Sets buffer size of frames.
" preview.crop "
" 0.0%,0.0%,0.0%,0.0% "
Default preview crop configuration.
" deinterlace "
" true "
Enables deinterlacing mode.
" maintain_ar "
" true "
Makes MPreview object to maintain source aspect ratio. If disabled, the preview video stretches to the control size.
" direct3d.pixel_format "
" auto "
Sets pixel format for Direct3D-based preview.
" direct3d.scale_filter "
"2"
Sets scale filter for Direct3D-based preview.
" direct3d.scale_backbuffer "
" true "
Enables scaling for a back buffer for Direct3D-based preview.
" audio.buffer_size_msec "
"100"
Sets a buffer size for audio data in msec.
" on_frame.sync "
" false "
Makes OnFrame and OnFrameSafe events synchronous, so frame grabbing process won't continue until OnFrame event isn't over.
" on_frame.data "
" false "
Enables objects of OnFrame and OnFrameSafe events to contain MFrame data.
" on_event.sync "
" false "
Makes OnEvent and OnEventSafe events synchronous, so frame grabbing process won't continue until OnFrame event isn't over.
" events.use_window "
" true "
Use events (OnFrame, OnEvent, OnEventSafe and OnFrameSafe) in the thread of your application. If you use a service or an application without windows, then disable this mode.
" audio_renderer "
" "
Sets audio renderer that is used for preview. The empty string means default audio device.
" debug.test_tone "
" "
Sets a test tone in Hz. Debug-only property.
" audio.direct_sound "
" false "
Enables direct sound mode.
" wpf_preview "
" false "
Enables WPF preview. See more for details.
" wpf_preview.downscale "
"0"
Sets downscale parameter for WPF preview. See more for details.
" wpf_preview.update "
"30"
Sets update period for WPF preview. See more for details.
" register_object "
" true "
Once enabled, the MPreview object is registered to the system to gather statistics.
" object_name "
" MFPreview"
Default name of the object.
" overlay_rms "
" false "
Enables RMS overlay.
" overlay_rms.pos "
" 0.05 "
Specifies RMS overlay position relative to the left side.
" overlay_rms.color "
" green "
Specifies RMS overlay color.
" overlay_waveform "
" false "
Enables waveform overlay.
" overlay_waveform.pos "
" 0.3 "
Specifies the waveform overlay position relative to the center.
" overlay_waveform.color "
" "
Specifies the waveform overlay color.