This is a simple CLI tool for streaming a video file to a Chromecast device. It is implemented in Python and requires PyChromecast library for communicating with the Chromecast device.
This is somewhat similar to Mkchromecast but simpler. The intention is to enable simple viewing of video files on a Chromecast device from a Linux command line. It might work on some other OSes too.
This script does not do any conversion. It expects the video file to already be already in a format that is accepted by the Chromecast device.
There are no controls for playback. The assumption is that it is used with "Chromecast with Google TV" type device that can be controlled with a remote control. However playback can be gracefully stopped by pressing Ctrl-C.
Subtitles can be supplied using a separate VTT file.
By default the first Chromecast device discovered on the local network is used.
Install from PyPI with pip:
pip install ccastplayerInstall from PyPI with pipx:
pipx install ccastplayerInstall from PyPI with uv:
uv tool install ccastplayerInstall directly from the GitHub repository:
pip install "ccastplayer @ git+https://github.com/snabb/ccastplayer.git"
pipx install git+https://github.com/snabb/ccastplayer.git
uv tool install git+https://github.com/snabb/ccastplayer.gitExample usage with a local video file:
ccastplayer myvideo.mp4Example usage with a local video and subtitles file:
ccastplayer myvideo.mp4 --subs mysubs.vttExample usage with a remote video file:
ccastplayer http://example.org/videos/myvideo.mp4If the script is unable to auto-discover the device in your local network,
you can supply the IP address with the --chromecast-ip option:
ccastplayer --chromecast-ip 192.0.2.123 example.mkvMore help on command line options:
ccastplayer --helpRun the test suite with:
python3 -m unittest discover -s tests -v