Skip to main content

A simple media server for streaming video files

Project description

py-media-server

A simple, lightweight media server for streaming video files over HTTP with a modern web interface.

Features

  • 🎬 Stream video files (MP4, MKV, AVI, MOV) from any directory
  • 🖼️ Automatic thumbnail generation using FFmpeg
  • 📱 Responsive web interface that works on mobile and desktop
  • ⚡ Range request support for efficient video streaming
  • 🔒 Threaded TCP server for concurrent connections
  • 🎨 Modern, dark-themed UI

Installation

From PyPI (when published)

pip install py-media-server

From source

git clone https://github.com/pandiyarajk/py-media-server.git
cd py-media-server
pip install -e .

Requirements

  • Python 3.7+
  • FFmpeg (optional, for thumbnail generation)

To install FFmpeg:

  • Windows: Download from ffmpeg.org or use choco install ffmpeg
  • macOS: brew install ffmpeg
  • Linux: sudo apt-get install ffmpeg or sudo yum install ffmpeg

Usage

Basic usage

Serve media files from the current directory:

py-media-server

Or specify a directory:

py-media-server /path/to/your/movies

Custom port

py-media-server /path/to/your/movies --port 9000

Custom host and port

py-media-server ~/Videos --host 192.168.1.100 --port 8080

Help

py-media-server --help

Command-line Options

positional arguments:
  directory             Directory containing media files to serve (default: current directory)

optional arguments:
  -h, --help            show this help message and exit
  -p PORT, --port PORT  Port to run the server on (default: 8000)
  --host HOST           Host to bind the server to (default: 0.0.0.0)
  -v, --version         show program's version number and exit

How it Works

  1. Start the server: Point it to a directory containing video files
  2. Open your browser: Navigate to http://localhost:8000
  3. Browse and play: Click on any video thumbnail to start streaming

The server will:

  • Scan the directory for supported video formats
  • Generate thumbnails automatically (stored in .thumbs subdirectory)
  • Serve videos with range request support for smooth playback
  • Handle concurrent connections efficiently

Development

Setup development environment

git clone https://github.com/pandiyarajk/py-media-server.git
cd py-media-server
pip install -e ".[dev]"

Run tests

pytest

Run tests with coverage

pytest --cov=py_media_server --cov-report=html

Project Structure

py-media-server/
├── py_media_server/
│   ├── __init__.py
│   └── server.py
├── tests/
│   ├── __init__.py
│   └── test_server.py
├── setup.py
├── pyproject.toml
├── README.md
├── LICENSE
└── MANIFEST.in

Security Notice

⚠️ Warning: This server is intended for local network use only. It does not include authentication or encryption. Do not expose it to the public internet without proper security measures.

License

MIT License - see LICENSE file for details

Contributing

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

Changelog

0.1.0 (2026-04-19)

  • Initial release
  • Basic video streaming functionality
  • Thumbnail generation
  • Web interface
  • Command-line interface

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_media_server-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_media_server-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file py_media_server-0.1.0.tar.gz.

File metadata

  • Download URL: py_media_server-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for py_media_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f04bb21b14d5cee7c6f386401507418d12c9af7b20af90d009a865ddbd88e659
MD5 b14aa2fb6d82d1fdc831b31da2bd2cbd
BLAKE2b-256 449b5ad4e6d224fe58540835c665d004dfdc628f57768bc5b340805b784ba3cf

See more details on using hashes here.

File details

Details for the file py_media_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for py_media_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 538c1b54a783c9447a0db75e6cf5fe889f5ea6ae9a18d7dead114c349af53280
MD5 d36879ca119b3e8fcd8ffd9534f1a9de
BLAKE2b-256 2118a1cb31ef9d97bdfdc17d11496662a41ba9918f0306dae4acd63905a525fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page