Python utility that automatically downloads and installs FFmpeg binaries locally for your project
Project description
🎬 Local-FFmpeg
🚀 Overview
local-ffmpeg is a Python utility that automatically downloads and installs FFmpeg, FFplay, and FFprobe binaries for your operating system. It handles platform-specific installations and configurations so you can easily use FFmpeg in your projects.
This library is installed as a local dependency of your project, not as a system-wide installation.
✨ Features
- 🔄 Automatic detection of your operating system and architecture
- 📥 Download FFmpeg binaries optimized for environment
- 🛠️ Installs FFmpeg, FFplay, and FFprobe locally
- ✅ Verifies successful installation
- 🧹 Cleans up unnecessary files after installation
📋 Requirements
- Python 3.6+
- Internet connection (for downloading FFmpeg)
🔧 Installation
# Using pip
pip install local-ffmpeg
# Or clone the repository
git clone https://github.com/yourusername/local-ffmpeg.git
cd local-ffmpeg
pip install -e .
💻 Usage
🐍 Python API
from local_ffmpeg import check_ffmpeg_installed, install_ffmpeg
# Check if FFmpeg is already installed
if not check_ffmpeg_installed(path="./custom/path"):
# Install FFmpeg if not found
success, message = install_ffmpeg(path="./custom/path")
if success:
print(message) # FFmpeg installed successfully
else:
print(f"Error: {message}")
else:
print("FFmpeg is already installed")
🖥️ Command Line Interface
🚀 Install FFmpeg (default path: ./ffmpeg)
python -m local_ffmpeg install
📁 Install FFmpeg to a custom path
python -m local_ffmpeg install --path /custom/path
🔍 Check if FFmpeg is installed (default path: ./ffmpeg)
python -m local_ffmpeg check
🔎 Check if FFmpeg is installed at a custom path
python -m local_ffmpeg check --path /custom/path
ℹ️ Show help information
python -m local_ffmpeg --help
🔍 How It Works
The installer:
- 🔍 Detects your operating system and architecture
- 📥 Downloads the appropriate FFmpeg build:
- Windows/Linux: BtbN's GitHub repository (version latest)
- macOS (Intel & Apple Silicon): osxexperts.net builds (version 7.1)
- 📦 Extracts the files to a temporary directory
- 📋 Copies the executables to a local directory
- 🔒 Makes the executables executable (chmod)
- 🧹 Cleans up temporary files
📦 Supported Platforms
- Windows: 64-bit (win64)
- Linux:
- x86_64/amd64
- aarch64/arm64
- macOS:
- x86_64 (Intel) - via osxexperts.net
- arm64 (Apple Silicon M1/M2) - via osxexperts.net
🗺️ Roadmap
📋 TODO
- Add functionality to install a specified version
✅ Completed
- ✅ 🍏 Add macOS (OS X) support for direct installation without requiring Homebrew
📢 Important Notes
- On macOS:
- Both Intel Macs (x86_64) and Apple Silicon Macs (arm64) use builds from osxexperts.net
- macOS builds are based on FFmpeg version 7.1
- The ffmpeg, ffplay, and ffprobe files provided by osxexperts.net are for educational purposes only.
- If you encounter issues, you can still use
brew install ffmpegas an alternative - The installer uses GPL-licensed FFmpeg builds
- The default installation path is a directory "ffmpeg" in the same location as the script
🔗 Links
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file local_ffmpeg-0.1.1.tar.gz.
File metadata
- Download URL: local_ffmpeg-0.1.1.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1e37033a4b826afbff33597cc3268f3059d7d23178dd03a24b34b33434babf4
|
|
| MD5 |
85fe2464c396c876c5232ccf03cd94a5
|
|
| BLAKE2b-256 |
3fa5ba40908b0d77ab3da82cb64e264897a096d44b298b2e9c352dd2ebd54d9d
|
File details
Details for the file local_ffmpeg-0.1.1-py3-none-any.whl.
File metadata
- Download URL: local_ffmpeg-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
622705fea6e8666577be4ad08824a89218be024446109b15a5c3a0f373ec5b77
|
|
| MD5 |
88c0b956216a819e209943c34393676a
|
|
| BLAKE2b-256 |
d4e9a87cde9d5e4e7a13f85e4452c249098187d5cdf6c721a0996d98bc1a0946
|