Skip to content

Instantly share code, notes, and snippets.

@gatlin gatlin/cast.sh
Created Jul 19, 2019

Embed
What would you like to do?
Use VLC without a UI to cast videos to chromecast
#!/bin/bash
MEDIA_FILE="$1"
if [ -z "$1" ]; then
echo "Please specify a media file as the first argument."
exit 1
fi
CHROMECAST_IP4_ADDRESS="$2"
if [ -z "$CHROMECAST_IP4_ADDRESS" ]; then
if [ -e "$HOME/.castrc" ]; then
. $HOME/.castrc
else
echo "Please give a chromecast IP4 address as the second argument."
exit 1
fi
fi
/usr/bin/env vlc "$MEDIA_FILE" \
-I dummy \
--sout "#chromecast" \
--sout-chromecast-ip="$CHROMECAST_IP4_ADDRESS" \
--demux-filter=demux_chromecast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.