brunoherbelin / vimix

Live Video Mixer
GNU General Public License v3.0
277 stars 26 forks source link

raspberry 4 support possible? ... please don't freak out #9

Open MoorPoor opened 3 years ago

MoorPoor commented 3 years ago

Hei! I don't expect screams of excitement but will it be possible to run vimix on a Raspberry 4, Nvidia Jetson or similar one day? I am interested in the possibility of doing video collages for installations in environments where a more powerful computer can not be used. currently we are using ofxPiMapper for that purpose. It has good basic features but obviously is missing some good ones vimix can provide. (and vice versa ;) I don't know if turning down frame rate and resolution will be enough the current snap version is not running THANKS!

brunoherbelin commented 3 years ago

The idea is not that crazy! And I am also a fan of software optimization for the minimum hardware requirement.

It is anticipated that, one day, an engine of vimix would be able to run on a NVidia Jetson Nano. A Nano can (theoretically) decompress 4 full-HD H264 videos: with OSC remote control and RTP video streaming, one section of a session could be off-loaded to the Nano. Or the merging of two computers controlled remotely.

While I have the Jetson nano at home, i don't have a Pi4 : I may ask for help if/when a version for ARM becomes available.

MoorPoor commented 3 years ago

Great to hear! vimix actually runs on the raspberry 4. I have just tried again on a freshly installed 64bit ubuntu (before that I had 32bit) however, loading a video file is very painful. Aside from the speed, the only problem I could see was that there was no output shown.

photo_2020-10-12_22-39-08

brunoherbelin commented 3 years ago

Thats great to know already! Vimix is made to compile (almost) anywhere, with minimal dependency, but still its good to see its minimal design is effective :) The thing is that nvidia provides the gstreamer supports already.. I am not aware of a hardware accelerated gstreamer support for the Pi, but maybe it'll come? Anyway, your input is encouraging and i'll test on Nano soon. I heard NVidia is going to make it very affordable (50$ or so), so it's an option to keep open!!

brunoherbelin commented 3 years ago

PS: if it helps for Pi support, you could try to disable Blit option in vimix (extended About dialog): vimix_about

MoorPoor commented 3 years ago

thanks, I tried... unchecking Antialiasing framebuffer gives me finally an output.

stuaxo commented 3 years ago

Hi, Back when I was doing stuff with the raspberry pi 3, OMX was the way to get HW acceleration.

Then you could create a native dispmanx surface using their bcm API.

Back then I had to recompile gstreamer, to get stuff like gstreamer-omx (for HW video), but it's probably better now.

I can't share the source unfortunately, but the pipeline setup went like this:

There are definitely examples on the net that do all this, I just don't have time rn to find them.

alexmyczko commented 2 years ago

I guess these users will profit of #42

StefanVallbracht commented 1 year ago

Great to hear! vimix actually runs on the raspberry 4. I have just tried again on a freshly installed 64bit ubuntu (before that I had 32bit) however, loading a video file is very painful. Aside from the speed, the only problem I could see was that there was no output shown.

Hi @MoorPoor , I also had the idea since years that it would be smart to glue a Raspi onto a projector and let it run as a nice headless and autarkic system. I use this kind of solution with laptops and it works very well. But it could be smaller and more autarkic. So would be amazing to have a swarm of Raspis instead ;)

So how did you get it running on a Raspi 4 ? I installed a fresh 64Bit Ubuntu and installed Vimix with "sudo apt install vimix".

Unfortunately OSC seems to make some trouble:

vimix: ./ext/OSCPack/osc/OscOutboundPacketStream.cpp:166: osc::OutboundPacketStream::OutboundPacketStream(char*, std::size_t): Assertion `sizeof(osc::int32) == 4' failed. Aborted (core dumped)

Has anyone an idea?

Thanks a lot for any help Stefan

brunoherbelin commented 1 year ago

aha ! Interesting to see that the ubuntu package was made also for Raspi :) ! Alternatively, I think the simplest would be to compile from source.

FYI : I considered adapting vimix for Jetson Nano : these little beasts have GPU accelerated video decoding! If you have one and would like to give it a try, it would be a nice addition to vimix !!

stuaxo commented 1 year ago

With video on the raspberry pi, you have to be careful about the encodings you use if you want things to playback smoothly.

The project I mentioned above was a video wall project with RaspberryPi 3bs; our screens were small + so not very high res, but it was OK, even playing larger videos than the screen - I think, we could have gone to the equivalent of one 1080p video.

The system was used layers (via the Pis dispmanx API) - a picture underneath, controlled by the app, in case the video playback failed - and under that was a custom framebuffer background just in case everything failed.

It's really important to get the whole pipeline setup so things use the hardware decoding - I know this situation has got more messy recently too.

Basically, you know when things aren't configured correctly due to slowness / the Pi getting hot + CPU usage going through the roof.

stuaxo commented 1 year ago

The first step, even before looking at vimix, is just to have a play and confirm you can get hardware playback - once you know the right incantations / mix of video encoding and configuration works, then it may be possible to look at vimix.