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/atsuiyo/local-ffmpeg
cd local-ffmpeg
pip install -e .

💻 Usage

🐍 Python API

from local_ffmpeg import is_installed, install

# Check if FFmpeg is already installed
if not is_installed(path="./custom/path"):
    # Install FFmpeg if not found
    success, message = install(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 is_installed

🔎 Check if FFmpeg is installed at a custom path

python -m local_ffmpeg is_installed --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.4.tar.gz (31.5 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.4-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for local_ffmpeg-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0404f748142475389aebbc5054b0cfa65ef147edb9b7ff1f2910f1afc4a92cb7
MD5 bb1506a41abb11a2f9983c2693146a49
BLAKE2b-256 69d777e0e1c14fc1d5249b213ca8985debc5f322f861195e46d6fc406d9b814d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for local_ffmpeg-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c18a0f90a4419a79d08910816e1b851605169818e99792f4f5ece7a99ac8957f
MD5 1952e3a11ea59f05bb70d46dd6750a70
BLAKE2b-256 8ee2e4098322284dafdf882134f46aed238b158dad5ce2502827bece014ff498

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