Cast Videos To Chromecast On Linux With Gnomecast

Gnomecast gnome chromecast player

Gnomecast offers a very easy way of casting local video and audio files to Chromecast devices from Linux. It is ideal for quickly playing an audio or video file on your Chromecast, without waiting for some media server to index it.

While it uses a very basic interface and you won't find many advanced options, this Gnome (uses Gtk+ and Python) Chromecast player takes care of most things you'd need. Besides being able to play / pause, control the volume or seek, Gnomecast lets you add subtitles, and it automatically transcodes both audio and video files that can't be played directly by Google Chromecast devices.

Gnomecast features:

  • play both audio and video files on Chromecast devices
  • realtime transcoding when needed (using ffmpeg)
  • subtitles: embedded and external SRT files
  • can play 4K videos on the Chromecast Ultra
  • fast scrubbing

Some features that are currently lacking in Gnomecast - but might be implemented in a future release -, include automatically picking up subtitles in the same folder, connecting directly to a Chromecast via IP, and keyboard shortcuts. There's no playlist support for now either.

While it officially only supports Linux, Gnomecast appears to be working on MacOS too.

Related: Command Line Chromecast Player CATT Gets Support For Subtitles And Website Casting

"But VLC can cast local files too!" Indeed, a feature to allow playing local files on Chromecast was also added to VLC with version 3.0, but it never worked well for me. Obviously, Gnomecast can't compete with VLC, but it does provide better Chromecast functionality with a minimalistic, easy to use interface.

For more complex and feature-rich alternatives that can run on Linux, you may want to check out Emby or Plex media servers.

Install Gnomecast


Gnomecast can be found on GitHub.

The Gnomecast installation instructions mention using pip3 with sudo for installing the app. This is discouraged as it may cause issues, so using my instructions below, Gnomecast is installed for the current user only, so it doesn't interfere with your system.

1. Add ~/.local/bin to your PATH (if it's not already added). Also export the PYTHONPATH as /usr/lib/python3/dist-packages:$PYTHONPATH to avoid having apps picking up Python modules from ~/.local/lib.

You can do this manually or run the following command (and source .bashrc / .zshrc):

- for Bash:

echo "export PATH=\"\$PATH:\$HOME/.local/bin\"" >> ~/.bashrc
echo "export PYTHONPATH=\"/usr/lib/python3/dist-packages:\$PYTHONPATH\"" >> ~/.bashrc
. ~/.bashrc

- for Zsh:

echo "export PATH=\"\$PATH:\$HOME/.local/bin\"" >> ~/.zshrc
echo "export PYTHONPATH=\"/usr/lib/python3/dist-packages:\$PYTHONPATH\"" >> ~/.zshrc
. ~/.zshrc

2. Install Python3 PIP, Python3 Setuptools, and FFmpeg.

In Debian / Ubuntu / Linux Mint, use:

sudo apt install python3-pip python3-setuptools ffmpeg

3. Install Gnomecast using Python3 PIP:

pip3 install --user gnomecast

If you get some permission or errors when trying to install Gnomecast for the current user, it might happen because you previously used sudo to install some package using Python3 PIP, which broke installing packages using PIP without sudo. In such cases, use "sudo" before the command above.

4. Log out and log back in.

Gnomecast should now show up in your menu.


To update Gnomecast installed using Python3 PIP, use:

pip3 install --user gnomecast --upgrade

6 comments:

  1. Can't get this to work - get
    pip3 install --user gnomecast
    Traceback (most recent call last):
    File "/usr/bin/pip3", line 9, in
    from pip import main
    ImportError: cannot import name 'main'

    ReplyDelete
    Replies
    1. This sounds like you've installed pip packages with sudo before. Since you've already done it, you can use it to install gnomecast too: sudo pip3 install gnomecast

      Delete
  2. Ah...no. That WAS run as sudo.

    ReplyDelete
  3. Ok the pip import main error was a python bug which has now been corrected, but an additional requirement is to install setuptools. On Debian/Ubuntu :-
    sudo apt install python3-setuptools
    Then pip3 install --user gnomecast will work. And gnomecast works just fine on my system now. Thanks for the pointer.

    ReplyDelete
    Replies
    1. Actually, you don't need to do that as root. I used
      pip3 install --user gnomecast - without sudo. Something else popped up - it seems to kill the internet connection while gnomecast is running. I will look more into that later.

      Delete
    2. I added python3-setuptools to the instructions. Thank you.

      Delete

Powered by Blogger.