castor  by stupside

Terminal-based web video casting to smart TVs

Created 6 months ago
1,715 stars

Top 23.9% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

Castor addresses the limitation of smart TVs and screen mirroring by enabling direct, high-quality casting of arbitrary web video streams from the terminal. It targets power users and developers seeking a robust solution for streaming content from web pages or direct URLs to their TVs without quality loss or lag. The primary benefit is seamless, full-quality video playback initiated and controlled via a command-line interface.

How It Works

Castor employs headless Chrome, controlled via the Chrome DevTools Protocol, to navigate web pages and identify video streams by monitoring network traffic. It then executes a short pipeline to initiate playback, often involving clicks within the largest iframe, to find and extract the direct stream URL. This extracted stream is transcoded in real-time using ffmpeg to a format compatible with the target TV, supporting hardware acceleration where available, and then cast.

Quick Start & Requirements

  • Installation: Recommended: Native binary. Alternatives: Homebrew (brew install --cask stupside/tap/castor on macOS), Docker (Linux-only), or from source (requires Go 1.26+ and cmake).
  • Prerequisites: Chrome/Chromium (for headless extraction), ffmpeg, and ffprobe must be on the system's PATH. Building from source requires Go 1.26+ and cmake.
  • Resource Footprint: Auto-downloads Whisper models (~75MB for default tiny.en). Transcoding can be CPU-intensive unless hardware acceleration is utilized.
  • Links: Project repository: https://github.com/stupside/castor

Highlighted Details

  • Extracts and casts the "real stream" from web pages or direct URLs for full quality.
  • Supports auto-generated subtitles transcribed by Whisper and burned into the video stream.
  • Configurable sources allow users to define how titles are resolved against custom templates and proxies.
  • Leverages DLNA/UPnP for broad compatibility with most smart TVs and networked players.
  • Prioritizes hardware encoding (VA-API, VideoToolbox) for transcoding when available, falling back to software (libx264).

Maintenance & Community

Details regarding notable contributors, sponsorships, community channels (e.g., Discord/Slack), or a public roadmap are not provided in the README.

Licensing & Compatibility

The README does not specify a software license. Users are responsible for ensuring their use complies with website terms of service and local laws, particularly concerning copyright infringement. Castor does not decrypt or circumvent DRM.

Limitations & Caveats

Castor's extraction mechanism relies on automated browser interaction and may not work on all websites, particularly those with complex anti-automation measures. It explicitly does not handle DRM-protected content. The Docker image has networking limitations on macOS and Windows, requiring specific configurations or native binary use. Chromecast support is experimental and contributions are welcomed.

Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.