You can use any recent Raspberry Pi (such as a model 3, 3B, or 4) to create your DIY Raspberry Pi Chromecast, although it's recommended that you don't use anything older or less powerful, such as Pi Zero or a Pi 2 or older. The older the device, the fewer system resources it has to handle media playback, which means it'll be more likely you'll see playback issues like stuttering and buffering.
Like any Chromecast, the Raspberry Pi acts as a media player for you to "cast" files too. You'll need an HDMI cable to connect your Pi to your TV or monitor to actually see these files play. The device you cast from can vary, but for this guide, you'll need an Android smartphone using the Raspicast app to control your Pi and cast files for playback.
You'll also need to install Raspberry Pi OS first to follow this guide, although another Linux-based distribution may work with some tweaks to the instructions.
This project doesn't require the full desktop version of Raspberry Pi, meaning you can run it in "headless" mode without a standard desktop environment installed and without a keyboard or mouse connected. You'll need to set up SSH on your Raspberry Pi first to allow you to connect and make changes, however.
Before you do anything else, you'll need to update your Raspberry Pi to the latest version of Raspberry Pi OS.
To do this, open the terminal app on your Raspberry Pi or connect remotely via SSH if you're running your Pi without a desktop environment installed. In the terminal or SSH window, type the following commands to update your device:
sudo apt update && sudo apt upgrade
Press the Y key on your keyboard to accept any on-screen prompts or instructions. Once the updates are complete, type
sudo reboot to restart your Pi.
Once you've updated your Raspberry Pi, you'll need to install some software libraries that are needed to handle video and photo streaming using the Google Cast protocol.
To begin, open your terminal or remote SSH window and type the following command to install the necessary libraries to handle certain photo files:
sudo apt install libpng12-dev libjpeg8-dev
Press the Y key to accept any additional on-screen instructions.
Once that's complete, you'll need to install the OpenMax Image Viewer (or OMX), which allows your Pi to use hardware acceleration to handle image files. You'll need to compile this from the source code, so make sure you've installed Git first.
If you haven't installed Git or the make tool for compiling software, type the following command into your terminal or SSH window to install them first:
sudo apt install git make
Press Y to accept any additional on-screen instructions.
Once Git is installed, you can "clone" (download) the source code files to your Raspberry Pi by typing the following into your terminal or SSH window:
git clone https://github.com/HaarigerHarald/omxiv.git
Again, you'll need to confirm any on-screen instructions by typing Y if instructed.
After downloading the source files, type the following instructions in sequence to configure and compile it:
cd omxiv make ilclient make sudo make install
Follow any additional on-screen instructions to complete the process.
After installing the libraries and software required to handle photo casting, you'll need to install OMX Player to allow other devices to stream video files to your Raspberry Pi.
A word of warning, however. OMX Player is deprecated, meaning it isn't receiving any additional updates. If you find that OMX Player doesn't work well on your Raspberry Pi, you may need to look into installing Kodi on your Raspberry Pi and using Kodi's built-in streaming features to work around the problem instead.
To install OMX Player, type the following command into the terminal or SSH window and confirm by pressing the Y key:
sudo apt omxplayer
The easiest way to cast files to a Raspberry Pi is to use an Android device with the Raspicast app installed. Raspicast interfaces with your Pi, automatically opening the necessary software to stream your photos or video files.
You'll need to install Raspicast on your Android device and grant it the necessary permissions to access your local storage files before you begin.
When you open Raspicast for the first time, it'll ask you for the SSH credentials to connect to your Pi. You'll need to type in the Pi's IP address, username (usually Pi), and password.
At this point, you're ready to begin casting local media files to your Pi. To do this, use the Cast menu in Raspicast to locate and select the videos or photos you want to cast, then press the Play button at the top of the menu (and Stop to stop it).
If you want to play any files stored on your Pi directly, use the Files menu to find them, pressing Play to begin playback (and Stop to stop).
As YouTube videos aren't stored locally, you can't play them through Raspicast directly. However, you can use your Android device's share tool to share a video to Raspicast (and thus to your Pi Chromecast) by using the YouTube app on Android.
To start, open the YouTube app and locate a video you want to cast to your Raspberry Pi Chromecast, then tap the Share button underneath the video.
In your Android device's share menu, locate the options for Raspicast. To begin playback immediately, tap Raspicast (Cast) to complete the process.
If you want to queue videos for playback later, however, tap Raspicast (Queue) instead. This creates a temporary Raspicast playlist for YouTube videos, playing them each in turn before reaching the end.
YouTube playback using Raspicast isn't officially supported by Google, so expect some playback issues. If you're having trouble, stop the video and attempt playback again.
You can also alter the quality of video streaming in Raspicast to fix any YouTube buffering issues. To do this, open Raspicast, tap the three-dots menu icon in the top right, then choose Advanced Options.
From the menu, tap YouTube video quality to adjust the video quality. You can also tap the Use HTTP checkbox to help you play videos if you find YouTube's HTTPS domain is blocked in your region.
Unfortunately, any DIY Chromecast isn't going to give the seamless experience you can expect from a real Google-issued Chromecast device. These steps help you create a good imitation, but if you're having trouble, don't forget to give Kodi a try on your Raspberry Pi instead.
There are other ways you can use your Pi for media playback, too. For example, you could turn your Pi into a Plex media server to stream your media across your home or use MusicBox to create a Raspberry Pi music streaming device for your favorite songs and artists.
If you're looking to get off the couch, however, then don't worry—there are plenty of other Raspberry Pi projects you can get stuck into instead.