Skip to content

Instantly share code, notes, and snippets.

@gatlin
Created July 19, 2019 17:22
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 gatlin/daaf7da76dbdd8aa884b291861dd652a to your computer and use it in GitHub Desktop.
Save gatlin/daaf7da76dbdd8aa884b291861dd652a to your computer and use it in GitHub Desktop.
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
@piDNS
Copy link

piDNS commented Oct 9, 2023

I want to stream a video and an audio file to the chromecast. The way I do it is:

cvlc "http://video" --input-slave="http://audo" --sout "#chromecast" --sout-chromecast-ip=192.168.178.51 --demux-filter=demux_chromecast

In this command the --input-slave is not played by the chromecast. If I remove the --demux-filter, the video and audio are played, but they are played like lightspeed.

Is there any solution? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment