Is it possible to record video stream in Chrome Plugin using NaCL / PPAPI? - google-chrome-app

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

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.

(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.

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/

Related

Flutter share native objects between plugins

I am working on a couple plugins for streaming and recording video. In Android land it is generally not possible to have two things access the camera simultaneously.
The obvious solution is to merge the two plugins into one that marshals/shares the resource.
This got me thinking. Is there any way to share native objects between plugins? I cannot find any documentation or resources on this.
Does anyone have a suggestion on how to achieve this?
I've been doing similar stuff - not with video but with raw data, and it is possible. There are two major approaches:
Share data between the packages via flutter medium - method + event channels with the proper implementation in all plugins.
Since you would have to implement a lot of boilerplate either way in both ios and android platforms, you as well may implement all the sharing directly in the native code. After all, you have access to all the plugins' native code in the native part of your flutter app. Just channel the data there correctly without including flutter at all(well, not at all - in the end, some trigger methods/events should exist either way).
I went down the second path, and it was not that hard to do. I'm not sure about your use case, but sharing the video stream between several end recipients is possible, so it should also be possible in the flutter app.

Cross browser extension development framewok

I was evaluating the development of a cross browser extension (supported browsers IE, Chrome, Safari and Firefox): I was looking for a cross-browser development framework, in order to avoid the code duplication and to fasten the building process.
I had a look at this question, and I visited the suggested websites: every company seems to have stopped working on the product.
I read this article too, whose conclusion seems to dissuade developer from the building of a cross browser extension.
So, I have a few questions:
- Does anyone of you recommend a cross browser extension development framework, which is suitable for the purpose I described above?
- Is there a reason why the above frameworks are not maintained anymore?
- Does anyone discovered a more efficient way to pursue the same aim without developing a browser extension?
Thanks so much,
Daniele
I not tested it yet, but Firefox WebExtensions seems to be best choice. Yes, you must make some changes to code, but usually it is not that bad.
WebExtensions APIs are inspired by the existing Google Chrome
extension APIs, and are supported by Opera, Firefox, and Microsoft
Edge. We’re working to standardize these existing APIs as well as
proposing new ones! Our goal is to make extensions as easy to share
between browsers as the pages they browse, and powerful enough to let
people customize their browsers to match their needs.
You can take a look at Plasmo. It's by their words:
The Plasmo Framework is a battery-packed browser extension SDK made by hackers for hackers. Build your product and stop worrying about config files and the odd peculiarities of building browser extensions.
Even it's in early development stage, it has features like:
First-class React and TypeScript support
Hot reload
Support of .env files
Automated deployment

Writing a forms based 'web application' targetting blackberry, iphone and android

This question has been asked in various guises. However. this is a slightly different take on things. By web application, I mean an ultra lightweight frontend - ideally an HTML page with form and regular buttons, with as little dependence on heavyweight JS libraries like jQuery as possible.
The goal is simple. I want to write a simple forms based application for use accross various mobile devices. I thought going the HTML route would be the simpler route (since browsers get around the whole cross platform issue) but even the browser approach seems problematic because of differing screen sizes on mobiles.
I have two questions:
For a simple form based application like I have in mind (possible 3-4 screens in total), I think the browser based approach gives more bang for my buck - am I missing a trick?
Are there any resources that someone can point me to for:
a useful reference for minimum (i.e. lowest common denominator) window size (I forget the technical term for the visible part of a page)
perhaps an example that will show a simple HTML page that will render correctly accross multiple devices?
The HTML5 mobile boilerplate will probably answer a lot of the questions about how to best get things to work across browsers:
http://html5boilerplate.com/mobile/
They have example markup and template implementations for things like browser/device specific CSS hacks, getting a custom launcher icon across different device styles, and implementing offline digest.
You really need to answer two questions before you pick a platform. First, what mobile devices and/or device capabilities are your lowest common denominator? There are lots of variable capabilities between most of those platforms -- screen size, input method, platform speed and mobile platform to name a few. Second, what is your connection requirement? Completely different issue building something targeting spotty or no connectivity versus a fully connected app.
Then you can start thinking about what tool(s) might get you there. In general, a very, very simple HTML site will look okish on most platforms you list. I wouldn't roll with HTML5 functionality because you've got serious limitations there. And HTML/web apps are kind of moot if you need things to work with limited connectivity.
iOS (webkit), Android (webkit) and BB OS6 (webkit-ish), are fairly easy to develop for.
Windows 7 should be, but who knows? They aren't promising HTML5 support until end of year.
BB OS5 browser sucks if you hope to be doing DOM manipulation or fancy JS event listeners. It's really buggy.
Nokia...it's a crap shoot. Granted, they have about one year left before they ditch their OS anyways.
Screen sizes are an issue, as is the fact you can change the orientation. But that can be gotten around with some careful planning.
HTML5/CSS/JS is definitely the way forward for making cross-platform apps as easy as possible...be it in the browser, or as a compiled app.

Call REST Webservice from Blackberry

I am new to Blackberry app development. I need to call REST webservice from blackberry application using JDE 4.7. I searched but not got any solution. Anyone help pls?
sri
You have to make an HttpConnection request and read the data as an InputStream... have a look at this tutorial Calling REST based web services
I appreciate this an old post - but it has been updated so someone is looking at it, so I thought it appropriate to contribute.
I am sorry, but I can not recommend the code supplied the link from another answer called "Calling REST based web services".
I have made a comment explaining this on the site, along the following lines:
"In my opinion this code is flawed because it does not consider the different connection methods, nor does it consider different encodings. More over it does not consider the Event Thread or provide reasonable error checking and logging. I appreciate that this is just a sample, but I think the author has a responsibility to make people who might use this code aware of how it should be used properly. And this code will cause more problems that it solves. Refer to the supported BlackBerry documentation and web sites for better samples."
Sorry, I am not as familiar as I should be of the questions asked on stackoverflow, but questions like this come up regularly on the BBRY forum here:
http://supportforums.blackberry.com/t5/Java-Development/bd-p/java_dev
I recommend that you go on that forum and type network in the Search box on that site and you be presented with a range of tutorials and KB articles that discuss all aspects of networking. In this particular case I would recommend this:
http://supportforums.blackberry.com/t5/Java-Development/What-Is-Network-API-alternative-for-legacy-OS/ta-p/614822
Networking is not trivial on the BlackBerry, do not expect a cut and paste of the code supplied to work for you. Specifically you should be aware of:
a) The various connection methods, the costs associated with each and the impact that using each might have (e.g. transcoders or caching)
b) The Event Thread, how to get off it and back on when processing a response
c) Logging and reporting so that you can investigate problems when they occur (and they will).
Personally, given that all OS 4.7 devices can be upgraded to OS 5.0 and should be, since OS 5.0 is better, I would forget supporting OS 4.7. Instead look at OS 5.0 and above support and use ConnectionFactory.

options for producing audio with GWT

What options are there for producing audio in a GWT app? I'm thinking of making a simple game, but I'm disappointed to see that there's still not much progress on audio support directly in GWT (yes, I realize that's largely due to lack of underlying browser support; looking forward to HTML5!)
This blog post says that "audio support in GWT is rapidly evolving", yet I don't see updates in over a year, at least not at that site. It seems these are the available options:
GWT Voices
GWT SoundManager
GWT Sound
GWT Incubator (all of the audio APIs seem deprecated here)
I believe most of these (all of them?) rely on Flash to produce audio. I'm most inclined to go with the GWT Incubator, as that's where features slated for inclusion in GWT get started, but I've no real recommendations to go on. I would appreciate hearing about your experiences with any of these libraries, thanks.
GWT Voices is written by Fred Sauer. He seems to be very closely affiliated with GWT. I've used his drag and drop code before, and found it quite well documented and frequently updated. Also, he seems responsive to questions in the forum. (I have no affiliation!)
I don't know anything about the others.
Most of the aforementioned SoundManager2 wrappers are dated and no longer supported. Gwt Voices is a good project, but lacks a lot of the functionality that is provided by a mature and proven solution like SoundManager2.
Check out this newer one called gwt-soundmanager2. It's a fork from Jeffery Miller's gwt-sound project. https://github.com/rcaloras/gwt-soundmanager2
(I created it, happy to answer questions or add additional features)