Media Tools
Media Tools
Software and utilities for media processing, streaming, and management
Available Tools
Termux DLNA Server
A Python-based media server that runs on Android devices via Termux. Serves movies and TV shows from SMB shares to Kodi over DLNA/UPnP with automatic hardware-accelerated transcoding.
Key Features:
- Full DLNA/UPnP server implementation
- SMB client with reconnect-on-failure
- SQLite library database
- Hardware-accelerated transcoding (h264/AAC 720p)
- Forced subtitle extraction and serving
- Direct streaming for compatible files
Use Case: Run a media server on your phone to stream to Kodi without a dedicated server.
Overview
The Media Tools section contains software for:
- Media Streaming — DLNA/UPnP servers and protocols
- Format Conversion — Transcoding and format handling
- Library Management — Media organization and metadata
- Protocol Implementation — DLNA, SSDP, SMB integration
These tools demonstrate how to build robust media systems that work across devices and platforms.
Related Areas
- Physics Tools — Tools for physics research and visualization
- LLM Infrastructure — AI and language model tools
- Utility Scripts — General-purpose scripting tools
- Aurora Tools — Aurora’s internal tools and scripts
Tools for building the media infrastructure of the future.
Termux DLNA Server - Mobile Media Streaming
Termux DLNA Server
Run on your phone, serve Movies/TV Shows from SMB share to Kodi over DLNA with hardware-accelerated transcoding
Overview
The Termux DLNA Server is a Python-based media server that runs on Android devices via Termux. It serves movies and TV shows from an SMB (Samba) network share to Kodi media center over DLNA/UPnP, with automatic hardware-accelerated transcoding to h264/AAC 720p when needed.
This enables you to:
- Run a media server directly on your phone
- Access your SMB shared media library
- Stream to Kodi on Raspberry Pi, TV, or other devices
- Transcode incompatible formats on-the-fly using hardware acceleration
- Extract and serve forced subtitles
Architecture
┌─────────────────────────────────────────────────────────┐
│ Termux DLNA Server │
│ (Python on Android via Termux) │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌────────────┐ ┌────────────┐ ┌────────────────────┐ │
│ │ main.py │ │ config.py │ │ server.py │ │
│ │ (Entry) │ │ (Settings) │ │ (HTTP Server) │ │
│ └──────┬──────┘ └────────────┘ └──────────┬─────────┘ │
│ │ │ │
│ ▼ ▼ ▼
│ ┌────────────────────┐ ┌────────────┐ ┌────────────┐
│ │ scanner.py │ │ ssdp.py │ │ cds.py │
│ │ (Library Scanner) │ │ (Discovery) │ │ (DLNA CDFS) │
│ └────────┬────────────┘ └────────────┘ └────────────┘
│ │ │
│ ▼ ▼
│ ┌────────────────────┐ ┌────────────────────────────┐
│ │ transcode.py │ │ db.py │
│ │ (Transcoding Logic) │ │ (SQLite Library Database) │
│ └────────┬────────────┘ └────────────────────────────┘
│ │
│ ▼
│ ┌────────────────────┐
│ │ smb_layer.py │
│ │ (SMB Access Layer) │
│ └────────────────────┘
│ │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Kodi (Client) │
│ - Discovers server via SSDP │
│ - Browses library via DLNA CDFS │
│ - Streams with forced subtitles │
└─────────────────────────────────────────────────────────┘
Features
Core Capabilities
| Feature | Description |
|---|---|
| DLNA/UPnP Server | Full DLNA ContentDirectory service implementation |
| SMB Client | Reconnect-on-failure wrapper for SMB access |
| Library Management | SQLite database for Movies/TV Shows/Seasons/Episodes tree |
| Automatic Scanning | Walks SMB share, populates DB, periodic rescan with mark-and-sweep |
| Format Detection | ffprobe inspection to determine video/audio codec, resolution, container |
| Hardware Transcoding | Uses h264_mediacodec for hardware-accelerated h264 encoding |
| Forced Subtitles | Extracts forced subtitles to SRT, advertises via DLNA |
| Direct Streaming | Byte-range passthrough for compatible files (no transcoding) |
Playback Decision Logic
The server makes intelligent decisions about when to transcode: