Home    MontiVision DirectShow SDK Documentation Prev Next
MontiVision Development Kit
Product Release Notes
What's new?
Installation
Overview
Components
The MontiVision Workbench
How to use the Workbench
How to insert an Filter
How to make a connction between two filter
How to change filter properties
How to get mediatypes of a pin or connection
How to delete a connection
How to delete a filter
How to find a filter
How to select a filter, pin or connection
How to make a video visible
How to preview a video stream
Workbench Menus and Commands
File menu commands
Edit menu commands
View menu commands
Graph menu commands
Extras menu commands
Help menu commands
Context menu commands
Status Bar
Toolbar
Sorting Filters
MontiVision DirectShow Filter
Common filter functions
MV Absolute Difference
MV Advanced Optical Flow
MV Affine Transformation
MV Alignment
MV Audio Test Source
MV Batch Image File Source
MV Background Subtraction
MV Bayer To Gray
MV Bayer To RGB
MV Bitmap Overlay
MV Blob Counter
MV Blob Finder
MV BlockRecording
MV Buffer Access
MV Camera Calibration
MV Camera Syncronisation
MV Camera Undistortion
MV Color Filter
MV Color Channel Mixer
MV Color Space Converter
MV Color To Gray
MV Color Twist
MV Constant Framerate
MV Convolution
MV Cooccurrence
MV Crop
MV Deinterlace
MV DeInterlace Temporal
MV Delay
MV Demo Source
MV Demultiplexer
MV DPS Renderer
MV DPS Source
MV Dyadic Arithmetic
MV Dyadic Logic
MV Fast Color Filter
MV Frame Access
MV Gauge
MV GDI Overlay
MV Gray To Color
MV Image File Source
MV Image Grabber
MV Image File Renderer
MV Integral
MV Inverse
MV I/O Bool Source
MV I/O Comparator
MV I/O Logic
MV I/O Not
MV I/O Renderer
MV I/O RS232
MV I/O RS232 Trigger Source
MV I/O Switch Source
MV I/O Textfile Renderer
MV I/O Textfile Source
MV I/O To String
MV IP Camera Source
MV Look Up Table
MV Mean
MV Mean Profile
MV Merge Frames
MV Mirror
MV MJPEG Compressor
MV MJPEG Decompressor
MV Mondic Arithmetic
MV Mondic Logic
MV Morphology
MV Motion Detection
MV Motion Direction
MV Multi File Writer
MV Network Renderer
MV Network Source
MV Nonlinear Filter
MV Object Tracker
MV Optical Flow
MV Playlist Source
MV Polar
MV Presence Detection
MV Profile
MV Recording
MV ReInterlace
MV Resize
MV Resized Rotation
MV Rotate90
MV Rotation
MV Segmentation
MV Select Mediatype
MV Separate Fields
MV Smooth Sequence
MV Splitter
MV Text Overlay
MV Ticker Overlay
MV Topography
MV Trigger Source
MV Video File Overlay
MV Video Overlay
MV Video Scaler
MV Watchdog
MV Zoom
Filter Event Mechanism
MontiVision DirectShow Filter SDK
Create a new Filter SDK DLL
Implement your custom Algorithm
Register the Filter SDK DLL
Use the new DirectShow Filter
Debugging a DirectShow Filter
Configure a Filter SDK DirectShow Filter
MontiVision Smart ActiveX Control
MV Smart Control Functions
MV Smart Control Interfaces
IMVSmartControl
IMVSCFilterGraph
IMVSCFilterGraph2
IMVSCVideoWindow
IMVSCVideoWindow2
IMVSCFullScreen
IMVSCSetFile
IMVSCSetSourceFilter
IMVSCSelectInput
IMVSCSetupVideoStream
IMVSCSetupVideoStream2
IMVSCClock
IMVSCFilterProperties
IMVSCLog
IMVSCCameraControl
IMVSCFilterEvents
IMVSCMediaSeeking
IMVSCMediaSeeking2
IMVSCQualityProperties
IMVSCFilterData
IMVSCCommonProperties
IMVSCExtDeviceControl
IMVSCVideoControl
IMVSCAnalogVideoFormat
IMVSCTVTuner
IMVSCTVAudio
Application Development with the MV Smart Control
Visual Basic 6.0
Visual Basic .NET
Visual C++ 6.0
Visual C++ .NET
Borland Delphi
MV Smart Control Samples
AviPlay Sample
CropVideo Sample
DirFinder Sample
FindObject Sample
FullScreen Sample
ImageStream Sample
IP Camera Sample
LiveDraw Sample
LoadFromString Sample
LumeneraCameraProperties Sample
MotionDetection Sample
PutBitmap Sample
SendReceiveRS232 Sample
MV Smart Control How To's
How to handle Input Events (Mouse, Keyboard) of the Video Window
How to Select and Configure a Video Input Device
How to handle Multiple Video Outputs
How to use Fullscreen Functionality
How to access the Results of a MontiVsion DirectShow Filter
MontiVision Utility ActiveX Controls
Video Source Combo Box
Video Format Combo Box
Video Size Combo Box
Input Selection Combo Box
Frame Rate Combo Box
Seeking Slider
Filter Property Page Display
Trigger Button
MontiVision I/O Controls
MVIODisplay
MVIOMonitor
MVIOLed
MVIOOutput
VMR Wrapper ActiveX Control
MV VMR Wrapper Interfaces
IMVVMRWrapper
IMVVMRFilterConfig
IMVVMRMixerControl
IMVVMRMixerBitmap
MV VMR Wrapper Sample Applications
VMR Control Sample
VMR Bitmap Overlay Sample
Extended Video Source ActiveX Control
MV Extended Video Source Control Interfaces
IMVExtendedVideoSource Interface
IMVLumeneraCustomConfig Interface
_IMVExtendedVideoSourceEvents Interface
MontiVision Tools
Getting Started
Create a MontiVision Project
Create a MontiVision Project using the MontiVision Workbench
Create new DirectShow Filters using the MontiVision Filter SDK
Use the new DirectShow Filter in your MontiVision Project
Integrate the MontiVision Project into your Application
Distribute your Application
Distributing your Applications
Application Development Examples
Apply standard Image Processing Operators to a Video Stream
Process a Sequence of Still Images, Do Batch Processing
Make your Existing Algorithms DirectShow compatible
Creating your own Image/Video Processing DirectShow Filters
Access the Image Data of a Video Stream directly from within a Windows Application
Capture Still Images from a running Video Stream
Convert a Video Stream to a Sequence of Still Images or vice versa
Sample Applications using the Smart Control
Camera Calibration
Additional HowTo's
How to Set Up Visual C++ for the MontiVision Development Kit
How to Set Up Borland Delphi for the MontiVision Development Kit
How to Set Up Borland Delphi 2005 for the MontiVision Development Kit
Interface Reference
_IMVFilterPropertyControlEvents
_IMVSeekingSliderEvents
_IMVSmartControlEvents
_ISelectInputComboBoxEvents
_IVideoFormatComboBoxEvents
_IVideoSizeComboBoxEvents
_IVideoSourceComboBoxEvents
IMVAbout
IMVAdvancedOpticalFlow
IMVAdvancedOpticalFlow2
IMVAffineTransformation
IMVAlignment
IMVAudioTestSource
IMVAutoCalcSetup
IMVBackgroundSubtraction
IMVBatchFileSource2
IMVBatchFileSource3
IMVBatchFileSource
IMVBinary
IMVBitmapOverlay
IMVBitmapOverlay2
IMVBlobCounter
IMVBlobCounter2
IMVBlobCounter3
IMVBlobCounter4
IMVBlobFinder
IMVBlobFinder2
IMVBlobFinder3
IMVBlobPostProcessing
IMVBlobPreProcessing
IMVBlockRecording
IMVBufferAccess
IMVBufferAccessCallbackC
IMVBufferAccessCallbackVB
IMVCameraCalibration
IMVCameraSync
IMVCameraUndistortion
IMVColor
IMVColorChannelMixer
IMVColorTwist
IMVConstantFramerate
IMVConvolution
IMVCooccurrence
IMVCrop
IMVCrypt
IMVDeinterlace
IMVDeInterlaceTemporal
IMVDelay
IMVDemoSource
IMVDemoSource2
IMVDPSRenderer
IMVDPSSource
IMVDyArith
IMVDyLogic
IMVEnumAudioEncoder
IMVEnumVideoEncoder
IMVFastColor
IMVFilterData
IMVFilterEvents
IMVFilterInfo
IMVFilterPropertyControl
IMVFilterSDK
IMVFrameAccess
IMVFrameAccessCallbackC
IMVFrameAccessCallbackVB
IMVGauge
IMVGaugeCalculations
IMVGDIOverlay
IMVGray
IMVGrayToColor
IMVGrid
IMVHistogram
IMVHistogram2
IMVHistogram3
IMVImageCapture
IMVImageCapture2
IMVImageCapture3
IMVImageFileSource
IMVImageFileSource2
IMVImageFileSource3
IMVImageInfo
IMVIntegral
IMVIOBoolSource
IMVIOBoolSource2
IMVIOComparator
IMVIOIntRenderer
IMVIOIntSource
IMVIOIntSource2
IMVIOLogic
IMVIONot
IMVIORenderer
IMVIORS232
IMVIORS232DataASCII
IMVIORS232DataHex.htm
IMVIORS232RxTxConnection
IMVIORS232TriggerSource
IMVIOSwitchSource
IMVIOTextfileRenderer
IMVIOTextfileSource
IMVIOToString
IMVIPCameraSource
IMVIPCameraSource2
IMVLinFilter
IMVLookUpTable
IMVMask
IMVMean
IMVMeanProfile
IMVMerger
IMVMirror
IMVMonArith
IMVMonLogic
IMVMorphology
IMVMotionDetection
IMVMotionDetection2
IMVMotionDirection
IMVMultiFileWriter
IMVNetworkReceiveInfo
IMVNetworkRenderer
IMVNetworkRenderer2
IMVNetworkRenderer3
IMVNetworkSendInfo
IMVNetworkSource
IMVNetworkSource2
IMVNonLinFilter
IMVObjectTracker
IMVOpticalFlow
IMVOpticalFlow2
IMVPlaylist
IMVPlaylistSource
IMVPolar
IMVPresenceDetection
IMVProfile
IMVRecording
IMVRegionOfInterest
IMVReinterlace
IMVResize
IMVResizedRotation
IMVRotate90
IMVRotation
IMVSCAnalogVideoFormat
IMVSCCameraControl
IMVSCCommonProperties
IMVSCClock
IMVSCExtDeviceControl
IMVSCFilterData
IMVSCFilterEvents
IMVSCFilterGraph
IMVSCFilterGraph2
IMVSCFilterProperties
IMVSCFullScreen
IMVSCLog
IMVSCMediaSeeking
IMVSCMediaSeeking2
IMVSCQualityProperties
IMVSCSelectInput
IMVSCSetFile
IMVSCSetSourceFilter
IMVSCTVTuner
IMVSCTVAudio
IMVSCVideoControl
IMVSCSetupVideoStream
IMVSCSetupVideoStream2
IMVSCVideoWindow
IMVSCVideoWindow2
IMVSeekingSlider
IMVSetImageFormat
IMVSmartControl
IMVSeparateFields
IMVSmoothSequence
IMVTextOverlay
IMVTextOverlay2
IMVTextOverlay3
IMVTickerOverlay
IMVTickerOverlay2
IMVTopography
IMVTrigger
IMVTriggerFilter
IMVVideoFileOverlay
IMVVideoScaler
IMVVMRFilterConfig
IMVVMRMixerBitmap
IMVVMRMixerControl
IMVVMRWrapper
IMVWatchdog
IMVZoom
IMVZoomConfig
ISelectInputComboBox
IVideoFormatComboBox
IVideoSizeComboBox
IVideoSourceComboBox

MontiVision Smart ActiveX Control for easy DirectShow Development

Loading, saving and configuring a filter graph  

MontiVision Project Files (*.mvp) contain all the information necessary to build a fully functional filter graph configuration. The first step to take when using the   MV Smart Control for a vision application is to create a working "MVP" project file using the MV Worbench. Having created a fully functional graph in the MV Worbenchand saved it to an MVP file, you would be ready to load the project into your vision application. To do either load or save an MVP file, use the MV Smart Control's  IMVSCFilterGraph interface and call either the LoadConfig() or the SaveConfig() method. The UnloadConfig() method removes the filter graph configuration from the control and frees all resources, for example capture sources.

Once you have loaded the configuration, you can control it's running state with the Start(), Stop() and Pause() methods available from the  IMVSCFilterGraph  interface. You also have full access to the filter graph with the FilterGraphManager property from IMVSCFilterGraph  which contains a pointer to the IUnknown interface from the DirectShow filter graph manager. Use this interface to get the DirectShow interfaces from the filter graph manager (e.g. IFilterGraph2 or IMediaSeeking). To get the IUnknown interface from a filter, call the GetFilter() method from  IMVSCFilterGraph with the filter name from the filter. This method is useful for retrieving a configuration interface from a  DirectShow filter.

The last property from IMVSCFilterGraph is useful for debugging purposes. With the ExportFilterGraph property you can enable the export filter graph function from the MV Smart Control. If this property is enabled the  MV Workbench  will make the instantiated filter graph visible to the  "Connect to Graph" command from the file menu.

Displaying a video stream

The window from the control can be used to display the video stream from a video renderer. If your filter graph configuration has more than one video renderer, use the RendererFilter property in the  IMVSCVideoWindow interface to attach a video renderer to the control window. The IMVSCVideoWindow interface contains properties such as the UseAspectRatio, UseOriginalSize and Visible property. The VideoXResolution and VideoYResolution properties contains the original video stream resolution. To display the video without stretching set the control window size to the video resolution or use the UseOriginalSize property. 

The IMVSCVideoWindow interface contains the MessageDrain property. The message drain is a window handle that receives all input device messages (e.g. WM_CHAR) from the video window.

The MontiVision Smart Control also supports full-screen display of video. The interface that caters for this is  IMVSCFullScreen, which contains three properties: FullScreen, MonitorCount and Monitor. The MonitorCount property returns the number of available monitors while the Monitor property returns the current monitor used for the full-screen function. Set the FullScreen property to enable the full-screen feature.   

Slave video window function

In some cases a vision application contains more than one video stream. To display all video streams in such an application, you will need to include one  MontiVision Smart Control for each video stream. Use only one of these controls to load and control the filter graph (we will refer to this as the master control). The other controls are used as "slave video window controls". In such a scenario, call the SetVideoRenderer method from the  IMVSCVideoWindow interface to configure these slave controls. The SetVideoRenderer method will need the filter graph manager and the video renderer's filter name as parameters. These can be retrieved from the master control by using the FilterGraphManager property of the IMVSCFilterGraph interface.

Changing the video source

A well-known caveat with DirectShow application development is the support for different video sources within one filter configuration. The  MontiVision Smart Control  solves this problem with the  IMVSCSetSourceFilter interface which contains only one method: SetSourceFilter . This method replaces a video source filter, needing only the "Display Name" from the new video source and the name of the existing filter in the filter graph configuration. The "Display Name" from the new source filter describes in detail the video device. You can get the display name from the MV VideoSourceComboBox

Not only is it now possible to change the video source, but it is also possible before or after loading a configuration file. It is recommended however that you reload a configuration after changing the source filter. If you change the device within a loaded configuration it is possible, that the MV Smart Control can't rebuild the filter graph.  

Changing the video format

A video source can support many video formats. The  MontiVision Smart Control exposes the IMVSCSetupVideoStream interface for purposes of making such changes. 

  • To retrieve the video stream colour format (e.g. RGB24) use the GetVideoFormatCount and GetVideoFormatLabel methods. 
  • To retrieve the video stream resolution use the GetVideoSizeInfoCount and GetVideoSizeInfo.
  • To set a new format call SetVideoFormat. The GetCurrentVideoFormat method returns the currently used video format.

You can also use the   MV VideoFormatComboBox and MV VideoSizeComboBox the facilitate changes to the video format. It is not recommend that you change the video stream colour format because in some cases the MV Smart control will not be able to rebuild the filter graph after such a change. It is rather recommended that you allow DirectShow to select the best colour format from the device.

Selecting alternative inputs

Some capture devices have more than one video input. The IMVSCSelectInput interface from the MV Smart Control controls selection of these video inputs. You can use the MV SelectInputComboBox to select a video input. The other way is to use the methods from  IMVSCSelectInput. Start with IsAvailable to check if a video device has more than one video inputs. Retieve the number of inputs with InputCount and enumerate them GetInputLabel. The CurrentConnection method returns the currently connected video input. To proceed with selecting a specific video input call the Connect method.

Changing files for File Sink and File Source filters 

Filter graph configurations with file sink/source filter contain the path to the used file. To change these paths, the MV Smart Control exposes the  IMVSCSetFile interface. For the file sink filter use the SetSinkFile and GetSinkFile methods and for the file source filter use the SetSourceFile and GetSourceFile methods. You can call the methods before or after loading a filter configuration. However, it is recommend that you set the filter to valid paths before you load a filter configuration. If the a file source/sink filter uses a invalid path the MV Smart Control will not be able to connect to these filters.

Changing the folder for the   MV Batch Image File Source Filter

You can change the folder used by a   MV Batch Image File Source Filter in the same way as you would the files for file sink/source filters. The  IMVSCSetFile contains a SetBatchFolder and GetBatchFolder method to allow you to change the folder.

Open property dialogs from direct show filters

Most of the DirectShow Filters and all   MontiVision Filters  contains property pages to configure filter parameters. The  IMVSCFilterProperties interface from the MontiVision Smart Control contains some methods to enumerate these filters and displays dialogs with the filter property pages. To to enumerate the filter with property pages call the GetPropertyPageName method. Open a dialog with the ShowProperties method. If you want to close a dialog call the CloseProperties method. It is not  necessary to explicitly call CloseProperties because all dialogs are closed when the "OK" dialog button is pressed or if the filter configuration is unloaded.

Filter graph reference clock control

In some cases it is necessary to disable the reference clock in a filter graph. This might be necessary for example, if you wanted to process each frame of a video file. With the  IMVSCClock interface you call setup the reference clock from a filter graph. Call the Disable method to disable the reference clock, and use SetDefault to return to using the default cock. 

Handle Input Events from the Video Window

To handle input events from the video window such as mouse button clicks, set the  IMVSCVideoWindow::EnableVideoWindowEvents property. This will allow you to handle the input events with the  MV Smart Control Event Interface.

Log function

For debugging purposes the MontiVision Smart Control contains the IMVSCLog interface. It has two properties. The Enable property enables the log function and the Level property contains the minimum level for log messages. If the log function is enabled the  MontiVision Smart Control calls the LogMessage  method from the _IMVSmartControlEvents interface if a message is greater than or equal to the Level property.

Video Source Configuration

The IMVSCCameraControl interface contains methods to configure parameters such as contrast or brightness for a video source device. Use the methods in your application to change device parameters. The interface contains also methods to load and save all parameter from a video device into the registry.

Handle Events from MontiVision Imaging Filter

Lots of the MontiVision Imaging Filters fires events. The MontiVision Smart Control  propagates these events to the application. Event notification is enabled with the  IMVSCFilterEvents::Enable method. The _IMVSmartControlEvents::FilterEvent method is called on every event from an enabled  MontiVision Imaging Filter.

Use Media Seeking on Video Files

To navigate within a movie file the  MontiVision Smart Control provides the IMVSCMediaSeeking interface. It is based on the IMediaSeeking interface from DirectShow. To use this interface the  MontiVision Development Kit contains the MV SeekingSlider Control.

Save Filter Parameter into the Registry 

Most of the MontiVision Imaging Filters can load/save there parameter from/into the registry. The  IMVSCFilterData interface from the MontiVision Smart Control provides methodd to load and save filter parameter for a filter from a filter configuration.

Get Video Processing Information

To obtain certain information about the video processing (such as the frame rate) the   MontiVision Smart Control  provides the IMVSCQualityProperties interface.