Repository navigation
Added an instantaneous bitrate plot to the Inspect tab - #16
Merged
Merged
Conversation
The Inspect tab could only report what a track's bitrate averaged to, which is the one thing a variable-bitrate encode is guaranteed not to be doing at any given moment. Bin the video track's sample sizes by presentation time into roughly one window per second and plot them as a step area chart against the track average, so the card shows where the bits actually went. The sample table already carries every frame's size and timestamp, so nothing has to be decoded. Suppress the plot for a file whose rate really was held constant, where it would only ever draw a flat line. A btrt box declaring the same number as both the track average and its maximum is not sufficient evidence on its own: muxers routinely write the computed average into both fields whatever the encoder was doing, and the bundled mice.mp4 is a CRF encode that does exactly that. The frame sizes have to agree before the plot is withheld, and where declaration and frames disagree the card plots the measurement and explains why the declaration cannot be taken at face value. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E8xqZHozn5aicsdnbBPo4z
|
Tip All tests passed and all changes approved!🟢 UI Tests: encoding-helper-storybook: 7 tests unchanged |
|
Tip All tests passed and all changes approved!🟢 UI Tests: encoding-helper-playwright: 1 change accepted as baseline |
for more information, see https://pre-commit.ci
|
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
The Video Track card's Bitrate field and the new card's Average are the same number measured the same way, so drop the former and carry its explainer across to the latter. A file with too few frames to divide into windows now keeps the average on the new card, with a note in place of the plot, rather than losing the figure entirely. The Report tab still lists the video track's bitrate, having no plot to carry it. Also drop the caption under the plot: the axes, the direct label on the average line, and the per-window tooltips already say what it said. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E8xqZHozn5aicsdnbBPo4z
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.
Adds a Video Bitrate Over Time card to the Inspect tab: the video track's rate plotted one window of playback at a time (roughly one per second, bounded to 12-240 windows so a short clip and a long recording both draw readably) as a step area chart against the track average. It is binned straight from the container's sample table, so no decoding is involved. Hovering a window gives its rate and frame count, and peak / quietest / peak ÷ average sit above the plot.
On "unless the metadata held it constant"
The obvious signal is a
btrtbox declaring the same number as both the track average and its maximum. That signal alone is wrong in practice: the bundledmice.mp4declaresbtrt max = avg = 565109yet actually ranges 327-741 kbps (peak/avg 1.31), because muxers commonly write the computed average into both fields whatever the encoder was doing. Gating on the declaration alone would have hidden the plot for most ffmpeg-produced files, including the sample video.So the declaration gates the decision but has to be corroborated by the frame sizes before the plot is withheld. Where the two disagree, the card plots the measurement and adds a note saying why the declaration cannot be taken at face value.
Testing
btrtextraction, and the full render decision in jsdom for all four cases); 135 pass in allpre-commitandnpm run buildcleanVersion bumped to 0.2.9.
package-lock.json's root version had been left behind at 0.2.7 and is synced here too.🤖 Generated with Claude Code
https://claude.ai/code/session_01E8xqZHozn5aicsdnbBPo4z
Generated by Claude Code