Skip to content

render: parametrize output frame rate with --fps (default 24) - #122

Open
eldermoraes wants to merge 1 commit into
browser-use:mainfrom
eldermoraes:fix/parametrize-fps
Open

render: parametrize output frame rate with --fps (default 24)#122
eldermoraes wants to merge 1 commit into
browser-use:mainfrom
eldermoraes:fix/parametrize-fps

Conversation

@eldermoraes

@eldermoraes eldermoraes commented Aug 8, 2026

Copy link
Copy Markdown

Problem

extract_segment() hardcodes -r 24, silently converting every source to 24fps. A 60fps vertical reel comes out at 24 with no warning, and there is no way to opt out — the skill's own guidance of preserving the source FPS cannot be followed.

Change

Adds --fps (default 24, so existing behavior is unchanged) and threads it through extract_all_segments()extract_segment().

How it was found

Editing a real 1080x1920@60 reel: output came back at 24fps with no indication anywhere. Verified with ffprobe before/after:

before: r_frame_rate=24/1   (source was 60/1)
after:  r_frame_rate=60/1   (with --fps 60)

🤖 Generated with Claude Code

https://claude.ai/code/session_01HTd52WxWgWPYeakcJAiAnR


Summary by cubic

Adds a --fps flag to control the output frame rate during segment extraction. Default stays 24, so current behavior is unchanged, and you can now match sources like 60fps.

  • New Features
    • New CLI flag --fps (default 24) for segment outputs.
    • Threads fps through extract_all_segments() and extract_segment(), replacing the hardcoded ffmpeg -r 24.
    • Use --fps 60 to keep 60fps reels at 60fps.

Written for commit cb906eb. Summary will update on new commits.

Review in cubic

extract_segment() hardcodes '-r 24', silently converting every source to
24fps — a 60fps vertical reel comes out at 24 with no warning, and there
is no way to opt out.

Adds --fps (default 24, so existing behavior is unchanged) and threads it
through extract_all_segments() → extract_segment().

Found while editing a real 1080x1920@60 reel that came out at 24fps.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="helpers/render.py">

<violation number="1" location="helpers/render.py:595">
P3: No validation that --fps is a positive integer. Passing 0 or a negative value is threaded straight into ffmpeg's `-r str(fps)`, where it surfaces as a cryptic ffmpeg error (subprocess CalledProcessError) instead of a clear usage message. Consider validating the range at parse time (or in extract_segment) so an invalid fps fails fast with an actionable message.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread helpers/render.py
"--fps",
type=int,
default=24,
help="Output frame rate for segment extraction (default: 24).",

@cubic-dev-ai cubic-dev-ai Bot Aug 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: No validation that --fps is a positive integer. Passing 0 or a negative value is threaded straight into ffmpeg's -r str(fps), where it surfaces as a cryptic ffmpeg error (subprocess CalledProcessError) instead of a clear usage message. Consider validating the range at parse time (or in extract_segment) so an invalid fps fails fast with an actionable message.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At helpers/render.py, line 595:

<comment>No validation that --fps is a positive integer. Passing 0 or a negative value is threaded straight into ffmpeg's `-r str(fps)`, where it surfaces as a cryptic ffmpeg error (subprocess CalledProcessError) instead of a clear usage message. Consider validating the range at parse time (or in extract_segment) so an invalid fps fails fast with an actionable message.</comment>

<file context>
@@ -586,6 +588,12 @@ def main() -> None:
+        "--fps",
+        type=int,
+        default=24,
+        help="Output frame rate for segment extraction (default: 24).",
+    )
     ap.add_argument(
</file context>
Fix with cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant