Open ac615223s5 opened 1 month ago
closes #1973 closes #330
The latest update introduces a new option, "True keyframe cut," for aligning segment times in the video editing dialog. This mode replaces the former default setting "before" with "consistent." Supporting changes were made across different modules, including updating function parameters, handling logic, and error management to integrate this new mode seamlessly.
File Path | Change Summary |
---|---|
src/renderer/src/dialogs/index.tsx |
Added the "True keyframe cut" option in the segment alignment dialog and changed the default option. |
src/renderer/src/ffmpeg.ts |
Introduced a new type consistent in the FindKeyframeMode enum and added case handling for consistent . |
src/renderer/src/hooks/useSegments.ts |
Imported getStreamFps and getDuration functions; modified keyframe alignment logic and segment time adjustments. |
sequenceDiagram
participant UI as User Interface
participant Dialog as Align Segments Dialog
participant Hook as useSegments Hook
participant FFMPEG as FFMPEG Module
UI->>Dialog: Choose 'True keyframe cut'
Dialog->>Hook: Trigger segment alignment
Hook->>FFMPEG: getStreamFps(videoStream)
FFMPEG->>Hook: Return fps
Hook->>FFMPEG: getDuration(filePath)
FFMPEG->>Hook: Return duration
Hook->>FFMPEG: findKeyframe(mode: 'consistent')
FFMPEG->>Hook: Return keyframe time
Hook->>Dialog: Update segment times
Dialog->>UI: Display updated segments
In the land of frames, algorithms dance, "True keyframe cut" now takes its stance. Alignments precise, consistency reigns, Scenes flow smoothly, avoiding pains. 🎬 Where segments once stumbled, clear paths unfold, A tale of code, precise and bold. 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
aligns the segments to make keyframe cut more consistent
the segment start will be moved to less than one frame before the first keyframe strictly after the start point, ensuring that the cut will be at the last keyframe at or before the start point.
the endpoint can optionally be aligned to a fraction of a frame before the first keyframe at or after the endpoint. this is useful for splitting a video into segments without repeating or missing any frames.