Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Video performance #9

Open
manast opened this issue Sep 12, 2016 · 18 comments
Open

Video performance #9

manast opened this issue Sep 12, 2016 · 18 comments

Comments

@manast
Copy link

manast commented Sep 12, 2016

Hello,

I have been checking resin-electronjs today and I am not able to get any decent performance on a raspberry pi 3. I have tried with the master branch as well as with the framebuffer one. Also, I noticed that the image quality is not so good, it seems as if the graphics are quantized, i.e. running in maybe 16bits/pixel instead of 24. Do you have any advices? is it even possible to get an acceptable performance to play videos using electron on a rpi?

@mrjonny2
Copy link

I have attempted to get this working, unfortunately chromium (on which electron is based) does not support the GPU used in the RPi, this means that it is unable to use hardware acceleration and the full load is dumped onto the CPU, which does not handle video decoding very well.

@buildog
Copy link

buildog commented Oct 25, 2016

maybe by activating WebGL but don't know how to do that within a resin image ?

@bitnom
Copy link

bitnom commented Jan 12, 2017

This is actually my main use case for wanting to buy a raspberry pi: An electron app meant for video playback.

@danielmahon
Copy link

@TomAshley303 In my experience, until they update to the 4.4 kernel which has the (experimental) OpenGL support you will pretty much HAVE to rely on omxplayer for video playback. I know the resin team is working on the update as we speak. For now, I am running an electron app based on this template and then triggering videos via omx-manager. I just send button presses/states through the electron IPC from the renderer to the main. Also, since you can set a window size for the omxplayer instance, I just overlay the video on PART of the ui and then you can still use button presses on the page to control the video.

@IvanTorresEdge
Copy link

Hi, any updates on OpenGL support?

@mrjonny2
Copy link

It seems to be on chromium's side with a lack of support for mali GPUs on linux

@kristjanmik
Copy link

kristjanmik commented Oct 2, 2017

I know the resin team is working on the update as we speak

@danielmahon Do you know anything about the progress on the Resin team side?

@curcuz
Copy link
Contributor

curcuz commented Oct 2, 2017

Hello, it turns out the issue is with the mesa libraries that are installed by debian:jessie. The way to fix this is to update these packages.
To do that add the jessie-backports mirror to your source.list file, by adding the following line to your Dockerfile:
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
Lastly use apt-get with -t jessie-backports flag to install from that source:
apt-get -t jessie-backports install {packages}

more info here balena-os/balena-up-board#26

@curcuz
Copy link
Contributor

curcuz commented Oct 2, 2017

Sorry, that is related to Intel based devices, while this thread is about the rpi3 - my fault :/
On the rpi side, the issue is on chromium and I don't see a fix coming soon. Even if it does, it needs to hit chromium, than electron, then this project. If you are interested only in running web content with hw acceleration this project from @petrosagg does it very well https://github.com/resin-io-playground/resin-wpe

@kristjanmik
Copy link

@curcuz Thanks for the quick reply. This only works on Intel based boards, not the Raspberry Pi 3(which is ARM based). Is there any solution that you know of for ARM based devices?

@MiluchOK
Copy link

I need this working too... Is there anything?

@SteffenDE
Copy link

Maybe someone with enough experience in building electron/chromium could apply one of these patches and build a custom electron binary for the rpi: https://github.com/raspberrypi-ui/chromium_patches
The Chromium version shipped in the latest raspbian releases has one of these patches applied and plays 1080p H264 just fine. Sadly it crashes when using the OpenGL driver, so either you have accelerated video OR accelerated animations and webgl.

@apgiorgi
Copy link

apgiorgi commented Jan 9, 2018

Adding dtoverlay=vc4-fkms-v3d into config.txt helped with WebGL/CSS HW performance on Raspberry Pi 3.

@Addflow
Copy link

Addflow commented Aug 15, 2018

i'm experiencing the same problems with the rpi3 using the video tag and a 1080p mp4 video.

omxplayer does a decent job and the playback is flawless. but since i want an overlay (text, images, ..) on top of the video, omxplayer won't work for me - omxplayer OR html content :/

does someone know if another board is capable of smooth 1080p video playback using the html5 video tag? what about the intel nuc? thanks!

@SteffenDE
Copy link

@Addflow I‘m using a Celeron NUC with Ubuntu 16.04 and Chromium and it plays 1080p H264 fine.

@cyraid
Copy link

cyraid commented Dec 5, 2018

Has chromium fixed this yet? Is it a problem with chromium?

@nicshackle
Copy link

I'm trying to solve this, too. Adding dtoverlay=vc4-fkms-v3d did help considerably, but not enough for 1080p.

I briefly tried to use omxplayer, but battled to install it. @danielmahon can you share how you went about using omxplayer?

@gersur
Copy link

gersur commented Oct 15, 2019

I follow tutorial on this site https://thecodersblog.com/hardware-accleration-in-linux-with-chrome/
The package i965-va-driver not found, so I ignore it.

This can increase performance, not much but still.
Tested on latest electron@3, raspberry pi 3b+, 64bit balenaOS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests