Open Source TV Casting Engine

Cast anything
to any TV.

Files, URLs, screens, webcams, browser pages — qast normalizes everything into one continuous H.264 stream and delivers it to Chromecast, DLNA, or Roku devices from a single CLI.

CHROMECAST DLNA ROKU PYTHON 3.8+ MIT
terminal
$ qast "https://youtube.com/watch?v=dQw4w9WgXcQ"
discovering devices...
found 3 devices
1) Living Room TV [chromecast]
2) Samsung 65" [dlna]
3) Bedroom Roku [roku]
resolving URL via yt-dlp...
transcoding → H.264/AAC MPEG-TS
buffering... ready
â–¶ casting to Living Room TV 00:32 elapsed
â–ˆ
Install with pip: pip install qast[all] Python 3.8+ · requires ffmpeg

One tool. Every source. Every TV.

qast handles the hard parts — format negotiation, codec transcoding, protocol switching, and timestamp continuity — so you don't have to.

Any source

YouTube, local files, desktop capture, webcam, individual windows, browser pages, RTSP cameras, HLS streams, piped data. Over 1,000 sites via yt-dlp.

Any TV protocol

Chromecast (protobuf/TLS), DLNA (SOAP/UPnP), and Roku (ECP). Auto-discovers devices on your LAN. One command, zero config.

Always-transcode

Every input is normalized to H.264 Main / AAC in MPEG-TS. This guarantees playback on every TV without format guessing or negotiation failures.

Queue & playlist

Chain multiple sources with per-item durations, loop, shuffle, and playlist files. Seamless transitions with PTS rewriting.

Python API

Three-line one-shot casting or full queue control with Qast(). Build scheduled playback, signage, and automation.

Frame-accurate pipeline

Video frame counting in MPEG-TS for bitrate-independent timing. 64 MB ring buffer with content-time throttling. No gaps, no glitches.

Pipeline

Every source follows the same path. Mixed inputs produce one continuous, TV-compatible stream.

Source URL, file,
screen, cam
Resolve yt-dlp
extraction
Transcode ffmpeg
H.264 / AAC
Rewrite PTS/DTS
continuity
Buffer 64 MB ring
+ throttle
Serve HTTP
stream
TV Cast, DLNA,
or Roku
CODEC
H.264 Main + AAC
1080p30, 5 Mbps, ultrafast preset. 2-second GOP for reliable seeking.
CONTAINER
MPEG-TS / fMP4
MPEG-TS for DLNA & Roku. Fragmented MP4 remux for Chromecast.
BUFFER
64 MB ring
In-memory, time-based flow control. Frame counting throttles encoder to prevent runaway.
DISCOVERY
SSDP + mDNS
Parallel multi-protocol scan. Adaptive timeout learning from consecutive failures.

Everything is castable

If it produces video, qast can put it on your TV.

URLs
YouTube, Vimeo, Twitch, TikTok & 1000+ sites
Files
MP4, MKV, AVI, WebM, FLV, WMV, OGG
screen
Full desktop capture
window:Title
Individual window capture
webcam
Camera feed to TV
browser:url
Headless Chromium render
RTSP
Security cameras, IP cams
HLS / IPTV
Live streams & M3U playlists

Simple by default, powerful when needed

From one-liners to programmatic queue management.

# Cast a YouTube video to the first device found
$ qast "https://youtube.com/watch?v=dQw4w9WgXcQ"
$ qast video.mp4 -d "Samsung" # target a specific TV
$ qast screen@5m # desktop capture, 5 minutes
$ qast window:Grafana@5m # single window capture
$ qast --playlist morning.txt --repeat # playlist with loop
$ qast browser:http://localhost:3000@30 # render webpage on TV

Three protocols, one command

qast auto-discovers devices and drives the right protocol. You never think about it.

Chromecast DLNA Roku
Discovery mDNS / DNS-SD SSDP multicast SSDP multicast
Signaling Protobuf / TLS SOAP / UPnP ECP / HTTP
Container Fragmented MP4 MPEG-TS MPEG-TS
TVs Chromecast, Android TV, Google TV Samsung, LG, Sony, most smart TVs All Roku devices
Dependency pychromecast None (built-in) None (built-in)

Ready to cast?

Install qast, point it at a URL or file, and it's on your TV.