Repository navigation
Time effects: fetch the exact frame time at 23.976 fps - #4198
portaproductions wants to merge 1 commit into
Conversation
fetch_with rounded each time to a whole microsecond and asked the host for the rounded time. A 23.976 fps frame starts at n x 1001/24000 s, so every third frame rounded to just before its start and the host returned the frame before it. The rounded microsecond now only dedupes; the host gets the exact time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fv75bEHrs4nq3TNfPbBTV1
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Time effects that read other frames (Echo, Posterize Time, Time Difference, Time Displacement, Timewarp, Pixel Motion Blur) get the right frame on 23.976 fps footage.
What the user saw: on 23.976 fps footage, a time effect that reads other frames (Echo, for example) got the previous frame on every third frame, so effects built on it pulsed in a 3-frame rhythm.
The cause:
fetch_withincrates/effects/src/time_fx.rsrounds each requested time to a whole microsecond to dedupe them, then asks the host for that rounded time. A 23.976 fps frame starts at n × 1001/24000 s, which is not a whole microsecond: frame 1 starts at 41 708.333 µs and rounds down to 41 708 µs, just before it starts, so the host returns frame 0. Every third frame (fraction .333) lands that way.What changed: the rounded microsecond is still the dedupe key, but the host now gets the exact time. Only
fetch_withchanges; every time effect fetches through it.The test:
time_fx::tests::echo_fetches_the_right_frame_at_23_976_fpsruns Echo one frame back at 23.976 fps on a host that holds each footage frame from its exact start, and checks that the echo is frame 1, not frame 0. It fails with the fix reverted.Verification (Apple Silicon Mac):
cargo test -p effectcraft-effects --lib time_fx::(12 passed); the new test fails with the fix reverted;cargo fmt -p effectcraft-effects --checkandcargo clippy -p effectcraft-effects --all-targets -- -D warningsclean. Not run:cargo xtask ci --affected, and no Linux or Windows run; CI will cover those.🤖 Generated with Claude Code
https://claude.ai/code/session_01Fv75bEHrs4nq3TNfPbBTV1
Summary by CodeRabbit