Skip to main content

Python utility that automatically downloads and installs FFmpeg binaries locally for your project

Project description

🎬 Local-FFmpeg

Python 3.6+ Platform: Windows | Linux | macOS 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
  • 📥 Downloads appropriate FFmpeg binaries from official sources
  • 🛠️ 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:

  1. 🔍 Detects your operating system and architecture
  2. 📥 Downloads the appropriate FFmpeg build:
    • Windows/Linux: BtbN's GitHub repository (version latest)
    • macOS (Intel & Apple Silicon): osxexperts.net builds (version 7.1)
  3. 📦 Extracts the files to a temporary directory
  4. 📋 Copies the executables to a local directory
  5. 🔒 Makes the executables executable (chmod)
  6. 🧹 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

📝 Changelog

v0.9.0 (2025-03-07)

  • Initial release
  • Support for Windows 64-bit, Linux (x86_64/amd64, aarch64/arm64, armv7)
  • Automatic detection of system architecture

v0.9.1 (2025-03-08)

  • Support for macOS x86_64 (Intel) / arm64 (Apple Silicon M1/M2) via osxexperts.net builds

🗺️ 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 ffmpeg as 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

local_ffmpeg-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

local_ffmpeg-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: local_ffmpeg-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for local_ffmpeg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 71a18b2ba662d40db9e604f3d1b9f44d1aa21c57fc61fd7d0a182d5f5a67601a
MD5 fabbf576323dc4d801a5aa9fc030711a
BLAKE2b-256 9a2dc9d70d0d4fb681ec71cbeff83dbaa43272616a9825d7a64d741367702f03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for local_ffmpeg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8e75e92aca0a7b8aa123b3f98ca4ebd78a5483b13fce15403e86d1c9061ed5b
MD5 3be909960405bb9eef9ccabceb90a88b
BLAKE2b-256 3a0b437d2a453a53cfd1f3919af2e1322d08161f82bb498be3c2102c770b1be7

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