New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Poll] libvlc binding for Node.js with ability render video to html canvas. [$100] #3293
Comments
+1 ;) Le 25/03/2015 08:17, Sergey Radionov a écrit :
|
Also, please use the Gstreamer binding (in many many cases if VLC fails, then Gstreamer does the back up. i had lot of experience where VLC failed and Gstreamer extreamly helped like rescue) NEW Stable Bindings: http://gstreamer.freedesktop.org/data/pkg/ |
If i implement it for any one engine, adding of another one will be very trivial task... |
hummm yeah but don t know for now but 2/3 years ago it was a BIG PAIN Le 25/03/2015 10:53, Sergey Radionov a écrit :
|
It's another question. Anyway first of all I have to implement proof of concept, maybe even without libvlc or gstreamer at all. |
good luck jaruba ;p Le 25/03/2015 11:11, Sergey Radionov a écrit :
|
jaruba? :) |
small mistake, sorry :) good luck anyway ! Le 25/03/2015 11:15, Sergey Radionov a écrit :
|
a) NOW: Maybe the good decision would be first to go with libVLC only, and try to make it stable, compatible at-least for Windows OS. Because most of the enterprises are using Windows OS. b) LATER: In case libVLC giving trouble or not expected quality then decide to use Gstreamer Keep in mind, based on quality experience "Gstreamer" and VLC is good equal. But when compare them then you see one has good or less more better options, which helps in project requirements. But i would go with the roadmap of libVLC as it will be stable for multi platform conceptually. |
I'd like this for reasons of video compatibility but if I understand this correctly wouldn't an addon be the same as a plug-in? Whats the difference? If writing this directly into nwjs, I would not be in support, it will add overhead for a feature that could be under used or used by only a few, plus nwjs is large enough as it is. A better solution would be to use the new np-api's and release a plugin. Forgive me if I lack understanding on why this wouldn't be a better option or why NPAPI can not be used for high performance imaging applications. There are good solutions for a work around, the best solution would be to stick with W3 compliance, the closest thing it would seem is plugins. |
NPAPI based plugin using libvlc internally already exists: https://github.com/RSATom/WebChimera addon = C/C++ based plugin. |
Thanks for the information, read up on NPAPI deprecation and a shame to see npapi dropped soon but maybe the right direction for web standards compliance and perhaps future innovation. Are you aware of any plans for Chrome or W3 to support support RTSP or any other live steaming protocols? |
not hear about it. |
+1, I'll port WebChimera Player to HTML, CSS and JavaScript if/when you do this |
+1 - will be difficult task, but i think that it will be useful |
thanks guys, already start working on it! But poll is still active, so please vote if you like this idea. |
@RSATom how exactly are you going to do this ? We are investigating developing a virtual wdm capture device (that would at least help on windows machines, not sure what the equivalent on mac/linux would be). that way we could get any kind of memory access to a 2d surface within the browser via WebRTC. |
@matthiasg, I will write C++ addon for Node.js which will use libvlc internally to decode video to raw frames (to memory). After that I will draw that frames to HTML Canvas with WebGL shaders (I already do almost the same in |
Idea with virtual cam is good, but don't solve problem with video frames transcoding to supported by |
@RSATom in my case its not about video, its about interactive image manipulation. Basically in javascript you change a parameter (e.g position in 3d space) and an external renderer renders a new frame which needs to be transported to the browser. I understand what you mean now btw with the c++ addon. I was thinking about a html only solution, while you are thinking about using the node.js part to somehow inject the frame into the html context. That will work of course and would be a less invasive method. I do like it, even though i would like it even more if either NPAPI were to remain or HTML5/JS would offer some kind of high-speed IPC. |
Unfortunately my solution will work only with |
+1, just awesome. Any updates @RSATom ? how is this progressing? |
Working on this. Made some basic proof-of-concept, but met performance issues. Trying to find workaround. |
Is it working yet @RSATom ? |
unfortunately I don't have too much time to spend on this, so it could take a while, but I'm still working on it. I hope I will have some solution before full NPAPI deprecation. |
If this can work with reasonable performance it would be amazing. Obviously +1 |
This looks very badass. As soon as you publish a reasonably working prototype, I will start working on a HTML5 |
I hope I will have something workable (with linked libvlc) within two weeks (maybe less, just don't want promise), since now I have all necessary parts. |
@RSATom this would work with atom/electron, correct? I don't see any reasons why it won't. Electron is literarily a few times more performant (especially in OS X - both in video playback and doing a lot of tcp work through node.js |
@Ivshti, If there will be way to get raw pointer ( |
It looks like there will be no issue. Can I use your test code (cpp and js) to test it? @zcbenz what do you think about this? |
@Ivshti, of course, but it's ugly and not works well. |
@RSATom just tested it under electron, works fine. Did an updateFrame function called from JS just to see how the frame would update. Also requires re-initing the texture with https://gist.github.com/Ivshti/a4900dfd3ea553a7a525 This results in a small 400x400 texture filled with black-white noise, and only consumes 4-5% CPU of one core in Electron. Pretty amazing. I think using WebGL + node.js we can have an implementation that doesn't need to lock/unlock frames and still uses the same buffer - once Allocating a buffer for every frame should not happen if not absolutely necessary IMHO, not because of the allocation overhead (as you mentioned in the VLC forum, this is not significant on desktop systems), but because of the deallocation GC overhead. |
I already did similar test but with linked libvlc and real video - it worked well. So we could treat concept as confirmed. Now I need reimplement it in less ugly manner.
libvlc writes data in one of worker thread, so I anyway can't create |
That's great news. Can't wait to see it working :) |
Proof of concept is ready: https://github.com/RSATom/WebChimera.js |
This implementation is very basic and require some optimizations, but it works pretty well. |
I'm getting:
I guess I also need to build the |
Yes, I'll write instruction how to build it soon. |
Binaries available: https://github.com/RSATom/WebChimera.js/releases/tag/proof-of-concept P.S.: Please keep in mind, API is very limited, only |
Great news! Although I couldn-t build it - on OS X, I am getting those errors
for every expression of this style ([something]). I don't know what it does and I didn't have an idea what to do. As for windows, I tried with the pre-compiled binary and the same nwjs build you listed (0.12.1 ia32) but it's giving me a "module not found" even though the file is in the specified path. Maybe it cannot link to the VLC dll? |
|
I didn't try build it on mac, but I think it's lacks c++11 support |
I'm working on a project that needs to display media from several sources including live video. This would be ideal. But I was thinking and searching around for another solution by utilising native html5 and perhaps getting node to open a rtsp video stream and transcode into mpeg dash and run a local http server to be opened inside the browser. It should work in theory and I'm planning to modify a project that already done this partly. https://github.com/barbibulle/hippo/blob/master/server/node/README.md I've done a few tests and it works well with local files. I accept there will probably be a delay of about 5 seconds but that's acceptable for my project. |
@mscreenie Doesn't transcoding use an immense amount of resources? I know it is far from being a viable choice in most projects that need extensive video type support. |
Good news guys, I've almost done with tasks scheduled for the first beta release. I hope it will out next week. Another good thing - it seems current implementation could be used not only with Current available API: https://github.com/RSATom/WebChimera.js/wiki/JS-API |
Checked compatibility with linux - it works! @Ivshti did the same for Mac OS X - it works too. It means we almost ready for first release! |
First public release is ready: Prebuilt binaries will be available via npm a little bit later. |
WebChimera.js Player published at: |
Excellent! Thanks a lot for your amazing work! (Both RSATom for your insane skills and dedication and jaruba for writing an easy-to-use player so quickly) |
@Ivshti also deserves credit on this project, he helped a lot :) |
And thank you too @lvshti. :) |
Now we have pretty stable implementation, so we could close this issue. |
Now available on NPM: |
Let me fill out in on what each module does. WebChimera.js - libvlc binding, the JS api allows you to control libvlc and get raw frames in UInt8Array |
HI, I have idea for one else open source project, but don't sure if it will be useful to someone.
The Idea is simple - write node.js addon which could render video directly to html canvas via WebGL. I think this task is pretty feasible, but don't want spent time on it without be sure it will be useful and will be used.
So vote please if you like this idea.
Thanks in advance.
Did you help close this issue? Go claim the $100 bounty on Bountysource.
The text was updated successfully, but these errors were encountered: