Is there any way to save the webcam through HTML5?

9

I know there is a way (I've even used it on at least 5 systems that I've developed) to open the webcam through HTML5 and capture a photo (I do this using canvas ).

Html5 Camera Capture Sample

But I had a question: Can I capture this image from the camera, save it to a temporary video file, and then send it to the server?

    
asked by anonymous 06.11.2017 / 14:32

1 answer

1
The audio / video capture has been the Holy Grail of web development for a long time. For many years, we've been using browser plugins (Flash or Silverlight) to do this .. But everything has changed and refreshes itself over time, come on!

getUserMedia ()

  

If you do not know the story, it goes without saying that the way we   GetUserMedia () API is an interesting tale.

     

In recent years, a number of variations of   mediation. "Many colleagues recognized the need to   native devices on the web, but this has led to the   development of a new specification. Things have been so   confused that the W3C finally decided to form a working group. O   goal? Clean the mess. The DAP Working Group   device) had the task of consolidating and standardizing the   of proposals.

Example: Capturing HTML Media

  

HTML media capture was the first DAP attempt to standardize   the capture of media on the web. It works by overlaying <input type="file"> and adding new values to the accept parameter.

     

Users can take a screenshot of their own with the   webcam using capture = camera:

<input type="file" accept="image/*;capture=camera">
     

Recording a video or audio is similar:

<input type="file" accept="video/*;capture=camcorder">
<input type="file" accept="audio/*;capture=microphone">
     Very good, is not it? I particularly like the reuse of a   file entry. Semantically, that makes a lot of sense. The point   of this specific "API" lies in its ability to create   in real time (for example, processing live webcam data in a    and apply WebGL filters). Capturing HTML media only allows   burn a media file, or take a screenshot at a time.

     

Support:

     

Android 3.0 browser - one of the first implementations. Check out this   video to see it in action. Google Chrome for Android (0.16) My   recommendation is not to use it, unless you are working   with one of the above mobile browsers. Suppliers are   migrating to getUserMedia (). It is very unlikely that anyone else   implement long-term HTML capture.

To go deeper, access the hyperlinks that have been passed!

    
28.05.2018 / 19:51