Movie2 (Movie2.dll) 14.0
Movie2 Functions

Functions

MOVIE2RECORDER CreateMovie2Recorder (Movie2_RecordingEngine Type)
 Create a new Movie2 recorder object for use with the other functions of this DLL. More...
 
MOVIE2RECORDER CreateMovie2RecorderEx (Movie2_RecordingEngine Type, IMG Image)
 Create a new Movie2 recorder object and immediately set the image to work on. More...
 
BOOL IsMovie2Recorder (MOVIE2RECORDER handle)
 Verify as good as possible that an input handle refers to a valid Movie2 Recording engine object. More...
 
long Movie2AddFrame (MOVIE2RECORDER Handle)
 Add a single frame from the image object that has been set for this recorder object to the AVI stream. More...
 
long Movie2GetAcqMode (MOVIE2RECORDER Handle, Movie2_AcqMode &Mode)
 Query the acquisition mode currently used by the recording engine. More...
 
long Movie2GetCompressorIndex (MOVIE2RECORDER Handle, long &Index)
 Get the index of the compressor to be used next time Movie2StartRecording is called. More...
 
long Movie2GetCompressorName (MOVIE2RECORDER Handle, long Index, char *szName, long BufferSize)
 Retrieve the friendly name of a compressor on this system. More...
 
long Movie2GetCompressorNameW (MOVIE2RECORDER Handle, long Index, wchar_t *szName, long BufferSize)
 Retrieve the friendly name of a compressor on this system. More...
 
long Movie2GetFrameRate (MOVIE2RECORDER Handle, double &FramesPerSecond)
 Retrieve the currently set frame rate. More...
 
long Movie2GetImage (MOVIE2RECORDER Handle, IMG &Image)
 Retrieve the image that is currently being used by the recording engine. More...
 
long Movie2GetIsRecording (MOVIE2RECORDER Handle, BOOL &IsRecording)
 Checks whether a recorder object is currently recording AVI streams to disk. More...
 
long Movie2GetNumAcquiredFrames (MOVIE2RECORDER Handle, long &FramesAcquired)
 Query the number of frames that have so far been acquired during the running acquisition. More...
 
long Movie2GetNumCompressors (MOVIE2RECORDER Handle, long &NumCompressors)
 Retrieve the number of compressors that has been found on the system. More...
 
long Movie2GetNumDroppedFrames (MOVIE2RECORDER Handle, long &FramesDropped)
 Query the number of frames that have so far been dropped during the running acquisition. More...
 
long Movie2GetSyncMode (MOVIE2RECORDER Handle, Movie2_SyncMode &Mode)
 Query the synchronization mode currently used by the recording engine. More...
 
long Movie2GetTargetFileName (MOVIE2RECORDER Handle, char *szBuffer, long &BufferSize)
 Retrieve the name of the currently set target file. More...
 
long Movie2GetTargetFileNameW (MOVIE2RECORDER Handle, wchar_t *szBuffer, long &BufferSize)
 Retrieve the name of the currently set target file. More...
 
long Movie2GetUseMetadata (MOVIE2RECORDER Handle, BOOL &Use)
 Query whether meta data are currently being written. More...
 
long Movie2PauseRecording (MOVIE2RECORDER Handle)
 Pause continuous recording of AVI data into a file. More...
 
long Movie2PreStartRecording (MOVIE2RECORDER Handle)
 Prepare the start of AVI recording. More...
 
long Movie2RegisterErrorCallback (MOVIE2RECORDER Handle, pfMovie2Error Callback, void *pUserData, long &Cookie)
 Register an Error callback that will be raised by the Movie2 recorder whenever an internal error occurred. More...
 
long Movie2RegisterImageSnappedCallback (MOVIE2RECORDER Handle, pfMovie2ImageSnapped Callback, void *pUserData, long &Cookie)
 Register an ImageSnapped callback that will be raised by the Movie2 recorder whenever a new image has been acquired. More...
 
long Movie2RegisterImageUpdatedCallback (MOVIE2RECORDER Handle, pfMovie2ImageUpdated Callback, void *pUserData, long &Cookie)
 Register an ImageUpdated callback that will be raised by the Movie2 recorder whenever the image handle in the recorder object changed its value. More...
 
long Movie2RegisterMetaDataCallback (MOVIE2RECORDER Handle, pfMovie2ProvideMetaData Callback, void *pUserData, long &Cookie)
 Register a MetaData callback that will be raised by the Movie2 recorder whenever new MetaData can be passed to the current frame into the AVI container. More...
 
long Movie2ResetAcquiredFramesCounter (MOVIE2RECORDER Handle)
 Reset the counter for acquired frames. More...
 
long Movie2ResetDroppedFramesCounter (MOVIE2RECORDER Handle)
 Reset the counter for dropped frames. More...
 
long Movie2SetAcqMode (MOVIE2RECORDER Handle, Movie2_AcqMode Mode)
 Set the acquisition mode to be used by the recording engine. More...
 
long Movie2SetCompressorIndex (MOVIE2RECORDER Handle, long Index)
 Set the index of the compressor to be used next time Movie2StartRecording is called. More...
 
long Movie2SetFrameRate (MOVIE2RECORDER Handle, double FramesPerSecond)
 Set the frame rate with which the recoding engine should record the video signal. More...
 
long Movie2SetImage (MOVIE2RECORDER Handle, IMG Image)
 Set the image to be used by the Movie2 recording engine. More...
 
long Movie2SetSyncMode (MOVIE2RECORDER Handle, Movie2_SyncMode Mode)
 Set the synchronization mode to be used by the Movie2 recording engine. More...
 
long Movie2SetTargetFileName (MOVIE2RECORDER Handle, const char *szFileName)
 Set the name of the file into which the AVI sequence is to be recorded. More...
 
long Movie2SetTargetFileNameW (MOVIE2RECORDER Handle, const wchar_t *szFileName)
 Set the name of the file into which the AVI sequence is to be recorded. More...
 
long Movie2SetUseMetadata (MOVIE2RECORDER Handle, BOOL Use)
 Specify whether or not meta data should be recorded while writing an AVI file. More...
 
long Movie2ShowCodecPropertyPage (MOVIE2RECORDER Handle, HWND hwndOwner)
 If possible, display the property page(s) of the currently selected video compression codec (the one set by the last call to Movie2SetCompressorIndex). More...
 
long Movie2StartRecording (MOVIE2RECORDER Handle)
 Start continuous recording of AVI data into a file according to the settings made before this method has been called. More...
 
long Movie2StopRecording (MOVIE2RECORDER Handle)
 Stop continuous recording of AVI data. More...
 
long Movie2UnregisterCallback (MOVIE2RECORDER Handle, long Cookie)
 Deregisters any previously registered callback. More...
 

Detailed Description

Function Documentation

◆ CreateMovie2Recorder()

MOVIE2RECORDER CreateMovie2Recorder ( Movie2_RecordingEngine  Type)

Create a new Movie2 recorder object for use with the other functions of this DLL.

Destruction through ReleaseObject.

Note
Recorder creation is only thread safe after the first recorder object has been successfully created!
Parameters
[in]TypeType of the recording engine to be used.
Returns
Pointer to the newly created recorder object or NULL.
Supported platforms:
Win32
Win64
Related Topics:
CreateMovie2RecorderEx
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ CreateMovie2RecorderEx()

MOVIE2RECORDER CreateMovie2RecorderEx ( Movie2_RecordingEngine  Type,
IMG  Image 
)

Create a new Movie2 recorder object and immediately set the image to work on.

Destruction through ReleaseObject.

Note
Recorder creation is only thread safe after the first recorder object has been successfully created!
Parameters
[in]TypeType of the recording engine to be used.
[in]ImageHandle of image object to work with.
Returns
Pointer to the newly created recorder object or NULL.
Supported platforms:
Win32
Win64
Related Topics:
CreateMovie2Recorder
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ IsMovie2Recorder()

BOOL IsMovie2Recorder ( MOVIE2RECORDER  handle)

Verify as good as possible that an input handle refers to a valid Movie2 Recording engine object.

Attention
As IsImage, this function should only be used with a great lot of extra care - it is usually preferable to maintain proper and tidy use of handles instead.
Parameters
[in]handleHandle to be verified.
Returns
TRUE if it is a valid Movie2 recording object, FALSE otherwise.
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2AddFrame()

long Movie2AddFrame ( MOVIE2RECORDER  Handle)

Add a single frame from the image object that has been set for this recorder object to the AVI stream.

It only is effective, if the acquisition mode has been set to Movie2_AcqAddFrame with Movie2SetAcqMode.

Parameters
[in]HandleHandle of recorder for which to add a frame.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetAcqMode()

long Movie2GetAcqMode ( MOVIE2RECORDER  Handle,
Movie2_AcqMode &  Mode 
)

Query the acquisition mode currently used by the recording engine.

You can change the current acquisition mode by calling Movie2SetAcqMode.

Parameters
[in]HandleHandle of recorder object for which to query the acquisition mode.
[out]ModeAcquisition mode currently set. See Movie2_AcqMode for possible modes.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetCompressorIndex()

long Movie2GetCompressorIndex ( MOVIE2RECORDER  Handle,
long &  Index 
)

Get the index of the compressor to be used next time Movie2StartRecording is called.

Note
This is not necessarily the recorder that is currently being used if this property has been set while recording! Default value will be 0 (uncompressed).
Parameters
[in]HandleHandle of recorder object.
[out]IndexIndex of the compressor to be used for the next recording.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetCompressorName()

long Movie2GetCompressorName ( MOVIE2RECORDER  Handle,
long  Index,
char *  szName,
long  BufferSize 
)

Retrieve the friendly name of a compressor on this system.

Use the function Movie2GetNumCompressors to check how many compressors have been found on the system.

Parameters
[in]HandleHandle of recorder object.
[in]IndexIndex of the codec for which to retrieve the name.
[in]szNamePointer to a buffer into which the friendly name of the codec should be written (including the terminating zero).
[in]BufferSizeSize of the buffer pointed to by szName.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetCompressorNameW()

long Movie2GetCompressorNameW ( MOVIE2RECORDER  Handle,
long  Index,
wchar_t *  szName,
long  BufferSize 
)

Retrieve the friendly name of a compressor on this system.

Use the function Movie2GetNumCompressors to check how many compressors have been found on the system.

Parameters
[in]HandleHandle of recorder object.
[in]IndexIndex of the codec for which to retrieve the name.
[in]szNamePointer to a buffer into which the friendly name of the codec should be written (including the terminating zero).
[in]BufferSizeSize of the buffer pointed to by szName.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetFrameRate()

long Movie2GetFrameRate ( MOVIE2RECORDER  Handle,
double &  FramesPerSecond 
)

Retrieve the currently set frame rate.

See the description of Movie2SetFrameRate for the interpretation of the frame rate.

Parameters
[in]HandleHandle of recorder object for which to retrieve the setting.
[out]FramesPerSecondCurrent frame rate.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetImage()

long Movie2GetImage ( MOVIE2RECORDER  Handle,
IMG &  Image 
)

Retrieve the image that is currently being used by the recording engine.

Parameters
[in]HandleHandle of recorder object.
[out]ImageImage handle object that is currently being used for recording.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetIsRecording()

long Movie2GetIsRecording ( MOVIE2RECORDER  Handle,
BOOL &  IsRecording 
)

Checks whether a recorder object is currently recording AVI streams to disk.

Parameters
[in]HandleHandle of recorder object to be checked.
[out]IsRecordingTRUE if it is currently recording, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetNumAcquiredFrames()

long Movie2GetNumAcquiredFrames ( MOVIE2RECORDER  Handle,
long &  FramesAcquired 
)

Query the number of frames that have so far been acquired during the running acquisition.

Usually the number is reset at the beginning of the acquisition. It may also be reset by a call to Movie2ResetAcquiredFramesCounter.

Parameters
[in]HandleHandle of recorder object to query.
[out]FramesAcquiredNumber of acquired frames.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetNumCompressors()

long Movie2GetNumCompressors ( MOVIE2RECORDER  Handle,
long &  NumCompressors 
)

Retrieve the number of compressors that has been found on the system.

Parameters
[in]HandleHandle of recorder object for which to check the number of available compressors.
[out]NumCompressorsNumber of compressors found on the computer.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetNumDroppedFrames()

long Movie2GetNumDroppedFrames ( MOVIE2RECORDER  Handle,
long &  FramesDropped 
)

Query the number of frames that have so far been dropped during the running acquisition.

Usually the number is reset at the beginning of the acquisition. It may also be reset by a call to Movie2ResetDroppedFramesCounter.

Parameters
[in]HandleHandle of recorder object to query.
[out]FramesDroppedNumber of dropped frames.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetSyncMode()

long Movie2GetSyncMode ( MOVIE2RECORDER  Handle,
Movie2_SyncMode &  Mode 
)

Query the synchronization mode currently used by the recording engine.

Parameters
[in]HandleHandle of recorder object for which to query the synchronization mode.
[out]ModeSynchronization mode currently set. See Movie2_SyncMode for possible modes.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetTargetFileName()

long Movie2GetTargetFileName ( MOVIE2RECORDER  Handle,
char *  szBuffer,
long &  BufferSize 
)

Retrieve the name of the currently set target file.

Parameters
[in]HandleHandle of recorder object for which to retrieve the file name.
[in]szBufferBuffer into which to receive the target file name.
[in]BufferSizeSize of the buffer pointed to by szBuffer. Upon leaving this function, BufferSize will contain the number of characters that have actually been written into the buffer.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetTargetFileNameW()

long Movie2GetTargetFileNameW ( MOVIE2RECORDER  Handle,
wchar_t *  szBuffer,
long &  BufferSize 
)

Retrieve the name of the currently set target file.

Parameters
[in]HandleHandle of recorder object for which to retrieve the file name.
[in]szBufferBuffer into which to receive the target file name.
[in]BufferSizeSize of the buffer pointed to by szBuffer. Upon leaving this function, BufferSize will contain the number of characters that have actually been written into the buffer.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2GetUseMetadata()

long Movie2GetUseMetadata ( MOVIE2RECORDER  Handle,
BOOL &  Use 
)

Query whether meta data are currently being written.

The Movie2RegisterMetaDataCallback has to be registered with which the MetaData can be written to the AVI file.

Meta data are (ANSI-) strings with up to 64k characters, one per image being recorded. For example, the MetaData can be used to save the corresponding timestamp as a string for every recorded frame within the AVI container.
To read out the MetaData you can implement the CVB Notify Interface (INotify) of the Driver.dll in your own application. If you prefer the Grabber OCX you can use the ImageNotificationString Event. As examples the VCMovie2PlayerExample and the CSMovie2PlayerExample are included in Movie2.

Note
Some media players or AVI Editors may get confused by the presence of a text stream in the AVI container. When an AVI Editor does not support the text stream the MetaData is lost after editing the AVI file. For Example VirtualDub with DirectStreamCopy writes only the text of the first frame to all other frames.
Our Movie Interactive 2 is the only application we know which can handle text streams as MetaData. So if you want to recompress your recorded movie and dont want to lose the MetaData use Movie Interactive 2.
Parameters
[in]HandleHandle of recorder object on which to query.
[out]UseTRUE if metadata are to be written, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Movie2RegisterMetaDataCallback
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2PauseRecording()

long Movie2PauseRecording ( MOVIE2RECORDER  Handle)

Pause continuous recording of AVI data into a file.

Parameters
[in]HandleHandle of recorder object for which to pause recording.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2PreStartRecording()

long Movie2PreStartRecording ( MOVIE2RECORDER  Handle)

Prepare the start of AVI recording.

This method may be called any time prior to Movie2StartRecording to speed up the initialization process and allow the recorder to react to the "start" signal more promptly. If it has not been called prior to Movie2StartRecording, Movie2StartRecording will call Movie2PreStartRecording to do the necessary initializations.

Parameters
[in]HandleHandle of recorder object for which to prepare recording start.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2RegisterErrorCallback()

long Movie2RegisterErrorCallback ( MOVIE2RECORDER  Handle,
pfMovie2Error  Callback,
void *  pUserData,
long &  Cookie 
)

Register an Error callback that will be raised by the Movie2 recorder whenever an internal error occurred.

Callback has to be unregistered with Movie2UnregisterCallback.

Note
This covers only those errors that cannot be reported by means of a return value.
Parameters
[in]HandleHandle of recorder object on which to register the callback.
[in]CallbackCallback to be registered.
[in]pUserDataUser data to go with the callback.
[out]CookieCookie issued during registration of the callback.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Callback definition: pfMovie2Error
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2RegisterImageSnappedCallback()

long Movie2RegisterImageSnappedCallback ( MOVIE2RECORDER  Handle,
pfMovie2ImageSnapped  Callback,
void *  pUserData,
long &  Cookie 
)

Register an ImageSnapped callback that will be raised by the Movie2 recorder whenever a new image has been acquired.

Callback has to be unregistered with Movie2UnregisterCallback.

Parameters
[in]HandleHandle of recorder object on which to register the callback.
[in]CallbackCallback to be registered.
[in]pUserDataUser data to go with the callback.
[out]CookieCookie issued during registration of the callback.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Callback definition: pfMovie2ImageSnapped
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2RegisterImageUpdatedCallback()

long Movie2RegisterImageUpdatedCallback ( MOVIE2RECORDER  Handle,
pfMovie2ImageUpdated  Callback,
void *  pUserData,
long &  Cookie 
)

Register an ImageUpdated callback that will be raised by the Movie2 recorder whenever the image handle in the recorder object changed its value.

Callback has to be unregistered with Movie2UnregisterCallback.

Parameters
[in]HandleHandle of recorder object on which to register the callback.
[in]CallbackCallback to be registered.
[in]pUserDataUser data to go with the callback.
[out]CookieCookie issued during registration of the callback.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Callback definition: pfMovie2ImageUpdated
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2RegisterMetaDataCallback()

long Movie2RegisterMetaDataCallback ( MOVIE2RECORDER  Handle,
pfMovie2ProvideMetaData  Callback,
void *  pUserData,
long &  Cookie 
)

Register a MetaData callback that will be raised by the Movie2 recorder whenever new MetaData can be passed to the current frame into the AVI container.

Will only be raised if UseMetadata is set to TRUE. Callback has to be unregistered with Movie2UnregisterCallback.

Meta data are (ANSI-) strings with up to 64k characters, one per image being recorded. For example, the MetaData can be used to save the corresponding timestamp as a string for every recorded frame within the AVI container.
To read out the MetaData you can implement the CVB Notify Interface (INotify) of the Driver.dll in your own application. If you prefer the Grabber OCX you can use the ImageNotificationString Event. As examples the VCMovie2PlayerExample and the CSMovie2PlayerExample are included in Movie2.

Note
Please note that some media players may get confused by the presence of a text stream in the AVI container. When an AVI Editor does not support the text stream the MetaData is lost after editing the AVI file. For Example VirtualDub with DirectStreamCopy writes only the text of the first frame to all other frames.
Parameters
[in]HandleHandle of recorder object on which to register the callback.
[in]CallbackCallback to be registered.
[in]pUserDataUser data to go with the callback.
[out]CookieCookie issued during registration of the callback.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Movie2GetUseMetadata, Movie2SetUseMetadata
Movie2UnregisterCallback
Callback definition: pfMovie2ProvideMetaData
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example
Sample Code in Visual C++:
CVCMovie2ExampleDlg.h
//...
long m_MetaDataCallbackCookie;
std::string m_CurrentMetaData;
static void CALLBACK MetaDataCallback ( MOVIE2RECORDER Recorder, char* szMetaData, long BufferSize, void* pUserData);
//...
CVCMovie2ExampleDlg.cpp
// Callback definition
void CALLBACK CVCMovie2ExampleDlg::MetaDataCallback( MOVIE2RECORDER Recorder, char* szMetaData, long BufferSize, void* pUserData)
{
// Get Pointer to Dialog class from UserData
CVCMovie2ExampleDlg* myDlg = reinterpret_cast<CVCMovie2ExampleDlg*>(pUserData);
// Copy MetaData from m_CurrentMetaData to szMetaData
myDlg->m_CurrentMetaData.copy(szMetaData,BufferSize);
}
BOOL CVCMovie2ExampleDlg::OnInitDialog()
{
// ...
// Register Callback
Movie2RegisterMetaDataCallback(m_Recorder,&MetaDataCallback,this,m_MetaDataCallbackCookie);
// activate the use of MetaData
Movie2SetUseMetadata(m_Recorder,true);
// ...
}
// ImageSnaped event handler
void CVCMovie2ExampleDlg::ImageSnapedCvimagectrl1()
{
if(isRecording)
{
m_CurrentMetaData = "e.g a Timestamp as MetaData";
Movie2AddFrame(m_Recorder);
}
m_cvDisp.Refresh();
}
CVCMovie2ExampleDlg::~CVCMovie2ExampleDlg(void)
{
Movie2UnregisterCallback(m_Recorder,m_MetaDataCallbackCookie);
ReleaseObject(m_Recorder);
}
long Movie2SetUseMetadata(MOVIE2RECORDER Handle, BOOL Use)
Specify whether or not meta data should be recorded while writing an AVI file.
Definition: Movie2Export.cpp:1486
long Movie2AddFrame(MOVIE2RECORDER Handle)
Add a single frame from the image object that has been set for this recorder object to the AVI stream...
Definition: Movie2Export.cpp:1435
long Movie2RegisterMetaDataCallback(MOVIE2RECORDER Handle, pfMovie2ProvideMetaData Callback, void *pUserData, long &Cookie)
Register a MetaData callback that will be raised by the Movie2 recorder whenever new MetaData can be ...
Definition: Movie2Export.cpp:988
long Movie2UnregisterCallback(MOVIE2RECORDER Handle, long Cookie)
Deregisters any previously registered callback.
Definition: Movie2Export.cpp:1019

◆ Movie2ResetAcquiredFramesCounter()

long Movie2ResetAcquiredFramesCounter ( MOVIE2RECORDER  Handle)

Reset the counter for acquired frames.

Parameters
[in]HandleHandle of recorder object. to be reset.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2ResetDroppedFramesCounter()

long Movie2ResetDroppedFramesCounter ( MOVIE2RECORDER  Handle)

Reset the counter for dropped frames.

Parameters
[in]HandleHandle of recorder object to be reset.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2SetAcqMode()

long Movie2SetAcqMode ( MOVIE2RECORDER  Handle,
Movie2_AcqMode  Mode 
)

Set the acquisition mode to be used by the recording engine.

Inquire the currently set acquisition mode with Movie2GetAcqMode.

Parameters
[in]HandleHandle of recorder object for which to set the acquisition mode.
[in]ModeAcquisition mode to be set. See Movie2_AcqMode for possible modes.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Movie2_AcqMode, Movie2GetAcqMode
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2SetCompressorIndex()

long Movie2SetCompressorIndex ( MOVIE2RECORDER  Handle,
long  Index 
)

Set the index of the compressor to be used next time Movie2StartRecording is called.

Note
Changing this value during a recording is in progress will not have any effect. Default value will be 0 (uncompressed).
Parameters
[in]HandleHandle of recorder object on which to change the value.
[in]IndexIndex of the compressor to be used. 0 = uncompressed.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2SetFrameRate()

long Movie2SetFrameRate ( MOVIE2RECORDER  Handle,
double  FramesPerSecond 
)

Set the frame rate with which the recoding engine should record the video signal.

Note
This is usually just an information inside the resulting video file. If you specify a frame rate of 25 here, but your signal was recoded at 30 fps then playback will happen with 25 frames per second - which is visibly slower than real time.
So this frame rate property has no connection to the rate at which the video signal was acquired, and it is the responsibility of the programmer writing a Movie2 application to set the frame rate to a value that reasonably represents the frame rate of his acquisition device (if unsure, consult the manuals of your acquisition device(s) for details about the frame rate or contact the vendor.
Parameters
[in]HandleHandle of recorder object for which to set the value.
[in]FramesPerSecondFrame rate to be set.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Visual Basic - VB.Net Movie2 Example

◆ Movie2SetImage()

long Movie2SetImage ( MOVIE2RECORDER  Handle,
IMG  Image 
)

Set the image to be used by the Movie2 recording engine.

Parameters
[in]HandleHandle of recorder object for which to set the image.
[in]ImageHandle of the image to be used for recording.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2SetSyncMode()

long Movie2SetSyncMode ( MOVIE2RECORDER  Handle,
Movie2_SyncMode  Mode 
)

Set the synchronization mode to be used by the Movie2 recording engine.

Note
When not working in Event driven mode (Movie2AddFrame), then the Movie2_SyncMode tells when the client should be informed about the arrival of a new image: Movie2_SyncAfterCopy means that the ImageSnapped events will fire after the copy Movie2_SyncBeforeCopy mean that they will fire before the copy.
Parameters
[in]HandleHandle of recorder object for which to set the synchronization mode.
[in]ModeSynchronization mode to be set. See Movie2_SyncMode for possible modes.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Movie2_SyncMode, Movie2GetSyncMode
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2SetTargetFileName()

long Movie2SetTargetFileName ( MOVIE2RECORDER  Handle,
const char *  szFileName 
)

Set the name of the file into which the AVI sequence is to be recorded.

Attention
If the target file exists it will be overwritten.
Parameters
[in]HandleHandle of recorder object.
[in]szFileNameName of the AVI file to be generated.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2SetTargetFileNameW()

long Movie2SetTargetFileNameW ( MOVIE2RECORDER  Handle,
const wchar_t *  szFileName 
)

Set the name of the file into which the AVI sequence is to be recorded.

Attention
If the target file exists it will be overwritten.
Parameters
[in]HandleHandle of recorder object.
[in]szFileNameName of the AVI file to be generated.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2SetUseMetadata()

long Movie2SetUseMetadata ( MOVIE2RECORDER  Handle,
BOOL  Use 
)

Specify whether or not meta data should be recorded while writing an AVI file.

Note
Note that not all engines may support meta data and others may support meta data depending on the recording mode only. The callback has to be registered with Movie2RegisterMetaDataCallback with which the MetaData can be written to the AVI file.

Meta data are (ANSI-) strings with up to 64k characters, one per image being recorded. For example, the MetaData can be used to save the corresponding timestamp as a string for every recorded frame within the AVI container.
To read out the MetaData you can implement the CVB Notify Interface (INotify) of the Driver.dll in your own application. If you prefer the Grabber OCX you can use the ImageNotificationString Event. As examples the VCMovie2PlayerExample and the CSMovie2PlayerExample are included in Movie2.

Note
Some media players may get confused by the presence of a text stream in the AVI container. When an AVI Editor does not support the text stream the MetaData is lost after editing the AVI file. For Example VirtualDub with DirectStreamCopy writes only the text of the first frame to all other frames.
Parameters
[in]HandleHandle of recorder object on which to set.
[in]UseTRUE if metadata are to be written, FALSE otherwise.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Movie2RegisterMetaDataCallback
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example
Sample Code in Visual C++:
For an example see the Movie2RegisterMetaDataCallback function.

◆ Movie2ShowCodecPropertyPage()

long Movie2ShowCodecPropertyPage ( MOVIE2RECORDER  Handle,
HWND  hwndOwner 
)

If possible, display the property page(s) of the currently selected video compression codec (the one set by the last call to Movie2SetCompressorIndex).

Note
To display the property page is not possible while the recorder is recording.
Parameters
[in]HandleHandle of recorder object.
[in]hwndOwnerHandle of parent form.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2StartRecording()

long Movie2StartRecording ( MOVIE2RECORDER  Handle)

Start continuous recording of AVI data into a file according to the settings made before this method has been called.

If you want to speed up the Movie2StartRecording you can use Movie2PreStartRecording to initialize the recording.

Parameters
[in]HandleHandle of recorder object for which to start recording.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Movie2PreStartRecording
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2StopRecording()

long Movie2StopRecording ( MOVIE2RECORDER  Handle)

Stop continuous recording of AVI data.

Parameters
[in]HandleHandle of recorder object for which to stop recording.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Related Topics:
Movie2PreStartRecording
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ Movie2UnregisterCallback()

long Movie2UnregisterCallback ( MOVIE2RECORDER  Handle,
long  Cookie 
)

Deregisters any previously registered callback.

Parameters
[in]HandleHandle of recorder object on which to deregister a callback.
[in]CookieCookie that has been issued upon the callbacks.
Returns
0 : OK
< 0: an error occurred
Supported platforms:
Win32
Win64
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example