crab-dlna
crab-dlna is a minimal UPnP/DLNA media streamer, available both as a standlone CLI (command line interface) application and a Rust library.
It allows you to play a local video file in your TV (or any other DLNA compatible device).
Features
- Searching available DLNA devices in the local network
- Streaming audio
- Streaming video, with subtitle support
Installation
In the GitHub Releases of this repository we provide archives of precompiled binaries of crab-dlna, available for Linux, Windows, and macOS.
cargo
Installation via cargo is done by installing the crab-dlna crate:
# If required, update Rust on the stable channel
# Alternatively, --locked may be required due to how cargo install works
Usage (CLI)
You can list all the CLI commands by running:
crab-dlna --help
List
Scan compatible devices and list the available ones:
If your device is not being listed, you might need to increase the search timeout:
Play
Play a video, automatically loading the subtitles if available, selecting a random device:
Play a video, specifying the device through query (scan devices before playing):
Play a video, specifying the device through its exact location (no scan, faster):
Usage (library)
Add crab-dlna and tokio to your dependencies:
[]
= { = "1", = ["full"] }
= "0.1"
Example: discover and list devices
crab-dlna provides a function to discover a list devices in the network.
use Render;
async
Example: play a video in a device
We can specify a DLNA device render trough a query string, and then play a certain video in it, automatically detecting the subtitle file.
use PathBuf;
use ;
async
You can access the full documentation to see more details about the library.
License
Copyright (c) 2022 Gabriel Magno.
crab-dlna is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
See the LICENSE-APACHE and LICENSE-MIT files for license details.