by NikitaY.com
A lightweight, high-performance DLNA/UPnP media server written in C++ with FFmpeg integration for macOS. Stream your video collection to any DLNA-compatible device on your local network.
- 🚀 High Performance: Written in C++ with optimized FFmpeg integration
- 📹 Rich Metadata: Automatic extraction of video duration, resolution, codec, and bitrate
- 🎬 Smart Scanning: Scans directories recursively and serves the 100 most recently modified videos
- 📡 DLNA/UPnP: Full SSDP discovery and ContentDirectory service implementation
- ⚡ HTTP Range Support: Efficient video streaming with seek support
- 🔄 Smart Transcoding: Optional on-the-fly H.264 transcoding for old TV compatibility (7+ years)
- 🎯 Simple CLI: Easy-to-use command-line interface with flexible options
- MP4 (
.mp4,.m4v) - MKV (
.mkv) - AVI (
.avi) - MOV (
.mov) - WMV (
.wmv) - FLV (
.flv) - WebM (
.webm) - MPEG (
.mpg,.mpeg)
- macOS (tested on macOS 10.15+)
- CMake 3.15 or later
- Homebrew (for dependencies)
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install required libraries
brew install cmake ffmpeg libmicrohttpd# Clone or navigate to the project directory
cd SlimDLNA
# Create build directory
mkdir build && cd build
# Configure with CMake
cmake ..
# Build the project
make
# (Optional) Install system-wide
sudo make installThe compiled binary will be located at build/slimdlna.
Run the server with default settings (scans ~/Movies/, transcoding enabled):
./slimdlnaDefault (Transcoding ON) - Maximum compatibility with old TVs (7+ years):
./slimdlna # H.264/AAC transcode for old TVs
./slimdlna -t ~/Videos # Explicit transcode enableDirect Streaming (Transcoding OFF) - Faster, for modern devices:
./slimdlna -nt # No transcoding (direct streaming)
./slimdlna --notranscode ~/Videos./slimdlna --name "My Videos"
./slimdlna -n "MediaCenter" ~/Videos./slimdlna -v # Basic verbose
./slimdlna -vv # Detailed logging
./slimdlna -vvv # Full debug output./slimdlna -vv -n "HomeMovies" -nt ~/VideosDisplay usage information:
./slimdlna --help- Scanning: The server recursively scans the specified directory for video files
- Metadata Extraction: FFmpeg extracts detailed metadata (duration, resolution, codec, bitrate) from each video
- Selection: Up to 100 most recently modified videos are selected for serving
- SSDP Discovery: The server announces itself on the network via SSDP multicast (239.255.255.250:1900)
- DLNA Serving: Devices can browse the video library and stream content via HTTP on port 8200
- SSDP Port: 1900 (UDP, multicast)
- HTTP Port: 8200 (TCP)
- Protocol: DLNA/UPnP 1.0
Make sure these ports are not blocked by your firewall.
Once the server is running:
- Smart TVs: Look for "SlimDLNA Media Server" in your TV's media server list
- Game Consoles: Check the media player app for available servers
- Mobile Apps: Use any DLNA client app (e.g., BubbleUPnP, VLC)
- Computers: Use VLC, Kodi, or any UPnP/DLNA client
- Verify the directory path exists and contains video files
- Check that video files have supported extensions
- Ensure you have read permissions for the directory
- Ensure both server and devices are on the same network
- Check firewall settings (allow ports 1900 and 8200)
- Some networks block multicast traffic - check router settings
If port 8200 or 1900 is already in use by another application, you'll need to stop that application first.
If you see FFmpeg-related errors during scanning:
# Verify FFmpeg installation
ffmpeg -version
# Reinstall if needed
brew reinstall ffmpeg- Scanning Time: 1-5 seconds for 100 files
- Memory Usage: ~20-50 MB
- CPU Usage: Minimal (< 5%)
- Network: Original bitrate (2-20 Mbps)
- Scanning Time: Same (1-5 seconds)
- Memory Usage: ~100-200 MB per active stream
- CPU Usage: 50-100% per stream (real-time encoding)
- Network: 3-8 Mbps (optimized for old TVs)
- Quality: H.264 Main Profile, AAC audio, 1080p max
Recommendation: Use -nt for modern devices (faster, original quality). Use default transcoding for TVs older than ~2018.
- Scanner (
scanner.cpp): Recursive directory scanning with FFmpeg metadata extraction - Media Library (
media.cpp): Video file management and DIDL-Lite XML generation - HTTP Server (
http_server.cpp): libmicrohttpd-based streaming with range request support - SSDP Responder (
ssdp.cpp): UPnP device discovery via multicast - ContentDirectory (
content_directory.cpp): UPnP ContentDirectory:1 service with SOAP interface
This project is provided as-is for educational and personal use.
Contributions are welcome! Areas for improvement:
- Additional codec support
- Subtitle streaming
- Thumbnail generation
- Web-based management interface
- Cross-platform support (Linux, Windows)
Created by NikitaY.com
Built with ❤️ using C++17, FFmpeg, and libmicrohttpd.
- Website: https://nikitay.com
- High-performance media solutions for developers
Note: This server is designed for local network use only. Do not expose it to the public internet without proper security measures.
© 2025 NikitaY.com. All rights reserved.