8000 GitHub - abhidya/nano-dlna: A minimal UPnP/DLNA media streamer
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

abhidya/nano-dlna

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nano-dlna

Build Status PyPI License

A minimal UPnP/DLNA media streamer with web dashboard for managing and streaming videos to DLNA devices.

Overview

nano-dlna lets you play local media files on your DLNA-compatible devices (TVs, projectors, etc.) with both CLI and web-based interfaces. It's designed to be simple, reliable, and flexible.

🦀 Note: Also check out crab-dlna, a Rust implementation of nano-dlna.

Features

  • Device Management:

    • Auto-discover DLNA devices on your network
    • Manual configuration of devices
    • View device status and connection info
  • Video Management:

    • Stream videos to any DLNA device
    • Upload and manage video files
    • Scan directories for videos
  • Playback Control:

    • Play, pause, stop video playback
    • Seek to specific positions
    • Loop videos automatically
  • Auto-Play:

    • Automatically play videos on specific devices
    • Device-video mapping via configuration files
    • Continuous monitoring and reconnection
  • Multiple Interfaces:

    • Web dashboard for visual management
    • CLI for command-line operations
    • REST API for integration with other tools

Installation

Method 1: Using pip

pip install nanodlna

Method 2: From source

git clone https://github.com/gabrielmagno/nano-dlna.git
cd nano-dlna
pip install -e .

Usage

Web Dashboard

The web dashboard provides a user-friendly interface for managing devices and videos.

Starting the Dashboard

# Start the dashboard
./run_dashboard.sh

# Stop the dashboard
./stop_dashboard.sh

This will start both the backend API and the frontend web interface:

Dashboard Features

  1. Devices Page: View and manage discovered DLNA devices
  2. Videos Page: Upload, sc 8000 an, and manage your video library
  3. Play Page: Select a device and video to play
  4. Device Configuration: Set up automatic video assignments

Command Line Interface

The CLI allows you to manage devices and videos directly from the terminal.

Basic Commands

# List available DLNA devices
nanodlna list

# Play a video on a device
nanodlna play video.mp4 -q "TV"

# Play with device URL (faster, no scan)
nanodlna play video.mp4 -d "http://192.168.1.13:1082/"

# Seek to a specific position
nanodlna seek -q "TV" "00:17:25"

Using Scripts

Several helper scripts are available:

# Run the auto-play functionality
./run_nanodlna.sh

# Cast to a specific transcreen projector
./cast_to_transcreen.sh

# Run both the nanodlna app and web interface
./run_all.sh

Configuration

Device-Video Mapping

The primary configuration file is my_device_config.json, which maps devices to videos:

[
    {
        "device_name": "LivingRoomTV",
        "type": "dlna",
        "hostname": "192.168.1.100",
        "video_file": "/path/to/video.mp4"
    },
    {
        "device_name": "BedroomTV",
        "type": "dlna",
        "hostname": "192.168.1.101",
        "video_file": "/path/to/another_video.mp4"
    }
]

Auto-Play Configuration

You can configure auto-play behavior in several ways:

  1. Manual Assignment via the web interface
  2. Configuration Files with device-video mappings
  3. Scheduled Playback using the web dashboard

Utility Scripts

Several utility scripts are available to help manage the system:

clean_videos.py

python clean_videos.py

Cleans up the database by removing non-existent videos and handling duplicates.

add_config_videos.py

python add_config_videos.py

Adds videos from the configuration files to the database.

scan_videos.py

python scan_videos.py --directory "/path/to/videos" --recursive

Scans a directory for videos and adds them to the database.

fix_device.py

python fix_device.py --device "DeviceName"

Attempts to fix issues with a specific device.

Troubleshooting

Common Issues

  1. Devices not discovered

    • Ensure devices are on the same network
    • Check firewall settings
    • Try increasing discovery timeout: nanodlna -t 20 list
  2. Videos won't play

    • Check that file paths in configuration are correct
    • Verify video format is compatible (H.264 MP4 is most reliable)
    • Check network connectivity
  3. Web Dashboard Issues

    • Clear browser cache
    • Restart the dashboard
    • Check backend logs for errors

Advanced Troubleshooting

For more serious issues:

  1. Enable verbose logging:

    export NANODLNA_DEBUG=1
  2. Check the log files:

    cat nanodlna.log
  3. Clean the database:

    python clean_videos.py

Technical Details

nano-dlna functions as both a DLNA MediaServer (to serve your media files) and a MediaController (to send commands to your devices).

The auto-play system works by:

  1. Loading device configurations from JSON files
  2. Discovering devices on the network
  3. Matching discovered devices with configurations
  4. Starting media servers for video streaming
  5. Sending play commands to matched devices
  6. Continuously monitoring playback and reconnecting as needed

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

A minimal UPnP/DLNA media streamer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 55.0%
  • Python 36.2%
  • JavaScript 6.3%
  • Shell 2.2%
  • HTML 0.1%
  • AppleScript 0.1%
  • Other 0.1%
0