Skip to main content

Cast local videos to your chromecast

Project description

Terminalcast

Command line tool to cast local video files to your chromecast.

Inspired by https://github.com/keredson/gnomecast

Supported media types

Checkout https://developers.google.com/cast/docs/media for your Chromecast model.

Use ffmpeg to convert unsupported files to a supported format:

ffmpeg -i '{input_file}' -metadata title="{title}" -map 0 -c:v {video_codec} -c:a {audio_codec} -c:s copy '{output_file}'

Supported Chromecast versions

In principle this should work with any Chromecast which is supported by https://github.com/home-assistant-libs/pychromecast.

In practice, I discovered that a Chromecast with Google TV enables you to control the player via the remote control, which is very nice.

Installation

pip install terminalcast

Usage

Basic Usage

terminalcast my_video.mp4

Known Hosts

If network discovery fails (e.g. due to network restrictions), you can specify known Chromecast IPs:

terminalcast my_video.mp4 --known-hosts 192.168.1.50,192.168.1.51

Alternatively, set the environment variable TERMINALCAST_KNOWN_HOSTS:

export TERMINALCAST_KNOWN_HOSTS="192.168.1.50,192.168.1.51"
terminalcast my_video.mp4

How is it working?

Terminalcast creates a little HTTP Server at your current machine and serves your media file there. Then it tells the Chromecast the play the stream served at your IP with the corresponding path. That's it! (The devil is in the details.)

Terminalcast uses Bottle to create a small app providing the media file. This app is served by Waitress.

On the other hand Terminalcast detects and plays the media via PyChromecast.

For file information and conversion ffmpeg-python is used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terminalcast-1.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terminalcast-1.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file terminalcast-1.1.0.tar.gz.

File metadata

  • Download URL: terminalcast-1.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for terminalcast-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d9fce068a3582dd74c1451c9427b411c95172b1d782b2a8573e949421be8855c
MD5 55ad2172152b18e6b0e5de14bc491f3a
BLAKE2b-256 e7d0f5dc10d3ccfb3387d1ed5aae709050d974ab41e11b114577eb652234e1f3

See more details on using hashes here.

File details

Details for the file terminalcast-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: terminalcast-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for terminalcast-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e562acfdf2e9e657835d94000ace10cc058f046f9f748cdd9c4dfc7bf6a2eba
MD5 8968fca120ced1636059c5be49124b53
BLAKE2b-256 5fa8440a085398695f589243b365fd390376daa2347f863231fdf45db4b749eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page