Search code examples
javascriptopencvgoogle-nativeclient

Capturing video from web cam and process them with nacl - opencv


I'm planing to capture video using web cam and then process it with opencv and then finally show output on a web page with opencv-naclport in google native-client environment

The way i currently aware about is

  1. Capture video from webcam using MediaStreamTrack interface in javascript and

then

  1. Encode it to a base64String and send to the c++ module to process with opencv,

  2. In cpp module decode it back to Mat image and process and finally send it back to the browser to display.

So i would like to know it it possible to capturing video with VideoCapture class in opencv instead of using MediaStreamTrack and javascript. Is there any limitations for accessing webcam from opencv due to sandbox constrains and whether above approach is correct/appropriate for processing and outputting image using webcam.


Solution

  • No need of BASE64. Take a look at: https://developer.chrome.com/native-client/pepper_dev/cpp/classpp_1_1_media_stream_video_track