wonglik
wonglik

Reputation: 1069

Is it possible to record video stream in Chrome Plugin using NaCL / PPAPI?

I am trying to record stream from html5 video tag and since I can not achieve 60FPS in JS with canvas I was wondering can I do it from chrome plugin?

Any ideas is it even possible and what are the places to start?

thanks w

Upvotes: 2

Views: 3477

Answers (3)

0xcaff
0xcaff

Reputation: 13681

You can accomplish this by using the chrome.desktopCapture or navigator.getUserMedia and MediaStreamRecorder APIs. chrome.desktopCapture and navigator.getUserMedia are experimental and MediaStreamRecorder is still unimplemented in chrome.

Currently there is no way to accomplish 60FPS recording in chrome, but support is on the way!

There are .webm encoders with caveats. Try whammy.js

NaCl support for manipulating streams is on the bleeding edge and should allow you to record to a file. Bleeding to stable takes approximately 11 weeks.

Upvotes: 3

dmichael
dmichael

Reputation: 21

(I have zero stackoverflow reputation, so I can't comment on answers, but I can submit answers???).

rwu's answer is going to be the best going forward. The new MediaStreamTrack Pepper interfaces should be working on dev channel and Canary Chrome, if you build with a very recent NaCl SDK (probably canary would be best).

The API is here for video: https://code.google.com/p/chromium/codesearch#chromium/src/ppapi/cpp/media_stream_video_track.h&l=27

It's experimental, dev-channel, so it's subject to change, and it is not available to all users yet. But it's being worked on right now and should only get better & faster over time. We hope to support it as a stable API in a coming version of Chrome.

If you want to get the best performance, and you're willing to bear with some churn, and don't need something you can ship today, please start experimenting with that API and file bugs at new.crbug.com.

Upvotes: 1

rwu
rwu

Reputation: 9

If what you want is to record a MediaStream, the MediaStreamRecorder probably the best option. However as caffinatedmonkey pointed out, it's not yet implemented in chrome. crbug.com/262211 tracks this work.

However there's another option with a new set of ppapi (added in chrome 34, currently under experiment) which allows the plugin to get audio/video data from a mediastreamtrack. I think that may fit your need. For detail, please take a look at the examples in below links: http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/examples/media_stream_audio/ http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/examples/media_stream_video/

Upvotes: 0

Related Questions