You probably already know that you can use your Raspberry Pi as a media center. You can even install Kodi for offline and online media management. But what if you’re happier to keep Raspbian as your primary operating system?
Well, if you have a mobile device that you don’t mind using to control your media, you can use it to cast videos to your TV. Yes, you can use your Raspberry Pi like a Chromecast. You won’t be able to use the Cast button on Android, but YouTube videos, pictures, audio, and images can be cast to your TV.
Install the Raspicast App
Start by installing Raspicast on your Android device. This is a free app that connects to your Raspberry Pi and sends data to it. As long as your Pi is connected to an HDMI input on your TV or display, you will be able to view media on your phone. You will find Raspicast in the Google Play App Store. Unfortunately, there is no reliable alternative to the iPhone for this.
Download: Raspicast for Android
It’s important to note that both the Android phone and the Raspberry Pi need to be on the same network for this to work. For example, you can’t cast video from your phone to your TV while you’re on the bus. If you’re trying to share a video with someone at home, just email them the link!
After installing the application, turn your attention to the Raspberry Pi. It should already be connected to the TV via HDMI and turned on. We tested this on a Raspberry Pi 3 running Raspbian Stretch. However, you should make sure it works with other Raspberry Pi distributions (although some commands may differ).
Since you need to enable SSH, here is a quick guide. You have three options to enable it:
- Through raspi-config . You can run this from the command line using sudo raspi-config then select » Interface Options» > «SSH» and use the arrow keys to confirm with » OK» .
- Use raspberry pi configuration tool . On your Raspbian desktop, open Menu > Settings > Raspberry Pi Configuration . On the tab » Interfaces » find SSH and set it to » Included» .
- Finally, if you prefer simplicity, you can enable SSH before booting the Pi . Insert a microSD card into your computer, navigate to the boot partition and create a new file. It should be called ssh and not have a file extension. After replacing the SD card and rebooting, SSH should be enabled.
Now it’s time to run some updates. Start by opening a terminal window on your Pi and running:
sudo apt-get update sudo apt-get upgrade
These commands will update your Raspberry Pi’s operating system and will also find and install any software updates.
Install and build OpenMax
After installing the updates, we need the necessary packages:
sudo apt-get install libjpeg9-dev libpng12-dev
Packages libjpeg9-dev and libpng12-dev needed to create programs that can process JPG and PNG images. This will allow you to stream media to your Raspberry Pi via the Raspicast app on Android!
Now install OpenMax. This tool is the best option to cast video, audio and images from Android device to Raspberry Pi connected to TV. It’s available via GitHub and you can install it by «cloning» the datastore on your Pi:
git clone https://github.com/HaarigerHarald/omxiv
It shouldn’t take long.
You are almost done; it’s time to build the OpenMax software. Start by switching to the omxiv directory and using the make command.