Repository navigation
fix(export): give VideoToolbox exports a two-second keyframe interval - #2502
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ncoding is forced
Member
Author
|
hey @greptileai, please re-review the PR |
This branch was successfully deployed
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.
On macOS, every MP4 export inserts a keyframe every 12 frames. The
h264_videotoolboxexport branch ofget_codec_and_options(crates/enc-ffmpeg/src/video/h264.rs) never setsg, so FFmpeg's default GOP of 12 applies. Every other encoder branch setsgtoDEFAULT_KEYFRAME_INTERVAL_SECS(2 s), and the export size estimate assumes that 2 s GOP too.flowchart LR subgraph Before["Before: GOP 12 (5 I-frames/s at 60 fps)"] direction LR I1[I] --> P1[P x11] --> I2[I] --> P2[P x11] --> I3[I] --> P3[...] end subgraph After["After: GOP 120 (one I-frame per 2 s)"] direction LR J1[I] --> Q1[P x119] --> J2[I] --> Q2[...] endrealtime) options are unchanged, so fragmented recording and Instant segment cuts are not affected.videotoolbox_export_uses_the_default_keyframe_intervalchecks that the export options carryg = 120at 60 fps and that the realtime options still don't setg.Size and quality
M4 Max,
cap export --fps 60. Two fixtures recorded with thecapCLI frommain:studio-cam: 60 s Studio recording, 3024x1964 display with a looping screen video, 720p camera, mic and system audio.scroll: 30 s Studio recording, 3024x1964 at 60 fps of a page scrolling at 1500 px/s with a video overlay. This is the worst case for long GOPs.Quality is measured against a reference export of the same project at 2-3 bpp.
main→ PRmainmain→ PRmain→ PRstudio-camexport takes 11.95 s instead of 12.59 s, since the encoder writes fewer I-frames.
Confidence Score: 5/5
The PR appears safe to merge; the previous test failure is fixed.Summary
Sets a two-second keyframe interval for VideoToolbox exports. Recording options stay unchanged.
Reviews (2) · Last reviewed commit: "test(enc-ffmpeg): skip the VideoToolbox ..." · Reviewed by Greptile