FullPageOS icon indicating copy to clipboard operation
FullPageOS copied to clipboard

Choppy Video

Open jacobgraf opened this issue 9 years ago • 28 comments

We are looking to use this for digital signage and occasionally we will have a short promo video play. We are using this as a test video (https://graftechnology.com/video/) but the video is really choppy. I set the GPU_MEM to 448 since that's the max for a 1GB Raspberry Pi 3 but it's still choppy. Any ideas how to get things running smoother? Thanks!

jacobgraf avatar Jun 04 '16 21:06 jacobgraf

Currently chromium is not utilizing the GPU. To date I have not be able to find how to enable it. Talks are at #22 . Solutions are welcome.

guysoft avatar Jun 04 '16 22:06 guysoft

@jacobgraf could you please try this out and tell us if it solves the problem for you?

tailorvj avatar Jun 05 '16 10:06 tailorvj

I am not sure that would solve it alone.

guysoft avatar Jun 05 '16 10:06 guysoft

I was able to get hardware decoding working from Chromium by enabling the experimental gl graphics driver in raspi-config and enabling the --ignore-gpu-blacklist chrome flag, but elements of videos still played choppy.

I tried another Raspberry Pi distribution (OpenElec / XBMC) that runs videos in a dedicated media player. The same MP4 videos played smoothly in the media player app.

tcaddy avatar Jun 07 '16 14:06 tcaddy

Maybe we are trying to squeeze too much out of a web browser. Did you try smaller resolutions?

tailorvj avatar Jun 07 '16 16:06 tailorvj

@tailorvj smaller resolutions played smoother, but don't look that great. In the end, I used a more powerful device for the video playback use case.

tcaddy avatar Jun 07 '16 16:06 tcaddy

@jacobgraf Not in browser, but I'm having success using omxplayer. It goes fullscreen over the browser, and when the video is done, it closes and returns to the browser.

pricecomstock avatar Jun 26 '16 01:06 pricecomstock

Hey, try RC1, it seems to be able to run fast, but it crashes, not sure why.

guysoft avatar Dec 27 '16 21:12 guysoft

@jacobgraf Hey, if still relevant, it seems like webm does work on full screen at the moment, its mp4 container that seems to have a bug now. it means that if you convert your video to webm it should work with the new 0.7.0 RC1. Here is a webm video for reference: http://video.webmfiles.org/big-buck-bunny_trailer.webm

guysoft avatar Dec 29 '16 09:12 guysoft

This dude managed to get hardware decoding in Chromium: http://thebugfreeblog.blogspot.com/ It would be interesting if you take a look at it. Would be really useful to have a merge of these two projects.

NikiGHz avatar May 15 '17 02:05 NikiGHz

@Enzarro that uses specilized code, we already have a better solution which you can download and use in RC1 #92

guysoft avatar May 15 '17 09:05 guysoft

I am trying to run a WebRTC site in FullPageOS. But as soon as I receive video it gets choppy/lagged instantly. You can try it by loading https://appr.tc as default page and connect the Pi and your PC to same room. Tested with RC1. Any ideas for optimilization?

mark-veenstra avatar May 17 '17 05:05 mark-veenstra

@mark-veenstra What's the hardware behind?

ruvenss avatar May 19 '17 13:05 ruvenss

@ruvenss Sorry forgot to mention. I used the Pi 3B and a normal HDMI screen which is used for computer also. Added an USB camera to the Pi 3B to enable cam feature. Used this cam on laptop also and worked fine. The video is shown normal on laptop from the Pi, but all received video data on the Pi is choppy. CPU is also at max all the time.

mark-veenstra avatar May 19 '17 14:05 mark-veenstra

Any update on this? Isn't rpi-chromium-mods using hardware acceleration?

Boscop avatar Sep 07 '17 16:09 Boscop

@Boscop It is, but it disables x264 hardware decoding which can be used to play Youtube videos. See: https://github.com/guysoft/FullPageOS/issues/86#issuecomment-312369762

guysoft avatar Sep 11 '17 10:09 guysoft

There might be progress on this, release notes say now:

2017-09-07:
  * Bug fix for crash on some videos and animations in Chromium

guysoft avatar Sep 11 '17 10:09 guysoft

It would be very useful to be able to play hardware accelerated H.264 in FullPageOS..

Boscop avatar Sep 11 '17 20:09 Boscop

@boscop it can be done, as I already said, see https://github.com/guysoft/FullPageOS/issues/86#issuecomment-312369762

guysoft avatar Sep 11 '17 21:09 guysoft

I am trying to run mp4 video trough HTML5 video tag but it is very choppy. I have Raspberry PI 4 (2GB RAM) and tried almost every combination to fix it but without success.

Any recommendations? I am ready to donate if proper solution is offered as my project depends on it.

stzoran1 avatar Oct 10 '19 10:10 stzoran1

@stzoran1 Can you provide a link to the webpage running the video of an equivalent? I can't debug it without an example I can test

guysoft avatar Oct 10 '19 11:10 guysoft

Thank you for quick reply. Here is the test link: https://radio.numera.rs/rpidevices/12456/dekordom0710

There is a slide show containing one image and one video. When I use images only everything works perfectly, but video is choppy.

stzoran1 avatar Oct 10 '19 11:10 stzoran1

It's been years since I dealt with this but if I remember correctly, the MP4 decoding chip on the Raspberry Pi is not open source. Raspbian ships with a binary blob that's licensed from the company that provides the chip. There's a media player that ships with Raspbian named "omxplayer" that will in fact play videos smoothly. But this program won't hook into Chrome or Chromium nicely.

I think I tried some experimental flags in Chrome to enable unsupported GPUs. I don't remember if it just didn't work or if it worked in some flakey manner that wasn't good enough.

I ended up not using the Raspberry Pi for the project at hand at the time. (But I found a use for in another project.)

I hope things have improved since and you can get your goal accomplished.

tcaddy avatar Oct 13 '19 14:10 tcaddy

That's strange. I have no hardware acceleration on my RPI 3B whatever I try.

Running the enable_gpu script quietly does nothing. And as far as I understand this is only for the GUI, right?

I activated fake and full KMS in raspi-config.

In the end I updated chromium and all other packages and followed this guide, which also didn't change anything for me.

I have the feeling this should work in 2020, what am I doing wrong?

Here is a screenshot of what chrome://gpu gives me vncviewer_rWqRgoOCOU

pi43r avatar Aug 29 '20 14:08 pi43r

@pi43r What version of FullPageOS? 0.11.0 Has version 74 of chrome and this is 78 - is this the nightly?

Also that guide has extra chromeium flags, did you try them?

-use-gl=egl --enable-gpu-rasterization --enable-native-gpu-memory-buffers --ignore-gpu-blacklist

guysoft avatar Aug 30 '20 07:08 guysoft

Yes, the screenshot was after all my attempts to fix it. I have tried both the nightly and stable version.

I was trying to run a small videoloop in the browser. For this project I have reverted to omxplayer with less interactivity, but I'm sure the same problem will come up in the future. So, just to make sure: You have full hardware acceleration on your RPi in chromium?

pi43r avatar Sep 01 '20 12:09 pi43r

I managed to get hardware acceleration working on FullPageOS 0.12.0 with the following Chromium flags:

--enable-gpu-rasterization --enable-accelerated-video-decode --enable-native-gpu-memory-buffers --ignore-gpu-blocklist

Notice on flags mentioned previously: When using --use-gl=egl option it fails with Failed to load GLES library: libGLESv2.so.2 error, and --ignore-gpu-blacklist is deprecated now.

@guysoft Just wondering if there's a way to set Chromium flags by changing some file on SD card, without booting, like WiFi configuration for example?

Update: It's also required to install libgles2-mesa package

ilyai avatar May 10 '22 12:05 ilyai

The file that holds all the flags is here: https://github.com/guysoft/FullPageOS/blob/devel/src/modules/fullpageos/filesystem/home/pi/scripts/start_chromium_browser#L4

guysoft avatar May 10 '22 13:05 guysoft