Skip to main content

PlayMovieAction

PlayMovieAction [/A/Z] keyword [=value ] [, keyword [=value ]]

The PlayMovieAction operation is used to extract frames from a movie file.

Flags

/AUses alternate deprecated technology, AVI instead of MMF.
/ZErrors do not stop procedure execution. Use V_Flag to see if an error occurred.

Keywords

extractExtracts current frame into an 8-bit RGB image wave named M_MovieFrame. (ok to combine with frame=f ).
extract=eExtracts e frames into a single multframe wave named M_MovieChunk. This will have 3 planes for RGB and will have e chunks.
e=1 is the same as plain extract.
For e>1, the current time is automatically updated.
frame=fMoves to specified movie frame.
getIDReturns top movie ID number in V_Value. Do not use in same call with getTime.
getTimeReads current movie time into variable V_value (in seconds).
gotoBeginningGoes to beginning of movie.
gotoEndGoes to end of movie.
killCloses open movie.
loop=modeThe loop extraction method keyword was added in Igor Pro 8.00. It is no longer supported and is ignored.
open=fullPathOpens the specifed movie file to enable frame extraction. V_Flag is set to zero if no error occurred and V_Value is set to the file reference number.
ref=refNumThe ref keyword is used with all PlayMovieAction commands after using the open keyword to access a movie file. refNum must be the file reference number returned in V_Value in the open step.
The ref keyword is needed only if multiple files or windows are open. You can also use setFrontMovie to set the active movie.
setFrontMovie=id
Sets the movie with given id as the active movie file.
Do not use setFrontMovie and getID in the same call to PlayMovieAction.
startObsolete. Movie windows are no longer supported in Igor itself.
step=sMoves by s frames into movie (0 is same as 1, negative values move backwards).
stopObsolete. Movie windows are no longer supported in Igor itself.

Details

Operations are performed in the following order: kill, gotoBeginning, gotoEnd, frame, step, getTime, extract. kill overrides all other parameters.

If you want to extract a grayscale image, you can convert the RGB image into grayscale using the ImageTransform command like so:

PlayMovieAction extract
ImageTransform rgb2gray M_MovieFrame
NewImage M_RGB2Gray

When you are finished extracting frames, use the kill keyword to close the file.

To get a full path for use with the open keyword, use the PathInfo or Open /D/R commands.

Examples

These commands show how to determine the number of frames in a simple movie:

PlayMovieAction open = <full path to movie file>
PlayMovieAction gotoEnd, getTime
Variable tEnd = V_Value
PlayMovieAction step=-1, getTime
Print "frames = ", tEnd/(tEnd-V_value)
PlayMovieAction kill

See Also

Movies, PlayMovie, Displaying an Open File Dialog