RPI4 Video Streaming

Raspberry Pi 4: Chronicling the Desktop Experience – Video Streaming – Week 3

Last Updated on April 27, 2023

This is a weekly blog about the Raspberry Pi 4 (“RPI4”), the latest product in the popular Raspberry Pi range of computers.

This week I’m covering video streaming on the RPI4. Any desktop machine that cannot muster smooth video streaming is a non-starter from my perspective. Again I give my honest and unfettered experiences.

Streaming Video

I spend most of my time streaming video using a web browser. Normally on my main desktop machine I gravitate towards Firefox. Sadly, there’s only a very old version of that web browser (60.9.0) available as a Raspbian package. Instead, the officially supported web browser on Raspbian is Chromium.

How does Chromium function for video streaming? I’ve tested a myriad of streaming services including BBC iPlayer, Twitch, and YouTube. Frankly, watching these services in Chromium doesn’t come remotely close to replicating the experience of my main desktop. In fact, video streaming with Chromium is barely enjoyable. While it’s a big improvement over earlier models of the RPI, there is some tearing on videos, and panning is not smooth enough for my liking. It’s more noticeable when the video is played full screen.

RPI4 should have sufficient grunt to be able stream video fluidly. For example, I’ve being comparing the RPI4 to a Chromebook sporting only a dual-core Celeron N3060 CPU with 2GB RAM running GalliumOS. It’s a very basic Chromebook that in many respects is slower than the RPI4. Compiling musikcube takes 17 minutes 13 seconds on the Chromebook using a single core, and 8 minutes 57 seconds with both cores. The RPI4 completes the test significantly faster (see Week 1 of my blog).

Video streaming with Chromium / GalliumOS / Chromebook is very good. Something that cannot be said for the RPI4.

If you’re technically minded, I’d be interested to know where the issue lies with the RPI4. There are lots of differences between running Chromium on the RPI4 and the Chromebook. First, GalliumOS is 64-bit, whereas Raspbian is 32-bit. Next, GalliumOS is using a more recent version of Chromium (77.0.3865.90, compared to RPI4’s Raspbian which is 74.0.3729.157). But it’s unlikely these differences are the cause of the disparity? Is the RPI4 suffering from a bottleneck? Is it an issue with RPI4’s ARM architecture? Are GalliumOS’s Chromium optimisations further developed?

I’m aware Raspbian’s developers claim there have spent considerable effort in optimising Chromium for the RPI4. But something is definitely awry. Coupled with the fact that streaming videos with Chromium on the RPI4 is very CPU intensive, there must be a better way. And fortunately there is.

Solutions for the RPI4

In fact, there’s multiple ways of getting excellent video streaming on the RPI4. I’ll outline two of them.

1) The first solution makes use of RPI4’s Broadcom VideoCore GPU. This involves playing videos in Chromium using omxplayerGUI. It’s a frontend to omxplayer which uses the GPU to decode the video. You can’t install omxplayerGUI in isolation; it’s an integral part of the kweb suite. There’s a few steps you need to take to get this working. I’ve put instructions here.

Don’t be put off by omxplayerGUI’s archaic interface. It uses Python’s Tkinter GUI so it harks back to a bygone era in GUI computing terms. But it acts as a good bridge between omxplayer and Chromium.

Even though omxplayerGUI needs to be installed as part of the kweb site, you can also use omxplayerGUI as a media player for locally stored video.

2. Use Streamlink. It’s a command-line utility that extracts streams from services and pipes them to a video player. Streamlink lets you avoid buggy and CPU heavy plugins but still be able to enjoy various streamed content. There’s a good range of streaming services supported such as BBC iPlayer, YouTube, Dailymotion, Twitch, NBC, NBC Sports, UStream, Livestream, ITV Player, tvplayer, and Bloomberg.

There’s a package in Raspbian’s repository. Don’t use it. It’s not the current version, and some services only work with latest version. I’ve put instructions on how to install streamlink here.

Summary

I’m disappointed with RPI4’s video streaming capabilities with Chromium. It’s such a central activity on the desktop, and the RPI4 should be able to handle this task with aplomb. But it doesn’t. Fortunately, using Chromium with omxplayerGUI or using streamlink with a media player (such as VLC, omxplayer, omxplayerGUI, mpv etc) are viable alternatives.

Next page: Page 2 – Set up Chromium to use omxplayerGUI for video streaming

Pages in this article:
Page 1 – Video Streaming
Page 2 – Set up Chromium to use omxplayerGUI for video streaming
Page 3 – Set up and configure streamlink


Read all my blog posts about the RPI4.

Raspberry Pi 4 Blog
Week 36Manage your personal collections on the RPI4
Week 35Survey of terminal emulators
Week 34Search the desktop with the latest version of Recoll
Week 33Personal Information Managers on the RPI4
Week 32Keep a diary with the RPI4
Week 31Process complex mathematical functions, plot 2D and 3D graphs with calculators
Week 30Internet radio on this tiny computer. A detailed survey of open source software
Week 29Professionally manage your photo collection with digiKam
Week 28Typeset beautifully with LyX
Week 27Software that teaches young people how to learn basic computing skills and beyond
Week 26Firefox revisited - Raspbian now offers a real alternative to Chromium
Week 25Turn the Raspberry Pi 4 into a low power writing machine
Week 24Keep the kids learning and having fun
Week 23Lots of choices to view images
Week 22Listening to podcasts on the RPI4
Week 21File management on the RPI4
Week 20Open Broadcaster Software (OBS Studio) on the RPI4
Week 19Keep up-to-date with these news aggregators
Week 18Web Browsers Again: Firefox
Week 17Retro gaming on the RPI4
Week 16Screen capturing with the RPI4
Week 15Emulate the Amiga, ZX Spectrum, and the Atari ST on the RPI4
Week 14Choose the right model of the RPI4 for your desktop needs
Week 13Using the RPI4 as a screencaster
Week 12Have fun reading comics on the RPI4 with YACReader, MComix, and more
Week 11Turn the RPI4 into a complete home theater
Week 10Watching locally stored video with VLC, OMXPlayer, and others
Week 9PDF viewing on the RPI4
Week 8Access the RPI4 remotely running GUI apps
Week 7e-book tools are put under the microscope
Week 6The office suite is the archetypal business software. LibreOffice is tested
Week 5Managing your email box with the RPI4
Week 4Web surfing on the RPI4 looking at Chromium, Vivaldi, Firefox, and Midori
Week 3Video streaming with Chromium & omxplayerGUI as well as streamlink
Week 2A survey of open source music players on the RPI4 including Tauon Music Box
Week 1An introduction to the world of the RPI4 looking at musikcube and PiPackages

This blog is written on the RPI4.

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Alex
Alex
4 years ago

in step 3 it is saying .local does not exist. any ideas? also will this work for sports streaming sites with embeded streams such as [link removed]? if not what is the workaround for this?

Brad S.
Brad S.
3 years ago
Reply to  Alex

I ran into the same issue. I am no Linux guru but this seemed to get the job done (or it just did something useless, lol). As you mentioned the .local would come up as non-existent, so I just stepped it down to:

nano /bin/chromium-omxplayerGUI.sh

But then it will tell you that you do not have permissions to write there. Get past this by using the admin privileges with the “sudo” command. So it should now look like this:

sudo nano/bin/chromium-omxplayerGUI.sh

Run through the steps listed above after that then press: Ctrl+X when done editing, agree to it by pressing “y”, and then press “Enter” to exit back to the command line.

To make it executable you have to do the chmod with sudo as well. So it should look like this:

sudo chmod u+x /bin/chromium-omxplayerGUI.sh

The instructions on the blog are amazing, and half the fun of using Linux for me is getting past some of these little road blocks (which are usually due to me missing a step or fat fingering something). I hope this helps for those like me who are just trying to get used to the Linux environment.

P.S. I mainly like to watch Twitch streams and this addition of the omxplayerGUI is freaking AMAZING! Thanks Luke for the “how-to” with this.

paul fox
paul fox
3 years ago

So, I’m a little confused as to how to use this — when do I need to use the Play Video button? If I look at a ps listing, or watch “top”, should I see anything besides chromium using a lot of cpu? I’ve started the browser using the new menu entry under Internet, but I’m still seeing video tearing, and rippling during pans.

Mark Routledge
Mark Routledge
3 years ago

A little late to the Party. Sorry. I have been using a Pi as home desktop for a while (on the kitchen table). If you have not done a video on using the Pi as a thin client to connect to business networks (or in my case a school) then it’s well worth it.

There are a few other options to consider. I strongly recommend not playing videos in the browser (unless you have / need to). However Smtube works brilliantly with VLC, or if you want subtitles to your youtube or similar I recommend using Youtube-dl and MPV.

I believe there is now a fix for Tearing on Youtube videos. However I apprciate this article was written a little while ago.

[link removed]