Metadata-Version: 2.4
Name: terminalcast
Version: 1.1.0
Summary: Cast local videos to your chromecast
Author-email: Johannes Paul <vanadinit@quantentunnel.de>
License: MIT
Project-URL: Homepage, https://github.com/vanadinit/terminalcast
Keywords: Chromecast,video,local,movie
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bottle
Requires-Dist: ffmpeg-python
Requires-Dist: waitress
Requires-Dist: pychromecast>=13.0.0
Requires-Dist: zeroconf>=0.31.0
Dynamic: license-file

# 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:
```commandline
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
```commandline
pip install terminalcast
```

## Usage

### Basic Usage
```commandline
terminalcast my_video.mp4
```

### Known Hosts
If network discovery fails (e.g. due to network restrictions), you can specify known Chromecast IPs:
```commandline
terminalcast my_video.mp4 --known-hosts 192.168.1.50,192.168.1.51
```
Alternatively, set the environment variable `TERMINALCAST_KNOWN_HOSTS`:
```bash
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](https://bottlepy.org/docs/dev/) to create a small app providing the media file. This app is
served by [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).

On the other hand **Terminalcast** detects and plays the media via [PyChromecast](https://pypi.org/project/PyChromecast/).

For file information and conversion [ffmpeg-python](https://pypi.org/project/ffmpeg-python/) is used.
