ha-ffmpeg
A library that handling with ffmpeg for home-assistant
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-ffmpeguv
uv add ha-ffmpegpoetry
poetry add ha-ffmpegInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ffmpeg-pythonffmpeg-python provides a Python interface to…
permissive · top 5,000 on PyPI
aiohomekitAn asyncio-based HomeKit client library for…
permissive · top 15,000 on PyPI
ffmpegWraps FFmpeg and FFprobe command-line tools to…
permissive · top 15,000 on PyPI
ffmpyffmpy is a Python wrapper around FFmpeg that…
permissive · top 5,000 on PyPI
python-ffmpegProvides a Python binding for FFmpeg with both…
permissive · top 15,000 on PyPI
aioslimprotoAsync Python implementation of the SLIMProto…
permissive · top 15,000 on PyPI
typed-ffmpegA Python wrapper around FFmpeg with full type…
permissive · top 15,000 on PyPI
aiohasupervisorAsynchronous Python client library for…
permissive · top 15,000 on PyPI
motioneye-clientAn async Python client library for querying and…
permissive · top 15,000 on PyPI
infrared-protocolsDecodes and encodes infrared signals for use in…
permissive · top 15,000 on PyPI