Skip to content

Instantly share code, notes, and snippets.

@frafra
Last active September 22, 2019 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frafra/9f5770c6af6e4dcdf91ba815225e5e65 to your computer and use it in GitHub Desktop.
Save frafra/9f5770c6af6e4dcdf91ba815225e5e65 to your computer and use it in GitHub Desktop.
Tricks to use Chromecast on GNU/Linux systems

No weird or unmaintained softwares or libraries are involved in this guide, just VLC, Avahi and youtube-dl.

VLC + Chromecast

VLC supports Chromecast since version 3.0.0 (2018-02-09). Just go to Playback -> Renderer.

vlc --sout "#chromecast" --sout-chromecast-ip=$IP --demux-filter=demux_chromecast "$input"

Avahi + Chromecast

List devices

avahi-browse -arpc | grep '^=;.*;Chromecast-'

Get IP from device name

avahi-browse -arpc | grep "\"fn=$name\"" | cut -d\; -f8

VLC + Avahi + Chromecast

vlc --sout "#chromecast" \
    --sout-chromecast-ip=$(avahi-browse -arpc | grep "\"fn=$name\"" | cut -d\; -f8) \
    --demux-filter=demux_chromecast "$input"

VLC + Avahi + Chromecast + youtube-dl

youtube-dl "$url" -o - |
  vlc --sout "#chromecast" \
      --sout-chromecast-ip=$(avahi-browse -arpc | grep "\"fn=$name\"" | cut -d\; -f8) \
      --demux-filter=demux_chromecast -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment