Speed and trim tools can't open WebM files without a duration, including the speed tool's own output

Offen
#3,862 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@patrickballard arbeitet bereits daran.

Seit 05.11.2026.

  • #3863 von @patrickballard — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
typescript, web-dev
Bereich
frontend

Rechercherichtung

Start by reading the speed tool at cap.so/tools/video-speed-controller and the trim tool at cap.so/tools/trim, focusing on how each handles WebM duration and loading or recording completion. Reproduce with a WebM recorded using MediaRecorder.start(timeslice); done means both tools read its real duration and can process it. Pull request #3863 is already open against this issue.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Description

WebM recorded with MediaRecorder.start(timeslice) has no duration in its header, so a video element reports Infinity until playback reaches the end. Chrome only writes the duration when no timeslice is used. cap.so's speed and trim tools both record with a timeslice (start(1000) and start(100)), so the speed tool's WebM output is one of these files.

  • Speed tool (cap.so/tools/video-speed-controller): shows Duration: 0:00 and Estimated output duration: 0:00. Speed Up then reports "Video sped up successfully!" after about a quarter of a second, and the download is 0 bytes. The safety timeout is video.duration / speed * 1000 + 5000, which is Infinity, and setTimeout treats that as 0, so the recorder stops at once.
  • Trim tool (cap.so/tools/trim): stays on "Loading video..." for good. handleVideoLoaded returns early when the duration is Infinity and never clears the loading state.

So a WebM sped up with the speed tool can't then be trimmed with the trim tool, or sped up again.

Reproduction
  1. Speed up a WebM in cap.so's speed tool and download the result.
  2. Open that file in cap.so/tools/trim: "Loading video..." never goes away.
  3. Open it in cap.so/tools/video-speed-controller: the duration reads 0:00, and speeding it up gives a 0-byte file.

Seen on cap.so on 4 Nov in Chrome 152 with a 4 s VP9/Opus clip recorded in 1 s chunks.

Expected

Both tools read the real duration and work as they do for files that have one.

Vorherrschende Sprache
Rust
Sterne
24.2k
Forks
2.2k
Ø Merge
1 T. 10 Std.
Gemergte PRs (30 T.)
689

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus CapSoftware/Cap

Alle Issues in CapSoftware/Cap

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.