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
  • 📥 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:

  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

🗺️ 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.3.tar.gz (30.7 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.3-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for local_ffmpeg-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0b72aae2dfe77c1e7b26ab463072a1b81f2a0dd1b66a29f696fea5aadbcd2260
MD5 0abe29f951b5c5bc01b89154dc11d31e
BLAKE2b-256 4ee40306aef5eab0003686cc95feb3515b04516cbc10ad6292a72f4991a53f91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for local_ffmpeg-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 94e8168e08bba75855ac635214e7d4b653d73681bddba55f3e6e7873b3fe2e40
MD5 96dcd51c36a9700a4fb607d36521d9d4
BLAKE2b-256 2069c6491362b2d1df307769924559df3af0827ffcfc3855c393afd1abf504ae

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