Skip to content

[Bug]: Linux preview 'aucune frame reçue' when seeking at/past the last frame of a recording #550

Description

@Beetix

Describe the bug

On Linux, the editor preview goes blank with "preview unavailable on this machine — decode_at(frame_idx=…) : aucune frame reçue" when playback or scrubbing needs a frame at or past the last frame of a recording.

The cause is decoder-side, in the Linux software decoder's seek path (crates/compositor/src/linux_decode.rs, SwDecoder::decode_at, reached from the preview player via live.rspipeline_linux::Decoder::seek_to). For a target timestamp at/after the last frame, av_seek_frame(…, AVSEEK_FLAG_BACKWARD) succeeds but lands on a single undecodable packet just before EOF; after avcodec_flush_buffers that reference-less packet yields no frame even when drained, so decode_at bails with "aucune frame reçue" instead of returning the last available frame.

It shows up most on frame-dropped recordings whose real avg_frame_rate is below the nominal 60 fps: a frame index computed on the 60 fps grid then points past the file's true frame count. Measured on a real recording: 631 frames / 11.2 s (≈56.34 fps) — sweeping decode_at over indices decodes 0..=630 fine and fails for every index ≥ 631. Those sub-60fps files are themselves produced by the capture-side bug #511.

Expected behavior

Seeking to or past the end of a clip returns the last available frame and the preview never errors — a requested frame index beyond the last frame should clamp to the last frame.

To Reproduce

  1. On Linux, open a project containing a recording whose real average frame rate is below 60 fps (e.g. one produced under load per [Bug]: Linux screen capture time-compresses under frame drops, desyncing webcam/audio/cursor #511 — verify with ffprobe -select_streams v:0 -show_entries stream=avg_frame_rate,nb_frames,duration <file>.mp4).
  2. Play or scrub the timeline through to the last clip backed by that recording.
  3. The preview shows "preview unavailable on this machine — decode_at(frame_idx=…) : aucune frame reçue".

Decoder-level repro (no UI): open the file with SwDecoder and call decode_at(idx) for idx in 0..=nb_frames + 30; every index >= nb_frames fails.

OS

Linux

OS Version

Arch Linux (kernel 7.1.9)

Additional context

  • Editor-side robustness bug. The malformed sub-60fps files that trigger it come from the Linux PipeWire capture frame-drop bug [Bug]: Linux screen capture time-compresses under frame drops, desyncing webcam/audio/cursor #511 — this issue is the decoder failing to tolerate them, and is fixable/mergeable independently.
  • Affected component: crates/compositor/src/linux_decode.rs (SwDecoder::decode_at).
  • Fix approach (in progress): when the backward-seek decode yields no frame, rewind to 0 and forward-scan, returning the last frame ≤ target (the same linear fallback already used for unindexed WebM). The accompanying PR also folds in two related latent decode_at seek-path hardening changes — draining the decoder at EOF (needed for B-frame streams; inert on these H.264-baseline has_b_frames=0 captures) and fixing an AVERROR_INVALIDDATA guard that compared against the wrong constant (-0x2A2A2A2A).
  • App: Openscreen (Electron desktop), Linux/PipeWire capture path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions