revVideoFrameImage

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
revVideoFrameImage <frameWidth>, <frameHeight>, <dataVariable>
Associationsvideo library
Summary

Puts the current frame in the video grabber into a variable.

Introduced2.0
Changes

Support for the "Video Grabber" library on Mac OS X ended in LiveCode 9.0.

OSwindows
Platformsdesktop
Parameters
NameTypeDescription
frameWidth

A positive integer.

frameHeight

A positive integer.

dataVariable

The name of an existing variable.

Example
revVideoFrameImage 400,300,"myData"
revVideoFrameImage the width of image "Snapshot",\
   the height of image "Snapshot","thisFrame"
RelatedProperty: pixels, imageData
Glossary: LiveCode custom library, property, binary file, variable, frame, return, Standalone Application Settings, video grabber, standalone application, command
Library: Video library
Keyword: image
Object: image
Function: format, value
Control Structure: function
Command: revPreviewVideo, revRecordVideo
Securitydisk, privacy
Description

Use the revVideoFrameImage command to capture a single frame of video.

The revVideoFrameImage command returns binarydata in the same format as the imageData property of images, placing it in the dataVariable. To show the captured frame in an image, set the image's imageData property to the value placed in the dataVariable, as in the following example:

put empty into frameContainer
revVideoFrameImage 400,300,"frameContainer"
set the imageData of image "Picture" to frameContainer

If the frameWidth and frameHeight are not the same as the width and height of the video grabber window, the frame is scaled before being returned by the revVideoFrameImage function. The data returned by the command always uses the frameWidth and frameHeight, even if this means the video must be stretched or shrunk to fit. For example, if the video grabber window is 100 x 100 pixels, but you specify 200 as the frameWidth and 100 as the frameHeight, the returned data fits an image 200 x 100 pixels, with the horizontal dimension stretched to fit.

Important: The revVideoFrameImage command is part of the Video library. To ensure that the command works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Video Grabber" library checkbox is checked.

Tagsmultimedia