Skip to content

Releases: superyngo/ffmpeg_toolkit

Release v0.5.0

Choose a tag to compare

@superyngo superyngo released this 09 Mar 04:06

What's Changed

Added

  • Added hardware acceleration fallback for _ffmpeg() and _ffprobe(): when a command fails with -hwaccel set, automatically retries without hardware acceleration for improved compatibility on systems where hwaccel is unavailable or misconfigured

Fixed

  • Fixed critical motion detection semantics bug in segment set operations (_extract_motion_segments() now returns boundaries with consistent semantics aligned with _extract_non_silence_info())
  • Fixed cut_motionless logic

Other

  • Restored documentation files
  • Added workflow_dispatch trigger to publish workflow

Release v0.3.0

Choose a tag to compare

@superyngo superyngo released this 17 Jan 02:54

Added

  • Segment set operations feature for combining silence and motion detection
    • New utility functions for segment set operations:
      • _union_segments() - Union of two segment sets (A OR B)
      • _intersect_segments() - Intersection of two segment sets (A AND B)
      • _difference_segments() - Difference of two segment sets (A - B)
      • _xor_segments() - Symmetric difference (XOR) of two segment sets
      • _complement_segments() - Complement of a segment set
    • New SegmentOperation enum with operations: UNION, INTERSECTION, SOUND_ONLY, MOTION_ONLY, XOR, COMPLEMENT
    • New CutByDetection task class for combined silence and motion detection with set operations
    • New PARTIAL_TASKS.cut_by_detection() factory method
    • Export SegmentOperation from package __init__.py
  • Updated documentation:
    • ARCHITECTURE.md - Added CutByDetection section and segment set operations algorithms
    • PORTING_GUIDE.md - Added segment set operations implementation guide

Usage Example

from ffmpeg_toolkit import FF_TASKS, SegmentOperation

# Keep segments with sound OR motion (union - keeps most content)
FF_TASKS.CutByDetection(
    input_file="input.mp4",
    operation=SegmentOperation.UNION
).render()

# Keep only segments with sound AND motion (intersection - highlights)
FF_TASKS.CutByDetection(
    input_file="input.mp4",
    operation=SegmentOperation.INTERSECTION
).render()