Repository navigation
fix(lint): warn when a video's slot outlasts its source - #7696
Open
wonjangcloud9 wants to merge 1 commit into
Open
wonjangcloud9 wants to merge 1 commit into
wonjangcloud9 wants to merge 1 commit into
Conversation
A <video data-start="0" data-duration="9.019"> whose file is 1.9 s long renders 1.9 s of motion and then holds the last frame for 7.1 s. The hold is the documented behavior, but check passed with nothing to say. The existing probe-based rule only fired when data-media-start was at or past the end of the file, and skipped videos with no data-media-start. The same duration probe now also reports video_slot_outlasts_source when the slot is longer than what the source has left to play (from data-media-start, at data-playback-rate). Holds of 0.1 s or less are rounding in data-duration and stay quiet; loop, data-var-src, data-playback-start and rate lanes are skipped as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been 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.
What
hyperframes lint/checknow reportvideo_slot_outlasts_source(warning) when a<video>'sdata-durationis longer than what its file has left to play, so the render holds the last frame for the rest of the slot.Why
A Short had
<video data-start="0" data-duration="9.019">pointing at an mp4 that is only 1.9 s long. The render showed 1.9 s of footage and then a still frame for 7.1 s;checkpassed with no media finding. Holding the final frame is the documented behavior (#2516,docs/reference/lint-rules.mdxvideo_media_start_at_or_past_eof), so this is not a render bug. What was missing is the warning: the existing probe-based rule only fires whendata-media-startis at or past the end of the file, and it skips every video that has nodata-media-startat all, which is the usual way to write a clip that starts at the top of its file.Related work
video_media_start_at_or_past_eof(same ffprobe duration probe, same skip list).How
packages/lint/src/hevcPreviewLint.ts:readFiniteVideoSlotnow also keeps slots with nodata-media-start(it defaults to 0, as the runtime'sreadMediaOffsetSecondsdoes) and recordsdata-durationanddata-playback-rate(readPlaybackRatefrom@hyperframes/parsers/media-duration, the shared reader).resolveNaturalDurationSeconds(source, mediaStart, rate)(the shared "one rule" for media length) gives the timeline seconds the source covers, and a slot longer than that by more than 0.1 s getsvideo_slot_outlasts_source. 0.1 s keeps a rounded-updata-duration(e.g. 5 s on a 4.97 s file) quiet.loop,data-var-src,data-playback-start, and a rate lane indata-automation(the static probe cannot follow a ramp). The skip checks moved intohasUnknownSourcePositionto keepreadFiniteVideoSlotunder fallow's complexity limit.data-media-startis now duration-probed too (one ffprobe per unique file, same concurrency cap). The HEVC "probed once per file" test now counts codec probes only.docs/reference/lint-rules.mdx: newvideo_slot_outlasts_sourceentry.Test plan
Unit (
packages/lint/src/project.test.ts, ffprobe mocked like the existing rule's tests):data-start="0" data-duration="9.019"on a 1.9 s source (message, fix hint, element id, file)data-media-start(4 s slot from 3 s into a 6 s file) anddata-playback-rate(4 s at 2x on a 6 s file); 3 s at 2x on a 6 s file is quietloop, a rate lane, and a start past EOF (which still gets only the old finding)On main (
affa03b6) with the fix stashed: 2 of the 3 new tests fail (× warns when a slot outlasts the source…,× counts data-media-start and data-playback-rate…). With the fix:packages/lint27 files / 1312 tests pass;tsc --noEmit -p packages/lintclean.Real CLI on a repro project (
index.htmlwith one<video id="clip" src="clip.mp4" data-start="0" data-duration="9.019" muted>,clip.mp4= 1.9 stestsrc2):The freeze itself, rendered on main (
-q draft): the frames at 2.5 s and 8.5 s match (PSNR 41 dB, encoder noise only), while 1.0 s vs 2.5 s is 22.6 dB (moving test pattern).Gates: oxlint / oxfmt clean,
fallow audit --base origin/mainno issues, comment ratchet at or under share, lefthook pre-commit (format, fallow, typecheck) passed.