Skip to content

Instantly share code, notes, and snippets.

@gatlin
Created July 19, 2019 17:22
Show Gist options
  • 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

@gatlin
Copy link
Author

gatlin commented Jan 15, 2025

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

Hello! You had no way of knowing this but I had two children between October of 2022 and March of 2024. I haven't been able to get to this yet but I don't want to ignore you either. If you find a solution before I do please do share!

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