Skip to content

VidGear Stable v0.3.5

Latest

Choose a tag to compare

@abhiTronix abhiTronix released this 17 May 18:57
· 1 commit to master since this release
a13ef8f

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 FFdecoder API.
    • 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, and extract_metadata.
  • ⚡️ Unified Backend Selection (Backend Enum):
    • Introduced a unified api parameter accepting a new Backend enum (Backend.CAMGEAR, Backend.PIGEAR, Backend.FFGEAR) across VideoGear, WebGear, WebGear_RTC, and NetGear_Async.
    • Replaces the legacy enablePiCamera boolean flag with a clean, explicit enumeration-based backend selection.
  • ⚡️ Plugin-Ready Stabilizer Architecture:
    • Refactored the monolithic Stabilizer class into a plugin-style stabilizer/ sub-package with a shared _StabilizerBase, an ASWStabilizer implementation, and a factory Stabilizer() function.
    • Added a new StabilizerMode enum for selecting stabilization backends via VideoGear's STABILIZER_MODE option, with clean provisions for upcoming real-time backends (e.g., Kalman tracking).
  • 🚩 WriteGear: Discard -vcodec via None:
    • Setting -vcodec or -c:v to None in output_params now cleanly omits the video codec parameter, letting FFmpeg auto-select the encoder (useful for GIF output and similar workflows).
  • 📦️ 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.cfg to modern pyproject.toml configuration standards.
    • Switched to automatic package discovery via setuptools, excluding tests and docs from distribution builds.
  • Toolchain Overhaul (Ruff Migration):
    • Completely replaced flake8 and black with ruff for unified, high-speed linting and formatting across the entire codebase.
  • 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.
  • PEP 561 Compliance:
    • Added a py.typed marker file so external type checkers (e.g., pyright, mypy) properly recognize VidGear as an inline-typed package.
  • CamGear YouTube Backend Refactor:
    • Extracted YT_backend into a dedicated yt_backend module for cleaner separation of concerns and improved maintainability.
  • Asyncio CLI Updates:
    • Replaced boolean string arguments with proper store_true flags for -S, -yt, -l, and -ep.
    • Added -a/--api flag for backend selection (camgear/pigear/ffgear) and FFGear-specific arguments (-sd, -ff, -cf).
    • Marked --enablePiCamera as a deprecated CLI flag with a runtime warning.

Breaking Updates/Changes 💥

  • 💣 Deprecated enablePiCamera:

    • The enablePiCamera boolean flag has been officially deprecated across all core capture APIs (VideoGear, WebGear, WebGear_RTC, NetGear_Async) in favor of the explicit api=Backend.PIGEAR enumeration syntax.
    • Using the old flag will emit a DeprecationWarning at runtime. It will be removed in a future release.

Bug-fixes 🐛

  • Stabilizer Memory Leak:
    • Fixed a severe memory bottleneck where self.__transforms tracking records grew unbounded over the entire runtime duration (O(total_frames) → O(smoothing_radius)), eliminating an out-of-memory hazard for long-running sessions.
  • FFGear Metadata Tuple Handling:
    • Fixed read() to correctly enqueue and return (frame, metadata) tuples when extract_metadata mode is enabled.
  • Helper Utilities:
    • Fixed validate_video to verify file path existence before processing.
    • Fixed missing demuxer header handling in get_supported_demuxers.
    • Corrected StopIteration handling in default video codec selection logic.
    • Fixed IndexError in validate_audio bit-depth parsing by replacing bare re.findall indexing with guarded re.search and adding a fallback parser for planar sample formats (fltp, s16p, u8p, etc.).
    • Fixed get_supported_demuxers to expand all comma-separated demuxer aliases (e.g. "matroska,webm" now yields both entries instead of only the last).

Donations and Sponsorships

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 🤝

Support me on Ko-fi


Detailed Changelog: vidgear-0.3.4...vidgear-0.3.5