How to do take snapshot image as binary data?

The VideoIO object defines a takeSnapshot method and a snapshot property. The application invokes the method to take a snapshot of the current video display. For live display, the snapshot uses the original video instead of the mirrored view. The following example code shows how to take the snap shot, get the value of the image data, and set the value of the image data, on this page.

// take the snapshot on video1's live display.
getFlashMovie('video1').callProperty('takeSnapshot');

// get the snapshot property as string of video1.
var snapshot = getFlashMovie('video1').getProperty('snapshot');

// set the snapshot property to video2.
getFlashMovie('video2').setProperty('snapshot', snapshot);

You can try out the demonstration by clicking on the "take snapshot" button once your video shows up.


The string value of the snapshot property is the Base64 encoded JPEG image data of the snapshot. Unlike regular Base64 encoding, this string does not contain new lines. The application can decode the string to JPEG bytes and write in a file on the back end if needed.