Sign inSign up

erkalina/stream-to-dlna

By erkalina

•Updated 5 months ago

Streams internet radio to a dlna player. Supports transcoding.

Image
Networking
Internet of things
0

1.6K

erkalina/stream-to-dlna repository overview

⁠DLNA Radio Streamer

Tests Python 3.11+

Stream internet radio to DLNA devices with automatic format detection and smart transcoding.

Latest: v0.5 - See CHANGELOG⁠ for release notes.

⁠Features

  • Interactive Web Console at http://localhost:5000 - test API endpoints and manage devices
  • Automatic DLNA device discovery via SSDP/UPnP
  • Smart transcoding: passthrough when device supports native format, FFmpeg transcoding when needed
  • Auto-select default device on startup via dlna.default_device_ip config
  • Stream format caching - reduces repeated format detection
  • Multi-device support with persistent selection
  • Device cache with background scan on startup
  • Direct connection fallback for devices not responding to SSDP
  • REST API for control and automation
  • Optional API key authentication for protected endpoints
  • Optional rate limiting support
  • Filters MediaRenderer devices (excludes NAS/MediaServers)

⁠Quick Start

docker run -d \
  --name stream-to-dlna \
  --network host \
  -v $(pwd)/config.yaml:/app/config.yaml:ro \
  -v $(pwd)/data:/data \
  erkalina/stream-to-dlna:latest

Or use docker-compose.yaml from the repository.

⁠Configuration

Create config.yaml:

radio:
  default_url: "https://your-radio-stream.com"

# Optional: Auto-select DLNA device on startup
dlna:
  default_device_ip: "192.168.0.100"

server:
  host: "0.0.0.0"
  port: 5000

streaming:
  internal_port: 8080
  mp3_bitrate: "128k"

# Persistent storage for device cache and stream format cache
storage:
  data_dir: "/data"
  stream_cache_ttl: 86400  # 24 hours

# Optional: API authentication
security:
  api_auth_enabled: false
  # api_key: "your-secret-key"

Device configuration is done via API.

⁠Web Console

Open http://localhost:5000 in your browser for the interactive development console:

  • Device discovery and selection
  • Playback control (play/stop)
  • Status monitoring
  • Real-time API output

Or use CLI/API directly:

# Get devices (force scan)
curl http://localhost:5000/devices?force_scan=true

# Select device by IP
curl -X POST http://localhost:5000/devices/select?ip=192.168.1.100

# Start playback
curl -X POST http://localhost:5000/play?streamUrl=https://stream.url

# Check status
curl http://localhost:5000/status

# Stop playback
curl -X POST http://localhost:5000/stop

⁠Tested Devices

  • Panasonic SC-PMX9
  • Samsung HW-Q90R

⁠Version History

  • v0.5 - Mobile-first GUI, DLNA compliance fixes for Samsung/strict renderers, auto-versioning from git tags
  • v0.4 - Default device auto-select, stream format caching, enhanced AAC detection
  • v0.3 - Security features (API auth, rate limiting), reliability improvements
  • v0.2 - Development console, testing, device caching
  • v0.1 - Initial release with core DLNA streaming

See CHANGELOG⁠ for detailed release notes.

⁠Documentation

⁠License

MIT License

Tag summary

Content type

Image

Digest

sha256:e725ce7b7…

Size

208.4 MB

Last updated

5 months ago

docker pull erkalina/stream-to-dlna