Connect with us

How To

How to Use Raspberry Pi as a Chromecast Alternative?

Published

on

Google’s Chromecast is one of the most popular audio and video streaming services available. The small device plugs into the HDMI port and controlled by the computer or even a mobile device. Casting through this device is as simple as tapping a button in the supported applications. the good news is you can do a similar thing with the Raspberry Pi. In this article, we will explain to you how to use your Raspberry Pi as the Chromecast alternative. Here I have to mention one thing, that is the Raspberry Pi won’t behave like the exact alternative and it doesn’t support Google’s Cast button, but it supports streaming YouTube videos as well as local audio, images, and videos from your device to your TV. Let us discuss on Raspberry Pi Chromecast:

Raspberry Pi Chromecast
Raspberry Pi Chromecast

Related: How to set up a Web Server on the Raspberry Pi?

How to Use Raspberry Pi Chromecast Alternative?

For this project, we need to have two programs installed on the Raspberry Pi (OMXPlayer and OpenMax image viewer for the Raspberry Pi) and one installed on the device you wish to cast from (Rapicast). The audio and video content which you stream from the smart device to the Raspberry Pi and your TV can be played using the OMXPlayer, and the image content will be displayed using the OpenMax image viewer for the Raspberry Pi. OMXPlayer comes with the Raspbian OS, here we use this Operating System to make things easy.

Step 1: Now before we get started to set up Your Raspberry Pi as a Chromecast-like device, you must first make sure that our Raspberry Pi is actually up to date and that you have the latest package list.

You can update your Raspberry Pi by running the following two commands on it.

sudo apt-get update
sudo apt-get upgrade

Raspberry Pi Chromecast
Raspberry Pi Chromecast

Step 2: In this project, we need to use GIT and Make. While these packages have already been installed on the Raspbian, You can run the command below just to ensure they are installed.

sudo apt-get install git make -y

Step 3: After ensuring your Raspberry Pi up to date, then you need first to ensure that you have the OMXPlayer installed, while Raspbian usually comes with this installed you can make sure it exists anyway. Because this only handles the video and audio processing for any video or audio files.

The primary advantage of the OMXPlayer is that it was designed specifically for the Raspberry Pi’s GPU meaning it offers some of the best performance, something that is critical for any files that are cast.

Run the following command to install OMXPlayer on to your Raspberry Pi.

sudo apt-get install omxplayer -y

Step 4: Now OMXPlayer is installed on your Raspberry Pi, we now have the software ready which can handle your video and audio files, but you still need something that can handle images.

For handling images on your Raspberry Pi Chromecast, You have to install a software that is called OpenMax Image Viewer.

OpenMax Image Viewer is must for this project as it is the GPU accelerated image viewer explicitly designed for the Raspberry Pi’s GPU So that you can display an image as fast as possible and reduce the load on the Raspberry Pi’s CPU.

Raspberry Pi Chromecast
Raspberry Pi Chromecast

To start the process of setting up OpenMax Image Viewer, You must first clone its code repository from Github.

Just run the following two commands on the Raspberry Pi to clone this repository to your Raspberry Pi.

cd ~
git clone https://github.com/HaarigerHarald/omxiv.git

Step 5: With the OpenMax Image viewers code now cloned to your Raspberry Pi, Now you have to install a couple more packages.

These two packages that you need are libjpeg8-dev and libpng12-dev. These packages contain development libraries for the PNG format and the JPEG format, both which are required to compile the code.

Now download and install these packages on your Raspberry Pi by running the following command.

sudo apt-get install libjpeg8-dev libpng12-dev

Note: If for some reason Raspbian fails to find the packages, try running sudo apt-get update.

Step 6: Now you can finally proceed on to the steps to compiling and installing the OpenMax Image viewer on your Raspberry Pi Chromecast device.

To begin this, you must change into the directory where you cloned your code, you can do this by running the following command on the Raspberry Pi.

cd ~/omxiv

Step 7:  Now that you are in the right directory, Now you have to initialize the compiling process. Compiling will give you the files, that you need to run the OpenMax Image Viewer software on your Raspberry Pi Chromecast device.

Raspberry Pi Chromecast
Raspberry Pi Chromecast

compiling the code is a very simple and straightforward process.

To do this run the following two commands on your Raspberry Pi.

make iclient
make

Step 8: With the OpenMax Image Viewer now compiled, there is one last command we have to use. This last command is what will setup OpenMax on your Raspberry Pi so that it is available on the general operating system.

Now type the following command into a terminal on the Raspberry Pi, and you will be all set to proceed to the next section of the guide.

sudo make install

Related: How to Boot Your Raspberry Pi from a USB Mass Storage Device?

Step 9: Now the last thing you have do is grab your Raspberry Pi’s local IP address.

Then run the following command to grab to do it, make sure the ‘I‘ is capitalized otherwise this command won’t work properly.

hostname -I

The command will return your Raspberry Pi’s private IP address. Write that down and continue with the Raspicast’s settings dialogue. If you have not changed your credentials, your username is pi and the password is raspberry.

Thank you for reading this post.

Facebook

Trending

Would you like to receive notifications on latest updates? No Yes