A lightweight local web interface for downloading and compressing media using yt-dlp and FFmpeg.
The project runs locally through PHP and provides a browser UI for:
- Downloading videos or audio from supported sources
- Batch downloading from a text file
- Selecting resolution for video downloads
- Compressing videos with automatic encoder detection
All processing happens locally on the machine running the server.
- PHP 8+
- FFmpeg
- FFprobe
- yt-dlp
- Modern web browser
git clone https://github.com/yourname/tpg-media-tools.git
cd tpg-media-toolsThe application expects FFmpeg, FFprobe, and yt-dlp to be available.
Place these binaries inside the bin directory included in the repository.
Example structure:
project/
│
├─ bin/
│ ├─ ffmpeg
│ ├─ ffprobe
│ └─ yt-dlp
│
├─ downloader.html
├─ vidcom.html
├─ download.php
└─ compress.php
Add the bin directory to your system environment PATH.
- Open System Properties
- Go to Advanced → Environment Variables
- Edit Path
- Add:
C:\path\to\project\bin
Add this to .bashrc, .zshrc, or your shell profile:
export PATH="$PATH:/path/to/project/bin"Reload the shell or restart the system.
From the project directory run:
php -S localhost:8000Open the application in your browser:
http://localhost:8000
Uses yt-dlp to download media from supported sources.
Features:
- Video download with selectable resolution
- Audio extraction to MP3
- Batch downloads from
.txtor.csv - Custom save location
- Live console output in the browser
The frontend sends requests to download.php, which executes yt-dlp and streams its output back to the browser.
Uses FFmpeg to compress uploaded videos.
Features:
- Automatic hardware encoder detection
- NVIDIA NVENC
- AMD AMF
- Intel QuickSync
- CPU fallback (x265)
- HDR detection with safe 10-bit encoding
- Smart bitrate targeting
- CRF mode for low bitrate or short videos
- Automatic container conversion if the input is not MP4
Compression is handled by compress.php, which:
- Analyzes the input video using ffprobe
- Detects HDR and bitrate characteristics
- Selects the most appropriate encoder
- Runs FFmpeg with optimized settings
- Returns the compressed file information to the UI
Downloaded videos:
~/Videos/Download
Compressed videos:
~/Videos/Compress
The application automatically creates these directories if they do not exist.
- This project is intended for local use
- No authentication or security hardening is implemented
- Do not expose the PHP server directly to the internet
GPL v3 License