PlayMovieAction
PlayMovieAction [/A/Z] keyword [=value ] [, keyword [=value ]]
The PlayMovieAction operation is used to extract frames from a movie file.
Flags
| /A | Uses alternate deprecated technology, AVI instead of MMF. | |
| /Z | Errors do not stop procedure execution. Use V_Flag to see if an error occurred. | |
Keywords
| extract | Extracts current frame into an 8-bit RGB image wave named M_MovieFrame. (ok to combine with frame=f ). | |
| extract=e | Extracts 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=f | Moves to specified movie frame. | |
| getID | Returns top movie ID number in V_Value. Do not use in same call with getTime. | |
| getTime | Reads current movie time into variable V_value (in seconds). | |
| gotoBeginning | Goes to beginning of movie. | |
| gotoEnd | Goes to end of movie. | |
| kill | Closes open movie. | |
| loop=mode | The loop extraction method keyword was added in Igor Pro 8.00. It is no longer supported and is ignored. | |
| open=fullPath | Opens 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=refNum | The 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. | ||
| start | Obsolete. Movie windows are no longer supported in Igor itself. | |
| step=s | Moves by s frames into movie (0 is same as 1, negative values move backwards). | |
| stop | Obsolete. 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