dimanche 19 février 2017

Send flash video stream to JavaScript

I want to make a script that will help user to center his face in the capture preview. Some <div> that would keep his outline green if the face is kept in a defined area and red if the face goes out.

For capture, I use Webcam.js a library with Flash fail-back.
For tracking, I'm using Tracking.JS that can handle object detection from a video element.

The goal is to make a real time face positioning plugin.

Different preview modes of Webcam.js :

  • The HTML5 preview :

A video element created by WEBCAM.JS that has for src attribute the video stream of getUserMedia function. (The video is nice handled by TRACKING.JS)

  • The Flash preview (IE Fail-back):

A .swf object (webcam.swf) whos prompts access of camera, displays the preview -IN THE FLASH MOTOR- and when the user snaps, it send back the picture to Javascript.

HERE IS MY PROBLEM:

Is there a way to build/edit swf file to make it send the video stream to javascript ? (Instead of only the picture when the snap is fired) The goal is to TRACKING.JS as well the Flash's stream than HTML5's one.

Webcam.swf > Here is Github directory of Actionscript files.

Thank you.

Aucun commentaire:

Enregistrer un commentaire