Stream Local Media from the Command Line to ChromeCast with Stream2chromecast

How to Stream Local Media From the Command Line to ChromeCast with Stream2chromecast

Chromecasts are insanely popular. Recently, Google let it be known that they’ve sold over 29 million of them. However, since the inception of this device, few programs have existed that make it possible to stream local media files, instead focusing on services.

That’s why Stream2chromecast was created. It allows you to stream all sorts of content, even transcode or stream it from the Internet, directly to your Chromecast. And this all can be done on the Linux command line.

So, how do you get it working?

This software makes use of codecs. There are two choices when it comes to this. You can either install the ever-popular FFMPEG, or Avconv. Either will work, but we highly suggest using FFMPEG.

Note: though this guide covers dependencies needed for Ubuntu, that does not mean that it will not work on other Linux distributions. Install the software dependencies listed with your package manager and follow the instructions afterwards.

Python2

You’ll need python on your system, as this tool is built with Python. Don’t worry, if you’re on Ubuntu chances are it’s already installed. If, for some reason, it isn’t there, just open your package manager, look for python2 (or something similar), and install it.

FFMPEG

This can be installed onto Ubuntu by adding a PPA to your system and installing it. Doing this will give you the latest version of the software.

Now that the personal package archive has been added, you’ll need to update your software sources.

Now that the software has been updated, just install FFMPEG.

AVConv

Avconv resides in the Ubuntu official software repositories. Install it by simply entering the following:

Now that codecs have been installed, it’s time to get the actual software. Start out by installing git if you don’t have it already.

With git installed, we can pull the software.

stream2chromecast-developer-github

Everything should run right away, as there’s not really any sort of compiling needed here. To get started, just enter the directory.

stream2chromecast-directory-listing

Once you’re in the directory, it’s time to run the program. Since this is a python script, you’ll need to run it with python.

It doesn’t need any compiling, and it’ll easily run by just entering the following command:

However, just because you ran these commands doesn’t mean that the Chromecast will broadcast anything. For that to work you’ll need to go through the options and figure out exactly how you want to stream to the Chromecast. Here’s how to do that.

stream2chromecast-starting-stream

This command here will send a video file to your Chromecast.

However, you won’t always have an MP4 file at your disposal. This is why we installed a transcoder before. Run this command and your content will be converted to a supported format and streamed.

stream2chromecast-command-listing

This tool has perhaps a laundry list of different things you can do to your Chromecast, and right from the command line, too! Here are the most useful commands. For a complete list, head here.

Controlling playback

Let’s start off with controlling playback. If you wish to pause a playing file, just run:

To resume the same file, do:

To stop playback, try:

Volume control

If you’re familiar with most Chromecast-enabled apps, you’ll no doubt notice how they let you control the output of volume for playback. Here’s how to do this with Stream2chromecast:

Turn it up by 0.1 decible with the -volup switch

Turn it down by 0.1 decible with the -voldown switch

You’ll also be able to mute it with the -mute switch and use the -setvol switch to set an exact volume.

Stream from a URL

Did you know you could stream a remote media file from the command line to your Chromecast? Use this:

Specify Device

If you’re looking to figure out exactly what Chromecast to stream to because you have multiple devices on your network, run this command to figure out what the device name is.

Once you’ve found the device name, play media on it like this:

Streaming local media has always been a thing ever since Chromecast was created. You have AllCast, Videostream, etc. Still, those solutions are either dependent on Android or browser applications and websites.

These are fine, but as Linux users, we should strive for a better, faster, and simpler solution. That’s what Stream2chromecast brings – a simple, easy to use command line setup that anyone can figure out and even automate if they know python.

Do you like to stream local media on your Chromecast? Tell us why or why not below!

Image Credit: Wikimedia commons

One comment

Comments are closed.

Sponsored Stories