Repository navigation
Measure a video's length at upload, and a "Repair length" button for existing recordings - #85
Merged
Merged
Conversation
A browser's MediaRecorder (Gecko Notes' recordings) writes WebM as a live stream: no duration, no seek index, so ffprobe says N/A. probe() returned no duration, and everything downstream handled a 30-minute recording differently (a player showing 0:08, Video Creator giving the clip a tenth of a second). When the container has no duration, or one that implies an impossible bitrate, read the last packet's end from the packets themselves. A believable header is never replaced by a shorter scan, and stills are not scanned. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1geD3sZfGVJcKE4BJMvgo
The upload fix measures new recordings, but the ones already in a library (browser
WebM written as a live stream) keep no duration and no seek index. Repair rewrites
the file with the same streams (-c copy, nothing re-encoded) and swaps it in behind
the same asset id, so tags, clips, playlists and projects carry on.
The new file is written and checked before anything points at it (same tracks, same
length as the original measured from its packets); the row switches in one commit; the
old file is deleted last. A failed, cancelled or mismatched repair leaves the original
exactly as it was. It is held off while a version or a cut is running on the file, and
holds those off while it runs.
POST /api/assets/{id}/remux queues the job; the button shows on the Info tab only while
the asset has no stored length, so it goes away when the repair has worked.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1geD3sZfGVJcKE4BJMvgo
davior
marked this pull request as ready for review
November 27, 2026 06:45
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
A browser's MediaRecorder (Gecko Notes' recordings) writes WebM as a live stream: no duration and no seek index, so ffprobe reports
N/A. A 30-minute, 555 MB recording was stored with no length. The player showed 0:08, and Video Creator rendered the clip as a tenth of a second.1. New uploads are measured (
ingest/probe.py)When the container has no duration, or one that implies an impossible bitrate (over 50 MB/s),
probe()reads the end of the last packet from the packets themselves.2. Existing recordings can be repaired (
enrichment/remux.py)The Info tab shows a Repair length button on a video or sound that has no stored length. It goes away once the repair has worked.
POST /api/assets/{id}/remuxqueues aremuxjob.-c copybehind the same asset id. Nothing is re-encoded, so tags, clips, playlists, transcripts and projects carry on, and every timestamp stays where it was.make-original, and asset delete) while it runs. One repair at a time per asset.Tests
tests/test_remux.py, covering the route, the guards, the job on a real live-written WebM, failure and cancel leaving the file untouched, and the check.tests/test_probe_duration.py.RepairLengthButton.test.tsx.gecko-suiteclient could not be downloaded there (403); I used a local stub to import the app. The same 95 fail without this change. CI runs them with the real client.Pairs with davior/gvc#65, which makes Video Creator handle a clip of unknown length.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V1geD3sZfGVJcKE4BJMvgo