Capture video from webcam


Is it possible to create an app that can capture videos from camera, selected by user (usually a webcam), and save the video stream to file?


Hello there,

It is fully possible with the HTML5 <video> tag.
Here is a tutorial from w3schools



Hi Eddy,

I am aware that video can be displayed in <video> tag. The question is to capture a video stream from webcam to a file.



So I got to the point that I can wrap the mediaStream with RecordRTC, which supposedly makes handling stream recording (record, pause, resume, stop) easier. However, I am not able to save the blob to file successfully. I noticed that if I use the save() from RecordRTC, it produces a working webm file, but only for download. When I try writing the blob content to file, I got another file with bigger size, but it does not play video.


I guess you get mediaStream in render process and want to save it in the main process. Maybe some problem when transfer blob from render process to main process through IPC. If I were you, I will double check the blob data before and after IPC transfering. If not exactly the same, a simple work with encode and decode will help.