Closed skerit closed 7 years ago
Thanks for the feedback,
It's pretty good at decoding video, and viewing the camera. Let me know if you need help!
JP
There are a few small issues with the example on the README file:
new
keyword is missing in order to create the VideoDecode and VideoRender classomx.Component.initAll([VideoDecode, VideoRender]).then(function() {});
What's the exact purpose of the VideoRender class right now? I'm just figuring out what needs to happen in order to get some video on the screen :)
Also: do you know what raw format VideoDecode outputs? It seems to be missing frames, too.
Alright, I'm getting somewhere. I'm able to decode video using your openmax module and displaying some raw video output directly on the screen. Here's the test repository:
Thanks for your feedback. I checked your repo and it's quite interesting. My function initAll is a very simple wrapper around init(). If you have a single Component, feel free to do: VideoDecode.init().then(function(){ }). Also, you don't need the VideoRender here as you are doing your own render.
Did you check the example https://github.com/jean343/Node-OpenMAX/blob/cd7120a478a941360ea0d305a13d8009c6550310/examples/js/SimpleVideoDecoderRenderBuffer.js ? If not, it might help you.
In the source code, it has performance measurement. The slow down is mostly from the pixel copy as the VideoRender can easily decode and copy 1080p 60fps.
Regards,
Ah, that's good to know.
The slowdown only happens when I create an OpenVG image out of the buffer. Painting the pixels directly to the screen happens instantly, but then you can't do any scaling or such :/
I did see that example, but I was more interested in the VideoRender class, though I didn't see a lot of code in there. I'm guessing most of that happens in the C++ part?
The VideoRender is in the OpenMAX land, we don't have the source for it, but it's quite performant. See: https://www.youtube.com/watch?v=La0PwXI2cXc
I have an example, still work in progress in the perf folder: https://github.com/jean343/Node-OpenMAX/blob/master/perf/PerfRender.ts
What is the goal of your project?
Oh, so you can set the dimensions of the renderer, that's interesting. Could you also set some kind of zo index, so it doesn't draw over things drawn with OpenVG? Or have it draw to an X11 window?
I'm creating a system that streams video over udp to the pi's. But I also want to add some sort of interface. And, obviously, I want to do it in node :)
Hey,
Not trying to advertise my own projects, but here is a TCP client in C++: https://github.com/jean343/RPI-GPU-rdpClient
With the render, there is some sort of z-index, but it's definitely not a X11 window. You can do some tricks, but I am afraid it does draw on top of everything else. You could always have your UI as a VideoRenderer as well then you will be the top most.
Another option is to use the EGLRenderer and get an OpenGL texture. There is an example: https://github.com/jean343/Node-OpenMAX/blob/master/perf/PerfGL.ts Also, this is what Kodi does in C++
If there is a bug with those APIs, let me know.
JP
Closing as there are no questions.
I've been meaning to write yet-another-mediaplayer for Raspberry Pi, but I wanted to use node and electron/nw for it. I guess this goes a long way to help that be a feasible idea, since video decoding using the web internal sucks otherwise.
So I'm definitely going to look into this, thanks!