Image Acquisition Interface for DirectShow File Reader

Interface: DirectFile
Revision: 24.11.7
Date: 2025-10-08

General

This page provides the documentation about the HALCON DirectFile interface for the Microsoft DirectShow File Reader application programming interface. Registered customers can download the latest revision of this interface from the MVTec WWW server.

System Requirements

Interface Versioning

MVTec interfaces for digital I/O and image acquisition are always compatible to a range of HALCON versions. Therefore, the versioning scheme both describes the compatibility of the interface and also the revision of the interface itself. An interface version always consists of three numbers, separated by dots, i.e. 24.11.5. The first two numbers describe the minimum HALCON version the interface is compatible with. For the example version 24.11.5 this means that the interface is compatible with all HALCON versions since HALCON 24.11. The last number describes the revision of the interface, in this example this is revision 5.

Installation

Only when installing or updating the interface manually follow these steps:

Limitations

In general, whether a file can be opened with the HALCON DirectFile interface or not strongly depends on the configuration of the system your application is running on. Typically, it is necessary that a suitable codec is installed. As a rule of thumb, when you can replay a file with GraphEdit it is most likely that you can also open it with the HALCON DirectFile interface. On a 64 bit operating system the HALCON architecture (32 or 64 bit) must match the architecture of the codec. For detailed information about the codecs on your system, see the Technical Support Information at the About dialog of Windows Media Player.

Parameters for info_framegrabber

Parameter Value List Type Kind Description
'bits_per_channel' [] Unused.
'camera_type' 'CAMFILE:' string pre-defined Syntax for camera configuration file.
'color_space' ['gray', 'rgb'] string pre-defined Values for color space.
'defaults' [1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1.0, 'false', 'default', '0', -1, 1] mixed pre-defined Default values for open_framegrabber.
'device' [] Unused.
'external_trigger' [] Unused.
'field' [] Unused.
'general' [] string pre-defined Information about the HALCON DirectFile interface.
'generic' [] Unsupported query.
'horizontal_resolution' 1 integer pre-defined Value list for horizontal resolution.
'image_height' [] Unsupported query.
'image_width' [] Unsupported query.
'info_boards' 'filter:<filter> | merit:<merit> | file:<file> | type:<type> | subtype:<subtype>' string dynamic Info about installed DirectShow filters:
  • filter is the name of this DirectShow filter.
  • merit is a value that defines which filters are preferred to build the capture filter graph. Standard values are shown by their name.
  • file is the DLL that contains this filter.
  • type and subtype list the media types of all input pins of this filter. Known media types are shown by their name, others by their GUID.
'parameters' ['<parameters>'] string pre-defined Pre-defined parameters of the HALCON interface.
'parameters_readonly' ['<parameters>'] string pre-defined Pre-defined read-only parameters of the HALCON interface.
'parameters_writeonly' ['<parameters>'] string pre-defined Pre-defined write-only parameters of the HALCON interface.
'port' [] Unused.
'revision' '<revision>' string pre-defined Revision number of the DirectFile interface.
'start_column' [] Unsupported query.
'start_row' [] Unsupported query.
'vertical_resolution' 1 integer pre-defined Value list for vertical resolution.

Parameters for open_framegrabber

Parameter Values Default Type Description
Name 'DirectFile' string Name of the HALCON interface.
HorizontalResolution --- Ignored.
VerticalResolution --- Ignored.
ImageWidth --- Ignored.
ImageHeight --- Ignored.
StartRow --- Ignored.
StartColumn --- Ignored.
Field --- Ignored.
BitsPerChannel --- Ignored.
ColorSpace 'gray', 'rgb' 'rgb' string Desired color space and thus the number of image channels of the resulting HALCON image.
Generic --- Ignored.
ExternalTrigger --- Ignored.
CameraType '<filename>' 'default' string The camera type parameter is used to specify the name of the video file to be opened. The name of the video file can either be given absolutely (e.g., "C:\\MyImages\\MyAVIFile.avi") or relatively to your environment setting %HALCONIMAGES%.
Device --- Ignored.
Port --- Ignored.
LineIn --- Ignored.

Parameters for set_framegrabber_param

Parameter Values Default Type Description
'frame_number' <number> integer Number of the next frame to be grabbed by grab_image or grab_image_async.
'grab_timeout' <milliseconds> 5000 integer Desired timeout (milliseconds) for aborting a pending grab. If -1 is specified, the timeout is set to INFINITE.

Parameters for get_framegrabber_param

There may exist additional read-only parameters with the following postfixes:

All these postfixed parameter names are not returned when calling info_framegrabber(.., 'parameters', ..) and are used to enable the easy parameterization via a generic graphical user interface, particularly the HDevelop Image Acquisition Assistant.

Parameter Values Default Type Kind Description
'bits_per_channel' <default> -1 integer pre-defined The value is not used, so a default value is returned.
'camera_type' '<filename>' 'default' string pre-defined Name of the camera configuration file.
'color_space' 'gray', 'rgb' 'rgb' string pre-defined Desired color space and thus the number of image channels of the resulting HALCON image.
'device' <default> '0' integer dynamic The value is not used, so a default value is returned.
'external_trigger' <default> 'false' string pre-defined The value is not used, so a default value is returned.
'field' '<default>' 'default' string pre-defined The value is not used, so a default value is returned.
'filter_graph' 'filter:<filter> | merit:<merit> | file:<file> | type:<type> | subtype:<subtype>' string dynamic Info about connected DirectShow filters:
  • filter is the name of this DirectShow filter.
  • merit is a value that defines which filters are preferred to build the capture filter graph. Standard values are shown by their name.
  • file is the DLL that contains this filter.
  • type and subtype list the media types of all input pins of this filter. Known media types are shown by their name, others by their GUID.
'first_frame' <number> integer dynamic Number of the first frame of the video stream.
'frame_number' <number> integer dynamic Number of the next frame to be grabbed by grab_image or grab_image_async.
'generic' <default> -1 mixed pre-defined The value is not used, so a default value is returned.
'grab_timeout' <milliseconds> 5000 integer pre-defined Current grab timeout in milliseconds.
'horizontal_resolution' <resolution> 1 integer pre-defined Current value of horizontal resolution.
'image_height' <default> 0 integer pre-defined The value is not used, so a default value is returned.
'image_width' <default> 0 integer pre-defined The value is not used, so a default value is returned.
'last_frame' <number> integer dynamic Number of the last frame of the video stream.
'line_in' <default> 1 integer pre-defined The value is not used, so a default value is returned.
'media_info' <media_info> string dynamic Info about the source file retrieved by the third-party library MediaInfo (see the System Requirements).
'name' 'DirectFile' string pre-defined Name of the HALCON interface.
'port' <default> -1 integer pre-defined The value is not used, so a default value is returned.
'revision' '<revision>' string pre-defined Revision number of the DirectFile interface.
'start_column' <column> 0 integer pre-defined Returns the current start column of the HALCON image.
'start_row' <row> 0 integer pre-defined Returns the current start row of the HALCON image.
'vertical_resolution' <resolution> 1 integer pre-defined Current value of vertical resolution.

Operator set_framegrabber_lut

Not supported by this interface.

Operator get_framegrabber_lut

Not supported by this interface.

Operator set_framegrabber_callback

Not supported by this interface.

Operator get_framegrabber_callback

Not supported by this interface.

Operator grab_image_start

Starts a new asynchronous grab. See also grab_image_start.

Operator grab_image

grab_image starts a new synchronous grab. See also grab_image. Note that the interface converts the image from the device to the desired image format specified by the parameters 'image_width', 'image_height', 'start_row', 'start_column', 'bits_per_channel', and 'color_space'.

Operator grab_image_async

grab_image_async returns an image and starts the next asynchronous grab. See also grab_image_async. Note that the interface converts the image from the device to the desired image format specified by the parameters 'image_width', 'image_height', 'start_row', 'start_column', 'bits_per_channel', and 'color_space'.

Operator grab_data

Not supported by this interface.

Operator grab_data_async

Not supported by this interface.

Operator close_framegrabber

This operator closes the device. See also close_framegrabber.

HDevelop Examples

For this interface there are the following examples available:

Usage of third-party libraries

This interface depends on third-party libraries. See the file third_party_directfile.txt in the HALCON base directory for copyright and license information. Libraries are used without modifications unless explicitly stated in the file.

You can request the source for those third-party libraries licensed under GPL or LGPL via email to info@mvtec.com with the subject "Request source code of third-party libraries".

Release Notes


Legal disclaimer regarding hyperlinks: This page may provide users with access by hypertext links to external, non-MVTec websites. Any such access is provided with the understanding that the contents of non-MVTec sites are beyond the control of MVTec Software GmbH, that MVTec Software GmbH makes no representations whatsoever about such sites, and that users shall proceed at their own risk. MVTec Software GmbH is not responsible for the privacy practices or the content of external, non-MVTec websites.
Copyright notes: © Copyright MVTec Software GmbH. All rights reserved. Unless otherwise stated, the copyright and similar rights in the contents of this page, including but not limited to all text, designs and images appearing herein, are copyrighted works owned by MVTec Software GmbH. "MVTec Software GmbH" and "HALCON" are registered trademarks of MVTec Software GmbH. All other brand names, designs, service marks and trademarks (whether or not registered) referenced or used herein are the property of their respective owners.