How to do take snapshot image as binary data?

如何通过Flash Video IO捕获视频快照并保存为二进制数据
本文详细介绍了使用Flash Video IO API捕获视频快照的方法,并将快照数据转换为二进制格式进行保存。通过简单的代码示例,演示了如何获取快照并应用到不同视频对象上。

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值