What's Changed (Highlights)
📓 Release Notes can be found here
New Features ✨
- ✨ FFGear API:
- Introduced a brand-new high-performance, multi-threaded video decoding Gear built on top of DeFFcode's
FFdecoderAPI. - Supports real-time FFmpeg subprocess pipelines, low-overhead hardware-accelerated decoding (e.g., CUDA/NVDEC), flexible pixel format conversions, and asynchronous per-frame metadata extraction.
- Includes dedicated parameters:
source_demuxer,frame_format,custom_ffmpeg, andextract_metadata.
- Introduced a brand-new high-performance, multi-threaded video decoding Gear built on top of DeFFcode's
- ⚡️ Unified Backend Selection (
BackendEnum):- Introduced a unified
apiparameter accepting a newBackendenum (Backend.CAMGEAR,Backend.PIGEAR,Backend.FFGEAR) acrossVideoGear,WebGear,WebGear_RTC, andNetGear_Async. - Replaces the legacy
enablePiCameraboolean flag with a clean, explicit enumeration-based backend selection.
- Introduced a unified
- ⚡️ Plugin-Ready Stabilizer Architecture:
- Refactored the monolithic
Stabilizerclass into a plugin-stylestabilizer/sub-package with a shared_StabilizerBase, anASWStabilizerimplementation, and a factoryStabilizer()function. - Added a new
StabilizerModeenum for selecting stabilization backends viaVideoGear'sSTABILIZER_MODEoption, with clean provisions for upcoming real-time backends (e.g., Kalman tracking).
- Refactored the monolithic
- 🚩 WriteGear: Discard
-vcodecviaNone:- Setting
-vcodecor-c:vtoNoneinoutput_paramsnow cleanly omits the video codec parameter, letting FFmpeg auto-select the encoder (useful for GIF output and similar workflows).
- Setting
- 📦️ Poetry Package Management:
- Added an official Poetry installation guide and ecosystem support for Poetry-managed environments.
Updates/Improvements ⚡️
- Packaging Infrastructure Modernization:
- Migrated build and metadata configurations from legacy
setup.py/setup.cfgto modernpyproject.tomlconfiguration standards. - Switched to automatic package discovery via setuptools, excluding tests and docs from distribution builds.
- Migrated build and metadata configurations from legacy
- Toolchain Overhaul (Ruff Migration):
- Completely replaced
flake8andblackwithrufffor unified, high-speed linting and formatting across the entire codebase.
- Completely replaced
- Type Hint Modernization:
- Systematically updated type hints to leverage native Python 3.10+ structures, including PEP 604 union types (
X | Y) and built-in collection generics.
- Systematically updated type hints to leverage native Python 3.10+ structures, including PEP 604 union types (
- PEP 561 Compliance:
- Added a
py.typedmarker file so external type checkers (e.g.,pyright,mypy) properly recognize VidGear as an inline-typed package.
- Added a
- CamGear YouTube Backend Refactor:
- Extracted
YT_backendinto a dedicatedyt_backendmodule for cleaner separation of concerns and improved maintainability.
- Extracted
- Asyncio CLI Updates:
- Replaced boolean string arguments with proper
store_trueflags for-S,-yt,-l, and-ep. - Added
-a/--apiflag for backend selection (camgear/pigear/ffgear) and FFGear-specific arguments (-sd,-ff,-cf). - Marked
--enablePiCameraas a deprecated CLI flag with a runtime warning.
- Replaced boolean string arguments with proper
Breaking Updates/Changes 💥
-
💣 Deprecated
enablePiCamera:- The
enablePiCameraboolean flag has been officially deprecated across all core capture APIs (VideoGear,WebGear,WebGear_RTC,NetGear_Async) in favor of the explicitapi=Backend.PIGEARenumeration syntax. - Using the old flag will emit a
DeprecationWarningat runtime. It will be removed in a future release.
- The
Bug-fixes 🐛
- Stabilizer Memory Leak:
- Fixed a severe memory bottleneck where
self.__transformstracking records grew unbounded over the entire runtime duration (O(total_frames) → O(smoothing_radius)), eliminating an out-of-memory hazard for long-running sessions.
- Fixed a severe memory bottleneck where
- FFGear Metadata Tuple Handling:
- Fixed
read()to correctly enqueue and return(frame, metadata)tuples whenextract_metadatamode is enabled.
- Fixed
- Helper Utilities:
- Fixed
validate_videoto verify file path existence before processing. - Fixed missing demuxer header handling in
get_supported_demuxers. - Corrected
StopIterationhandling in default video codec selection logic. - Fixed
IndexErrorinvalidate_audiobit-depth parsing by replacing barere.findallindexing with guardedre.searchand adding a fallback parser for planar sample formats (fltp,s16p,u8p, etc.). - Fixed
get_supported_demuxersto expand all comma-separated demuxer aliases (e.g."matroska,webm"now yields both entries instead of only the last).
- Fixed
VidGear is free and open source and will always remain so. ❤️
It is something I am doing with my own free time. But so much more needs to be done, and I need your help to do this. For just the price of a cup of coffee 🍵, you can make a difference 🤝
Detailed Changelog: vidgear-0.3.4...vidgear-0.3.5
