Tuesday, November 10, 2020

Video playback on Raspberry Pi 4

Yet another note to self on how to get video playback on the Raspberry Pi 4.

First, it seems that the micro HDMI socket nearer to the USB-C connector is the primary HDMI, and that should be the one you use if you only have one monitor. It has something to do with audio.

Also, the default GPU memory allocation of 64MB is too little for video playback, so that needs to be changed in /boot/config.txt to 256MB by:
gpu_mem=256

Next is DRM. This is a bit tricky. If you are running Raspberry Pi OS or something similar, you can easily install what is known as Chromium Media Edition (it is Chromium browser, with ChromeOS's Widevine library) by using pi-apps. Just clone the repo and run it.
git clone https://github.com/Botspot/pi-apps
~/pi-apps/install
By the way, TwisterOS comes with pi-apps and Chromium Media Edition already installed.
 
However, for 64-bit OS, this is not going to work since the ChromeOS Widevine library is 32-bit. One way to get a 32-bit version of Chromium with the 32-bit Widevine library running on a 64-bit OS is to use docker, and there is such a docker container called docker-chromium-armhf. The repo has the instructions on how to get it up and running.

No comments: