您的位置:首页 > 其它

How to do take snapshot image as binary data?

2012-12-20 22:23 381 查看


VideoIO Flash-based
audio and video communication

Home › Flash-VideoIO Tutorial


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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  VideoIO