简体   繁体   中英

Video - take snapshot

I'm capturing webcam data to a HTML5 video.

I now wish to take a snapshop and set the src of an image to the snapshot.

I've looked around and can only find examples that output to canvas - but I need it going to an img.

Any ideas?

Just one step further. You can use toDataURL() method to get the base64 data from the canvas, and then build a image with the data. Particularly, you can specify MIME type with the method as well, either JPG, PNG or else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM