3

My web-based application utilises HTML5 for various dynamic elements (img, video, etc). I'm hoping to be able to use RPi's for system deployment, but I can't seem to find a suitable mix of browser/file format which allows for HTML5 video playback.

I've searched this issue extensively online, and the 'new' epiphany web browser was/is supposedly the answer. I've tried 'testing' file format compatibility over at html5test.com, but haven't been able to play any of the 'compatible' files on any of the 'compatible' browsers (I've tried both .mp4 and .webm [both local files and URL-linked] on Midori, epiphany, iceweasel, etc.). The best result I've had has been in playing a ~10Mb local .webm file in iceweasel, which was able to manage ~1 frame of the video every ~3-4 seconds. I've increased the allocation of memory to the GPU, which hasn't offered any real improvement.

I'm starting to think that the RPi just isn't up to the task of playing HTML5 video under Raspbian? Would installing one of the Ubuntu OS options for the RPi offer any benefit?

2

I just wanted to note that I've been researching this topic as well and found some 'hacky' solutions. I've tested several methods to enable smooth playback in the browser using HTML5.

Attempted Solutions:

  • Browsers: Chromium-Browser (Version 45 and 50), Iceweasel, Midori, Minimal Kiosk Browser, Epiphany Web Browser.

For each browser I then navigate to http://html5test.com and check the rating, and play a YouTube video. It's still very choppy.

  • Utilizing Omxplayer: works great for videos, but won't work for HTML5 video.
  • GPU Hardware Acceleration Library: Next, I attempted to force hardware acceleration in the "chrome://flags" settings area of Chromium.

And finally, I used the glshim library to open chromium-browser with partial hardware acceleration. See the guide here.

Note: Make sure you have Chromium-browser version 45. I tried with version 50, but chromium wouldn't open properly.

  1. git clone glshim repository
  2. sudo apt-get x11 headers
  3. sudo apt-get cmake
  4. cmake .
  5. make GL
  6. LD_LIBRARY_PATH=/opt/vc/lib:~/glshim/lib glxgear // This allows testing of WebGL
  7. startx
  8. lxterminal
  9. LD_LIBRARY_PATH=/opt/vc/lib:~/glshim/lib chromium-browser // This will open Chromium-browser with the appropriate library.
  10. Chromium browser should launch
  11. Navigate to "chrome://gpu" to see:
Canvas: Software only, hardware acceleration unavailable
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Rasterization: Hardware accelerated
Video Decode: Software only, hardware acceleration unavailable
Video Encode: Hardware accelerated

Note: At this point the thing I really want enabled:

Video Decode: Software only, hardware acceleration unavailable

is not enabled...

Potential Areas of Development:

  • Modify OSMC (I would post more links, but I don't have privileges)
  • Modify Kodi
  • Wait for a browser that is capable to display HTML5 content natively utilizing the Raspberry Pi GPU.

Hopefully this changes in the future! Looking forward to any other ideas anybody else has!

1

We manage an amount of Pi's as Digital Signage clients. We have plain picture and HTML based versions. For HTML we use Chromium.

While we don't have a direct need for HTML5 video at this very moment it was something to try out.

Since the first arrival of the Pi2 we have been trying to get acceptable speeds for serious javascripting, basic HTML5 and HTML5 video. Because its presentation as being the ultimate HTML5 browser, we also tried epiphany.

Our conclusion: painfully slow and not ready for mainstream. Would love to hear other peoples experiences though.

  • Thanks for that EDP. I'm also using the Pi's for a digital signage (to an extent) solution, which has been working perfectly for light JavaScript and images. After several more hours of research yesterday (after posting this), I've come to a similar conclusion; the Pi's just aren't up to HTML5 video playing within the browser. There are a couple more options I'd like to explore, and will keep this thread updated with my findings. – jars121 Jul 15 '15 at 20:40
1

After hours of seeking solutions to play YOUTUBE videos, I have found the solution in the Epiphany Browser. Installs with the following 3 commands:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install epiphany-browser

---------------------------BUT THEN:---------------------------------------

You must reboot, then (AGAIN!):

sudo apt-get update  

then navigate to www.youtube.com/html5 check off use HTML5 player. In the RPi's operating system's sound icon, right click and check "Analog" then plug in headphones or speakers into the Pi jack (HDMI setting here, did not provide adequate quality)

I have experienced most youtube videos to play well with these steps, the exceptions I've found are some music videos. All videos seem to retain the white on red Youtube play button throughout the video, smack in the center of the screen throughout.... If the video will play, the play button will stop blinking within 30 seconds, right clicking, then reload will work, after another video selection has been made. Pause will not work; & any mouse movements after the video has started affects the sound...if you can put up with these inconveniences, welcome to Youtube on a slice of Pi !

1

The best video playing browser for the Pi, in my experience, is KWEB3.

It is based on the epiphany browser but appears to handle video much better and is has better support for HTML5 features.

  • It's worth also noting, that we had issues with HTML5 videos eating up the browser's virtual memory until eventually it would fail to play any more videos. Since it was a single page app, the videos were kept in memory even after being removed from the DOM. We resolved this by opening the videos in iFrames, and then removing the iframe once complete - this freed up the memory each time. – benjaminhull Feb 5 '16 at 15:21
0

I Have a same problem. I fix it change de video format of my application. I put videos in webm.

see more in: HTML Video Codec Support in Chrome

  • 2
    Welcome to Raspberry Pi! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Jacobm001 May 19 '17 at 15:43
0

This is not really a solution, but a suggestion that may also work.

You could try embedding a video by using the Omxplayer. I was thinking about the "object" tag. I don't know if this is possible, but I will give it a try.

I've tried many of the things mentioned here and in other places, but the only thing that really make an improvement was using WebM videos. The videos still lag in full screen, but at least they are played without long delays.

Update Following the suggestion by: Ingo, I removed my comments and explain what I have done so far.

@kwasmich wrote that omxplayer is a command line tool and thus it is not related to HTML. He also added that it would be a security threat if a website could gain access to the command line.

Yes, I know that omxplayer is a command line tool. However, after doing some searching, I found that it is possible to use it from Chromium. There is an extension called: RPi-youtube. It works, but you need manually to click on it for playing the video with omxplayer. So, for my case: automatically playing embedded html5 videos, this won't work.

Anyway, I guess that if there is such extension, the problem can be somehow solved in a similar way.

Regarding the other comment:

it would be a security threat: On my case this threat won't exist. I have a local nginx webserver and I don't plan to browse Youtube or any other external website. My idea is to have the Raspberry-Pi on kiosk mode and always showing the same page.

I also found another solution: the KWEB suite. This is a browser that includes a frontend for the omxplayer. I tried it, but unfortunately it is not working.

Anyway, I just figured out that for my case, its is enough to reduce the video resolution from: 1080p to 720p.

  • 1
    The omxplayer is a command line utility and has absolutely nothing to do with HTML. Thus it cannot be used by using an <object> tag. That would be a severe security threat if a website could gain access to your command line. – kwasmich Mar 15 at 15:18
  • Please don't explain things in the comments. Instead edit your answer and add them to it. Please take the short Tour and visit the Help Center to get an idea how things work here. – Ingo Mar 18 at 10:57
  • 1
    @Ingo: I deleted my comments and added them to my message. – technosoftgratis Mar 18 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.