MCPcopy Index your code
hub / github.com/alexballas/go2tv

github.com/alexballas/go2tv @v2.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.3.0 ↗ · + Follow
1,211 symbols 3,715 edges 116 files 239 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go2TV logo

Go Report Card Release Version Tests

Build for ARMv6 (32-bit) Build for ARMv8 (64-bit) Build for Android Build for Linux Build for MacOS Intel Build for MacOS Apple Silicon Build for Windows

Cast media files to Smart TVs and Chromecast devices.


What is Go2TV?

Go2TV lets you play video, audio, and image files on your Smart TV or Chromecast device directly from your computer or phone. It works with:

  • Smart TVs - Samsung, LG, Sony, and others that support DLNA/UPnP
  • Chromecast - Google Chromecast, Chromecast with Google TV, and compatible devices
  • Apps - BubbleUPnP, GMediaRender, and other media receiver apps

No need to copy files to a USB drive or set up a media server. Just select your file, pick your device, and play.


Installation

Download the latest release from the releases page.

  • Windows: Download go2tv_vX.Y.Z_windows_amd64.zip, extract, and run go2tv.exe
  • macOS: Download go2tv_vX.Y.Z_macOS_amd64.zip (Intel) or go2tv_vX.Y.Z_macOS_arm64.zip (Apple Silicon), extract, and run the app
  • Linux: Download go2tv_vX.Y.Z_linux_amd64.zip (or appropriate arch), extract, and run go2tv
  • Android: Download the APK (go2tv_vX.Y.Z.apk) or zip (go2tv_vX.Y.Z_android.zip)

Go2TV is a single executable with no installation required. Just download and run.

Optional: FFmpeg for Transcoding

For maximum compatibility with all devices and file formats, install FFmpeg. Go2TV will automatically use it when needed. When transcoding is enabled, Go2TV probes available GPU H.264 encoders first and falls back to libx264 if hardware encoding is unavailable or fails at startup.

  • Linux: sudo apt install ffmpeg or equivalent for your distro
  • macOS: brew install ffmpeg
  • Windows: Download from ffmpeg.org and add to PATH
  • Flatpak: FFmpeg is bundled automatically

Screenshots

GUI Mode

CLI Mode


Playlist (GUI)

Go2TV GUI keeps the current selection in a Playlist, even for a single file.

  • Selecting or dropping a single local file creates a 1-item playlist
  • Selecting or dropping multiple files creates a multi-item playlist
  • The Playlist window lets you add, remove, reorder, and select items
  • Drag and drop on the main window replaces the current playlist
  • Drag and drop on the Playlist window appends files when a playlist already exists
  • Next, Previous, and Auto-Play Next File follow the playlist order
  • Auto-Play Next File wraps to the start of the playlist when it reaches the end
  • Same File Types Only is still respected for auto-play traversal

RTMP Streaming (Chromecast only)

Go2TV can act as an RTMP server, allowing you to stream from OBS or other software directly to your Chromecast. This feature requires FFmpeg.

  1. Select a Chromecast device.
  2. Check the RTMP Server box.
  3. Click Play in Go2TV (the app will wait for the stream).
  4. Use the provided URL in your streaming software (e.g., OBS Settings > Stream).
  5. Start streaming in your software.

Cast Desktop (Experimental, Chromecast only)

Go2TV can cast your desktop as a live stream to Chromecast devices. This feature is experimental and requires FFmpeg.

  1. Select a Chromecast device.
  2. Check Cast Desktop (experimental).
  3. Click Cast.

Notes: - Experimental: behavior/performance may vary by system. - Chromecast only (not DLNA/UPnP TVs). - Not supported on audio-only Chromecast devices.


CLI Usage

$ go2tv -h
Usage of go2tv:
  -l    List available devices (Smart TVs and Chromecasts).
  -s string
        Path to subtitles file (.srt or .vtt).
  -t string
        Device URL to cast to (from -l output).
  -tc
        Force transcoding with ffmpeg.
  -u string
        URL to media file (triggers CLI mode).
  -v string
        Path to video/audio file (triggers CLI mode).
  -version
        Print version.

Examples

# List available devices
go2tv -l

# Play a video on your TV
go2tv -v movie.mp4 -t http://192.168.1.100:8060/

# Play with subtitles
go2tv -v movie.mp4 -s movie.srt -t http://192.168.1.100:8060/

# Force transcoding for incompatible formats
go2tv -v video.avi -tc -t http://192.168.1.100:8060/

# Cast to Chromecast
go2tv -v movie.mp4 -t http://192.168.1.50:8009

# Stream from stdin
cat video.mp4 | go2tv -t http://192.168.1.50:8009

# Stream from command output
yt-dlp -o - "https://youtu.be/..." | go2tv -t http://192.168.1.50:8009

# Stream from stdin with transcoding
cat video.mkv | go2tv -tc -t http://192.168.1.50:8009

# Stream from command output with transcoding
yt-dlp -o - "https://youtu.be/..." | go2tv -tc -t http://192.168.1.50:8009

Features

  • Auto-discovery - Automatically finds Smart TVs and Chromecast devices on your network
  • Transcoding - Converts incompatible video formats on-the-fly (requires FFmpeg)
  • Subtitles - Supports external SRT/VTT files and embedded MKV subtitles
  • Seek support - Jump to any position in the video
  • Playlist playback - Single-file and multi-file playlists with add/remove/reorder/select support
  • Loop and auto-play - Loop the current file or auto-play through the playlist
  • Gapless playback - Supported for DLNA devices
  • RTMP Server - Cast live streams from OBS directly to Chromecast (requires FFmpeg)
  • Cast Desktop (experimental) - Cast desktop as live stream to Chromecast (requires FFmpeg)
  • GUI and CLI - Use the graphical interface or command line

Supported File Types (GUI)

mp4, avi, mkv, mpeg, mov, webm, m4v, mpv, mp3, flac, wav, jpg, jpeg, png

The CLI accepts any file type.


Companion Project: mcp-beam MCP Server (Powered by Go2TV)

mcp-beam is a companion MCP server (stdio transport) built on top of Go2TV core packages.

Use it when you want MCP clients/agents to:

  • Discover Chromecast and DLNA/UPnP devices on your LAN
  • Cast local media files
  • Cast remote media URLs
  • Stop active playback sessions

If you want direct end-user control, use Go2TV GUI/CLI.
If you want tool-driven casting from MCP-compatible workflows, use mcp-beam.


Notes

Chromecast receiver

Go2TV uses a custom Chromecast receiver hosted at https://cast-receiver.go2tv.app/. It is not part of this open-source repository and is not currently published. Functionality matches the default receiver, with minor branding differences.

Firewall Configuration

Go2TV uses ports 3339-3438 for device discovery. If you're behind a firewall, allow inbound UDP traffic on these ports.


Building from Source

Requirements: Go 1.25

git clone https://github.com/alexballas/go2tv
cd go2tv
make build

AppImage build (Linux)

make appimage

v2.1 style build. No bundled ffmpeg/ffprobe.

AppImage build (with ffmpeg, Linux)

make appimage-ffmpeg
  • APPIMAGE_FFMPEG_MODE=auto (default): use host ffmpeg/ffprobe if static; else download prebuilt bundle
  • APPIMAGE_FFMPEG_MODE=system: require host ffmpeg/ffprobe
  • APPIMAGE_FFMPEG_MODE=download: always download prebuilt bundle
  • APPIMAGE_FFMPEG_MODE=none: build AppImage without ffmpeg binaries
  • Optional explicit paths: APPIMAGE_FFMPEG_BIN=/path/ffmpeg APPIMAGE_FFPROBE_BIN=/path/ffprobe

Using Docker

Build the image:

docker build --force-rm -t go2tv .

Run the container (Linux with X11):

xhost +local:docker
docker run -it --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix go2tv go2tv

Author

Alexandros Ballas alex@ballas.org

License

MIT

Extension points exported contracts — how you extend this code

Screen (Interface)
Screen interface is used to push message back to the user as these are returned by the subscriptions. [4 implementers]
httphandlers/httphandlers.go
Payload (Interface)
(no doc) [4 implementers]
castprotocol/v2/cast/payload.go
App (Interface)
(no doc) [2 implementers]
castprotocol/v2/application/application.go
Iterator (Interface)
(no doc) [2 implementers]
castprotocol/v2/playlists/playlists.go
Conn (Interface)
(no doc) [2 implementers]
castprotocol/v2/cast/connection.go
CastMessageFunc (FuncType)
(no doc)
castprotocol/v2/application/application.go

Core symbols most depended-on inside this repo

check
called by 139
internal/gui/gui.go
Log
called by 123
soapcalls/soapcallers.go
Close
called by 87
castprotocol/v2/cast/connection.go
String
called by 57
internal/gui/resume_desktop.go
Log
called by 55
castprotocol/client.go
Refresh
called by 38
internal/gui/queue.go
TempDir
called by 36
rtmp/server.go
setPlayPauseView
called by 35
internal/gui/gui.go

Shape

Function 547
Method 462
Struct 185
TypeAlias 8
Interface 7
FuncType 2

Languages

Go100%

Modules by API surface

castprotocol/v2/application/application.go118 symbols
soapcalls/soapbuilders.go65 symbols
internal/gui/queue.go57 symbols
internal/gui/actions.go46 symbols
castprotocol/v2/cast/proto/cast_channel.pb.go46 symbols
soapcalls/soapcallers.go41 symbols
internal/gui/resume_desktop.go40 symbols
internal/gui/gui.go37 symbols
cmd/fynedo-check/main.go34 symbols
castprotocol/v2/application/mocks/App.go34 symbols
internal/gui/device_badges.go30 symbols
cmd/go2tv-lite/go2tv.go26 symbols

For agents

$ claude mcp add go2tv \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page