Watching YouTube videos on RISC OS (updated)

      Comments Off on Watching YouTube videos on RISC OS (updated)

While we all love RISC OS and its user interface, we all know that it is not an operating system without problems and deficiencies, because it simply hasn’t kept up with the main platforms in a number of areas – and one such area is access to online video streaming services such as YouTube. However, all is not lost – if you have a suitable computer, there is a software solution for viewing YouTube videos on RISC OS.

Doug Webb demonstrated this at a recent Midlands User Group meeting and, responding to a request I received, kindly sent me a simple step-by-step guide to turn into an article for this site, which I have expanded on somewhat with explanations and additional information.

Update: 26th January. When writing this post yesterday and following it through, a couple of additional steps were needed over and above the initial instructions, and I neglected to edit them into the final post. These steps are now included, with a little additional information.

Requirements

I mentioned “a suitable computer” above – but what constitutes a suitable computer? One of the software components that will be needed – the version of Python – is a VFP-enabled build of the software, so that’s a key ingredient. VFP stands for Vector Floating Point, and is ARM’s floating point coprocessor architecture. If your RISC OS computer supports VFP, you should be able to watch YouTube videos by following these instructions.

Support for VFP varies from machine to machine – or more to the point, from System-on-a-Chip (Soc) to System-on-a-Chip. Broadly speaking, though, most if not all modern platforms that run since the Raspberry Pi should have VFP on board, though the specific version may differ. For example, in the case of the Pi itself, the original board has VFPv2, the Pi 2 originally had VFPv3, and VFPv4 can be used on the revised version and all main Pis since.

With your hardware up to the job, the other ingredient is RISC OS itself – which from the above should obviously be RISC OS 5. The machine on which I’ve set this up is running version 5.23 – so as long as you are running that or later, you should be okay. I can’t say whether versions prior to that are suitable – it’s up to you if you wish to try it.

Preparation – ensure your system is up to date

The first thing you should do is ensure you are entirely up to date with your Boot system – so pop along to the RISC OS Open Ltd downloads page and download the most recent HardDisc4 image.

Download the HardDisc4 image from RISC OS Open.
Download the HardDisc4 image from RISC OS Open.

Open the zip file to see a number of items – one of which is a directory called HardDisc4. If you check the ReadMe file, it offers a method of updating for RISC OS 5.22 and earlier that you may wish to follow if that’s what you are using.

The contents of the HardDisc4 zip file.
The contents of the HardDisc4 zip file.

For later versions, though, if you open the HardDisc4 directory you’ll find a !Boot folder that needs to be merged with your own.

The contents of the HardDisc4 directory in the zip file.
The contents of the HardDisc4 directory in the zip file.

To do this, double click on !Boot in your root directory, then select Boot in the Configure window that appears, and then on Install. Drag the !Boot application directory from the HardDisc4 zip onto the new window, then click on Merge.

Merging the updated !Boot with your own.
Merging the updated !Boot with your own.
Decide where to put the necessary applications

You now need to decide where on your system you are going to install the necessary software. For his demonstration, Doug created a ‘YouTube’ directory in the root of his hard drive – but I already have a ‘Video’ directory in ‘Apps’, so I used that.

Install FFmpeg and FFplay

FFmpeg is a simple media player, and FFplay is a front-end for it that runs in the RISC OS desktop, and a suitable version has been made available by Raik Fischer (zip – 29MB).

FFmpeg and FFplay should be copied from the zip file to the folder created above.(Note that the zip file also contains Murnong, which is not needed for these purposes.)

The contents of the ffplayetc.zip file.
The contents of the ffplayetc.zip file.
Install Python27 and Youtubedl

A version of Python 2.7.2 is available from Chris Gransden’s RISC OS Ports website, but there is another version available which isn’t (yet?) linked on the site – and it’s this one you need; a VFP-enabled build of Python 2.7.16 (zip – 44MB), which comes with a program (written in Python) called Youtubedl which does exactly what it says on the tin – it’s for downloading YouTube videos.

In addition, there is a small update to this (zip) that you will also need.

The !Python and !Youtubedl applications also need to be extracted, as before.

The contents of the python27.zip file.
The contents of the python27.zip file.

The second part of this installation is to merge the !Boot provided in the python27 zip file with your own – this is done by double clicking on the !Boot application on your hard drive to run !Configure, then selecting Boot and then Install to run the Boot Merge tool. Having done this, you can drag the !Boot from the zip file onto this window, then click Merge.

Installing the boot files using Boot Merge.
Installing the boot files using Boot Merge.

You can now install the update to Python and Youtubedl.

The contents of the python27update.zip file.
The contents of the python27update.zip file.

You should first open your newly installed !Python27 application directory, then within that open lib, then python2/7, then site-packages. Within this there is a directory called youtube_dl that needs to be deleted. You can now close these directory viewers, so that you are once again looking at the one containing the !Python27 application directory.

You can now copy the !Python27 and !Youtubedl applications from the zip file over the copies you installed earlier.

Installing YTPlay

The final application you need to install is Raik Fischer’s YTPlay – and this can be downloaded via !Store.

YTPlay in the !Store catalogue.
YTPlay in the !Store catalogue.
YTPlay on !Store.
YTPlay on !Store.

YTPlay should also be extracted to the folder created for this purpose.

The contents of the YTPlay zip file.
The contents of the YTPlay zip file.
Reboot, run…

The set up for all this might seem very complicated – but as long as there were no problems, and your computer is running the latest version of RISC OS, once all of that is done, well, it’s done!

With all the necessary applications and resources installed, you can now reboot your computer – and once you have, or in future when you switch on and wish to look at something on YouTube, navigate to the same folder again, and run the applications in this order:

  1. FFmpeg
  2. FFplay
  3. Youtubedl
  4. Python27
  5. YTPlay

The relevant part of your icon bar should now look like this:

The icons now on the icon bar.
The icons now on the icon bar.
Playing a YouTube video

The acid test is obviously to play a video using this set up. To do this, load your web browser and visit YouTube and search for the video you wish to play (or just browse until you find one). Once you are on the relevant page, drag the URL (address) bar from your web browser and drop it onto the YTPlay icon on the icon bar.

Note that if you can’t drag the address bar, you could also copy the address itself into a text file and drag that onto the icon.

There will be a delay while the video is downloaded and processed by all the supporting software – during which time the YTPlay icon will change to an animated cog to indicate that it is doing something – and presently a window should appear with your video playing.

In following these instructions myself, I’ve found that not all videos can be played this way – and I haven’t drilled down into the cause – but some certainly can; even as I type the draft of this I have Steve Revill’s talk at the 2019 Southwest Show playing on my ARMX6, and before that one I played the RISCOSitory guide to installing RISC OS on the Raspberry Pi.

There is a caveat, as well; I have a beta version of the Iris web browser installed, and I’ve discovered that if RISC OS sees that, the whole process fails due to being unable to load a shared library from the SharedLib: path – it appears that instead of adding its own path to the system variable, the beta version of Iris rewrites the path variable completely.

You should also be aware that every once in a while, YouTube moves the goalposts – and this process will stop working. Whenever this happens, the fix will be to look out for a replacement Youtubedl application, updated to match the changes YouTube have made.