Wednesday, 14 February 2018

html5 record video, record video from web application, js



to do this you have to use chrome or firefox.\

A normal/ official way is here:

https://github.com/addpipe/Media-Recorder-API-Demo

doc:
https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API

above will use a Recoder to "connect" to your camera stream and capture blobs into an array . when you click stop, it will build a webm file from captured blobs and you are ready to download it.

Note the captured blobs is not the normal blobs you can use directly, you cannot use them individually, as the first blob has header and the last blob should have special flags as well.

GIF recorder:

https://github.com/streamproc/MediaStreamRecorder

Above gives you a gif recorder.


it also has a whammy recorder for making video (webm), but it doesn't work. you can use whammy directly from here, very easy to use:

https://github.com/antimatter15/whammy

NPM is here:

https://www.npmjs.com/package/whammy

No comments:

Post a comment