https://bugs.kde.org/show_bug.cgi?id=527679

            Bug ID: 527679
           Summary: Second screen recording in the same Spectacle process
                    is written to the previous recording's temp filename,
                    export fails with "Temporary file URL must be an
                    existing local file"
    Classification: Applications
           Product: Spectacle
      Version First 6.7.5
       Reported In:
          Platform: Gentoo Packages
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

SUMMARY
While Spectacle stays running (here as the background `spectacle --dbus`
instance), the first screen recording saves fine, but every later recording in
the same process fails to save.

The encoder writes each new recording into the temp file of the *previous*
recording, while Spectacle then tries to export a file named after the *new*
recording's timestamp. That file never exists, so the export fails. Because the
real video sits in /tmp/Spectacle.XXXXXX under the wrong name and that
directory is deleted when Spectacle exits, the recording is lost unless it is
rescued by hand.

STEPS TO REPRODUCE
1. Start Spectacle and make a screen recording (WebM / VP9 in my case). Stop
it.
2. Without quitting Spectacle, start a second recording and stop it.
3. Optionally repeat with a third recording.

OBSERVED RESULT
The first recording is saved. The second and third fail with:

  Failed to export video: Temporary file URL must be an existing local file

Timeline from one session (PID 2174216, temp dir /tmp/Spectacle.Kwcvrx):

  Started   Encoder wrote to                    Spectacle exported          
Result
  17:49:02  Screencast_20261023_174902.webm     ..._174902.webm             
saved OK
  17:57:44  Screencast_20261023_174902.webm *   ..._175744.webm             
export failed
  18:01:59  Screencast_20261023_175744.webm     ..._180159.webm             
export failed

  * overwrote the first recording's temp file

Temp dir contents after the failures (file mtimes and ffprobe durations match
the 2nd and 3rd recordings exactly):

  Screencast_20261023_174902.webm  26.5 MB  mtime 18:01  duration 204.3 s  (=
2nd recording, 17:57:44 + 204 s)
  Screencast_20261023_175744.webm   272 KB  mtime 18:02  duration   4.7 s  (=
3rd recording)

So the output path handed to the recorder seems to lag one recording behind the
filename Spectacle later expects.

Relevant journal lines:

  17:49:42 kf.kio.workers.file: copy()
QUrl("file:///tmp/Spectacle.Kwcvrx/Screencast_20261023_174902.webm") to
QUrl("file:///home/jargo/Videos/Screencasts/Screencast_20261023_174902.webm")
mode= -1
  17:57:34 QQmlComponent: Cannot create a component in an invalid context  
(x2, just before the 2nd recording; may be unrelated)
  18:01:08 Failed to export video: Temporary file URL must be an existing local
file
  18:01:58 qt.multimedia.ffmpeg.mediadataholder: Could not open media. FFmpeg
error description: No such file or directory
  18:02:04 Failed to export video: Temporary file URL must be an existing local
file

EXPECTED RESULT
Each recording is written to its own temp file and saved under its own name, no
matter how many recordings are made in the same Spectacle process.

WORKAROUND
Quit Spectacle completely between recordings (e.g. `pkill spectacle`). The
first recording in a fresh process always saved correctly. Files stranded by
the bug can be copied out of /tmp/Spectacle.XXXXXX before Spectacle exits.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Linux, kernel 6.18.57-gentoo-dist-bin
KDE Plasma Version: 6.7.5 (Wayland session, KWin 6.7.5)
KDE Frameworks Version: 6.29.0
Qt Version: 6.11.2
Spectacle: 6.7.5, KPipeWire: 6.7.5
FFmpeg 8.1.3, libvpx 1.16.0, PipeWire 1.6.8

ADDITIONAL INFORMATION
Hardware: Lenovo ThinkPad T14s, Intel TigerLake-LP GT2 (Iris Xe), Mesa 26.1.8,
intel-media-driver 26.2.4.
Single eDP display, 2.1x scaling. Recording format: WebM (VP9), encoded with
libvpx-vp9 (VAAPI VP9 encode is not available on this GPU).
Seen in one session so far; it was not a crash, the process kept running.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to