A freshly imported video or image shows 0:00.0 on its Media card until it is placed on the timeline

Aperta Adatta ai principianti
#1,663 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
electron, react, typescript
Ambito
frontend

Direzione di ricerca

Inizia da src/components/ai-edition/v4/MediaStage.tsx intorno alla riga 220 per vedere il rendering della durata sulla card, poi leggi il commento in src/lib/ai-edition/store/useTimeline.ts righe 1528-1533 che spiega perché gli import non portano durationSec. Segui l'azione di import nello store e il percorso esistente probeAndCorrectClip usato al posizionamento sulla timeline, e chiama la stessa probe una volta all'import con history: false, saltandola per le immagini il cui video statico ha già una lunghezza nota. Fatto significa che importare un video o un PNG mostra la lunghezza corretta sulla card prima di qualsiasi posizionamento sulla timeline.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

A video or image imported from the Media tab shows 0:00.0 on its card. The card only shows the real length once the asset has been placed on the timeline.

Steps

  1. Open a project, go to Media, then Import media.
  2. Pick a video (a 15 s H.264 MP4 here) or a PNG.
  3. The new card reads clipB.mp4 · 0:00.0 · 11 MB (or still.png · 0:00.0), and stays that way.
  4. Click the card, then Add to timeline. The clip has the right length, and only now does the card read 0:15.0 (0:05.0 for the image).

Expected: the card shows the asset's length as soon as the import finishes, as a recording's card does.

Seen on 2.4.0-rc.1, macOS 27.0.1 (Mac mini M1) and Ubuntu 24.04 GNOME Wayland. The cause below does not depend on the platform.

Why

The card renders formatSeconds(asset.durationSec ?? 0) (MediaStage.tsx#L220), and the import never sets durationSec, as the comment at useTimeline.ts#L1528-L1533 says. Only placing a clip starts the background probe (probeAndCorrectClip), which writes the duration back to the asset.

Fix direction

Probe the duration once at import, with the same probe and history: false. The card and the first placement then both have it. An image's still video is generated at import with a known length, so it needs no probe.

Lingua principale
TypeScript
Stelle
3.7k
Fork
231
Merge medio
1g 8h
PR unite (30g)
150

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getopenscreen/openscreen

Tutte le issue di getopenscreen/openscreen

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.