Add a maximum output FPS limit feature#257
Merged
Merged
Conversation
Contributor
chyanbo
commented
May 21, 2026
- Fixed the frame loss issue at the end of videos in previous versions.
- Fixed the issue where the playback FPS setting affected recording.
- Added a maximum output FPS limit feature. When enabled, videos with FPS higher than the set value will be processed and output using the specified FPS.
- Other small bug fixes.
2. Fixed the issue where the playback FPS setting affected recording. 3. Added a maximum output FPS limit feature. When enabled, videos with FPS higher than the set value will be processed and output using the specified FPS. 4. Other small bug fixes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the video processing/recording pipeline to (a) decouple playback FPS overrides from recording output FPS, (b) address end-of-video frame-loss behavior, and (c) add a new “maximum output FPS” cap for recording via an FFmpeg-driven input path.
Changes:
- Adds new recording settings to enable/disable an output FPS cap and configure the maximum FPS.
- Updates UI time/slider behavior to stay in source-frame space while recording with FPS-cap enabled.
- Extends audio segment extraction and recording finalization logic to better align audio timings when frame sampling/FPS-capping is involved.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| app/ui/widgets/settings_layout_data.py | Adds UI settings for enabling and configuring the maximum output FPS cap; clarifies playback-FPS help text. |
| app/ui/widgets/actions/video_control_actions.py | Adjusts timeline time calculation to use source FPS when FPS-cap recording is active. |
| app/processors/video_utils/video_encoding.py | Extends extract_audio_segments to support frame-origin/time offsets for correct segment timing. |
| app/processors/video_processor.py | Implements FFmpeg FPS-cap input path, tail-drain logic for recording finalization, and source/output frame mapping utilities. |
Comments suppressed due to low confidence (1)
app/processors/video_processor.py:4261
- This comment contains garbled characters ("output frame �?source frame"), likely due to an encoding issue. Please replace with a plain ASCII/Unicode arrow (e.g., "output frame -> source frame") so the source file remains clean and readable.
# If FPS-cap recording was active, map output frame �?source frame before seek.
Comment on lines
4258
to
4268
| reset_frame = max(start_frame, last_processed) | ||
| reset_frame = min(reset_frame, self.max_frame_number) | ||
| # Slider stays in source frame space (approach 2). | ||
| # If FPS-cap recording was active, map output frame �?source frame before seek. | ||
| src_slider_max = self.main_window.videoSeekSlider.maximum() | ||
| if self._used_ffmpeg_cap and self.fps > 0 and self.recording_source_fps > 0: | ||
| reset_frame = min( | ||
| self.output_to_source_frame(reset_frame), | ||
| src_slider_max, | ||
| ) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.