GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(video): pin the output frame rate on rendered analyzer clips by basil-k-aji-dev · Pull Request #92 · google/artemis

Conversation

@basil-k-aji-dev

@basil-k-aji-dev basil-k-aji-dev commented Sep 13, 2026

Copy link
Copy Markdown

Closes #52.

Problem

render_timeline_clip() sets fps={fps} inside each input segment's filter chain, but the output stage never gets an explicit rate. ffmpeg therefore encodes the muxed result at its own default of 25fps and duplicates frames to preserve wall-clock duration:

frame=   77 fps=0.0 q=28.0 Lsize=  4KiB time=00:00:03.00 bitrate=10.6kbits/s dup=31 drop=0

A 3.0s window that should hold ~45 frames at the default 15fps holds 77 — about 40% duplicates. Duration stays correct, which is why nothing downstream noticed, but the guarantee in the function's own docstring — "so start_time + frame_offset still names the true recording time" — is broken on every analyzer clip the agent renders, since UnifiedMobileController.render_timeline_clip is on the production path.

Change

One argument on the output stage:

             "-map", "[outv]",
+            "-r", str(fps),
             "-c:v", "libx264",

with a comment recording why it cannot be dropped again.

Verification

This is covered by an existing test that fails on main, and my run reproduces the issue's numbers exactly:

tests/unit/test_unified_controller_video.py::test_analyzer_clip_keeps_timeline_time_across_restart_gap
main FAILED — assert 43 <= len(frames) <= 47 → assert 77 <= 47
this branch passed

Worth noting these exercise real ffmpeg, not a mock — the bundled imageio-ffmpeg binary — so the frame counts above are measured from an actually encoded file via cv2.VideoCapture, not asserted against a command string.

Command Result
uv run pytest -q tests/unit/test_unified_controller_video.py 22 passed (main: 21 passed, 1 failed)
uv run pytest -q (full deterministic suite) 88 failed, 2097 passed — exactly one node resolved vs. main, 0 new failures
uv run ruff check / ruff format --check on the changed file clean

make typecheck could not be run in my environment — the pyright wheel downloads a Node runtime on first use and my sandbox blocks it. artemis/utils/video.py is not in pyright-core.json.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@basil-k-aji-dev
fix(video): pin the output frame rate on rendered analyzer clips
1297617
`render_timeline_clip` sets `fps={fps}` in each input segment's filter chain
but never gives the output stage an explicit rate. ffmpeg then encodes the
muxed result at its own default of 25fps and duplicates frames to preserve
wall-clock duration:

    frame=77 ... dup=31 drop=0

A 3.0s window that should hold ~45 frames at the default 15fps held 77, about
40% of them duplicates. Duration stayed correct, so nothing downstream
noticed, but the frame_index / fps -> recording-time mapping this function
exists to guarantee -- "so `start_time + frame_offset` still names the true
recording time" -- was wrong on every analyzer clip the agent renders.

Pass `-r {fps}` to the output stage.

`tests/unit/test_unified_controller_video.py::test_analyzer_clip_keeps_timeline_time_across_restart_gap`
already covered this and failed on main with `assert 77 <= 47`.

Closes google#52.
@basil-k-aji-dev

basil-k-aji-dev commented Sep 14, 2026

Copy link
Copy Markdown
Author

Closing as a duplicate. #53 by @Abdullah-Builds already covers issue #52 and was opened first — that one should get the review, not this.

My mistake: I didn't check the open PR queue for an existing claim before sending this. Sorry for the noise.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@basil-k-aji-dev basil-k-aji-dev closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Fix analyzer clip framerate

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@basil-k-aji-dev
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.