skillfed

ha-ffmpeg

A library that handling with ffmpeg for home-assistant

ha-ffmpeg v3.2.2 181.3K downloads/30d#10,128 on PyPI21
Permissive license BSD License Active released

What it is and what it does

ha-ffmpeg is a Python library that wraps ffmpeg for use in asyncio-based applications, particularly Home Assistant. It allows you to control ffmpeg processes asynchronously—emulating webcams from arbitrary video sources, analyzing streams for motion or noise, and extracting still images. The library depends only on async-timeout and is designed to integrate with Home Assistant's async architecture.

The package is actively maintained and carries a permissive BSD license. It has been in production use since 2016 and remains stable. The main design consideration is that function calls should be protected with asyncio.shield to ensure proper cancellation handling in async contexts.

Use it for:

  • Integrate video streams into Home Assistant as virtual webcams for automation and monitoring
  • Detect motion or noise in surveillance feeds to trigger home automation routines
  • Extract snapshots from live video streams for display in dashboards or notifications
  • Wrap ffmpeg process management in async code without blocking the event loop
  • Build Home Assistant add-ons that process multiple video sources concurrently

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides an asyncio-based Python interface to control ffmpeg for Home Assistant, enabling webcam emulation, stream analysis, and image capture from video/audio sources.

Yes, if you are building Home Assistant integrations or async applications that need to control ffmpeg. The library is actively maintained, has low install friction, carries a permissive license, and has no known vulnerabilities. The main prerequisite is that ffmpeg itself must be installed on the system, and you should follow the asyncio.shield guidance in the documentation.

Install

ha-ffmpeg on PyPI

pip

pip install ha-ffmpeg

uv

uv add ha-ffmpeg

poetry

poetry add ha-ffmpeg

Installing ha-ffmpeg

Before you install

Low install friction with a single lightweight runtime dependency (async-timeout). Actively maintained with recent commits; last release was 644 days ago and the repository remains active.

License in practice

Licensed under BSD License (permissive), allowing use in most commercial and open-source projects without significant restrictions.

Quickstart

import asyncio
from ha_ffmpeg import FFMpegManager

async def main():
    manager = FFMpegManager()
    # Use asyncio.shield to protect calls
    await asyncio.shield(manager.start_process(...))

asyncio.run(main())

ffmpeg must be installed and available on the system PATH; asyncio.shield should wrap function calls per the documentation.

Verify before relying

  • Whether ffmpeg must be installed separately on the system for this library to function
  • Specific Python version requirements, as classifiers list 3.5–3.7 but requires_python is unspecified
  • Whether asyncio.shield protection is mandatory for all use cases or only certain operations

Package facts

License BSD License (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — async-timeout
Maintenance actively maintained — 644 days since the last release
Last repo commit
First released
Downloads 181,327/month — #10,128 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ha_ffmpeg-3.2.2-py3-none-any.whl

Keywords: ffmpeg, homeassistant, wrapper, api

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Scientific/Engineering :: Atmospheric ScienceTopic :: Software Development :: Libraries :: Python Modules

Tags

ffmpeg asyncio wrapperhome assistant video streammotion detection ffmpegwebcam emulation pythonaudio stream analysisffmpeg home automationvideo capture asyncio
home-assistantasynciomultimedia

More Python Modules packages