Skip to content

Preview shows the webcam's first frame when a clip is entered past the webcam's end from another clip #990

Description

@EtienneLescot

Found in the v2.0.0-rc.13 Windows e2e pass (logged in #988).

What happens

When the playhead enters a clip by its end, from another clip, at a time past the webcam file's last frame, the preview shows the screen's last frame correctly but the webcam's first frame instead of its last.

Repro (Windows, rc.13)

  1. Record a take with the camera on. In the take used here: screen video 50.98 s, webcam 51.24 s, audio and clip 51.31 s (audio runs past both videos).
  2. Media → drag the same recording onto the timeline again, so you have two clips of one take.
  3. Scrub into clip 2 (e.g. 1:10), then click the ruler at the very end of clip 1 (≈ 51.2 s, i.e. between the webcam's last frame and the clip end).

Expected: webcam shows its last frame (ground truth from ffmpeg: an empty chair from 18.7 s to the end).
Actual: webcam shows frame 0 (the person sitting there at the start of the take). Reproduced 2/2.

Controls, both correct:

  • Same target reached from inside clip 1 (e.g. 0:40 → end): right webcam frame.
  • From clip 2 to 51.0 s (before the webcam's last frame): right webcam frame.

Cause

At a clip switch, open_and_seek_clip and seek_pair in crates/compositor/src/live.rs seek the screen with seek_to_or_last (227b9b8) but the webcam with seek_to, and on a null frame fall back to wdec.seek_to(0.0):

let mut wf = wdec.seek_to(webcam_seek_time(source_time_sec, webcam_offset_sec))?;
if wf.is_null() {
    wf = wdec.seek_to(0.0)?;
}

present_frame (the same-clip path) already uses seek_to_or_last for the webcam (83fbcec), which is why the in-clip control is right. Still present on main.

Likely fix: seek_to_or_last for the webcam in both places (keeping the 0.0 fallback only for a target before the first frame, if that case exists).

Impact

Low: paused scrub only, in a window of ~70 ms at the end of each clip (the gap between the webcam's last frame and the clip end). Playback is not affected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions