Bug 485733 - Spectacle fails to save recorded video in MP4 format with error "Failed to export video: Temporary file URL must be an existing local file"
Summary: Spectacle fails to save recorded video in MP4 format with error "Failed to ex...
Status: CONFIRMED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 24.02.2
Platform: Neon Linux
: HI major
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
: 488895 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-18 12:45 UTC by bruno
Modified: 2024-09-16 14:10 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Spectacle fails to record a specific non maximized window in mp4 format (472.83 KB, video/mp4)
2024-08-27 10:06 UTC, medin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bruno 2024-04-18 12:45:04 UTC
SUMMARY
Spectacle fails to save recorded video with error "Failed to export video: Temporary file URL must be an existing local file"

STEPS TO REPRODUCE
1. Open Spectacle
2. Go to the Recording tab
3. Press any of the three recording modes to start the recording
4. Stop the recording after a few seconds

OBSERVED RESULT
Recording is discarded, not saved to Videos/Screencasts and the error message "Failed to export video: Temporary file URL must be an existing local file" is displayed in a new error popup.

EXPECTED RESULT
Recording is properly saved to Videos/Screencasts (or whichever path is configured) without any error messages.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE neon 6.0
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Occurs after the crash in #484620 has been fixed.
Comment 1 Ferdinand 2024-04-22 11:19:31 UTC
I have encountered the same bug(s), it might be related to graphics hardware (I use a notebook with AMD APU (Ryzen 5500U)).

And in the console output I see this message:

> *** pw_stream_destroy called from wrong context, check thread and locking: Not in loop
> *** impl_ext_end_proxy called from wrong context, check thread and locking: Not in loop
> 'pthread_equal(impl->thread, thread_id)' failed at ../spa/plugins/support/loop.c:363 loop_leave()
Comment 2 bruno 2024-04-29 19:01:10 UTC
bump
Comment 3 Noah Davis 2024-05-01 15:16:10 UTC
Are you using X11? Spectacle does not currently support recording on X11. I once saw that error when trying to record on X11 (I was testing things).
Comment 4 Noah Davis 2024-05-01 15:16:47 UTC
.
Comment 5 Ferdinand 2024-05-01 16:45:07 UTC
(In reply to Noah Davis from comment #3)
> Are you using X11? Spectacle does not currently support recording on X11. I
> once saw that error when trying to record on X11 (I was testing things).

No, happens when using Wayland. This is a follow up on 484620 after the segfault was fixed.
Comment 6 Noah Davis 2024-05-01 17:52:54 UTC
What are your settings for recording? Where are you saving your recording to? Is your /tmp folder a local folder?
Comment 7 Ferdinand 2024-05-02 14:31:16 UTC
(In reply to Noah Davis from comment #6)
> What are your settings for recording?

All default.
Filename is the default: Screencast_<yyyy><MM><dd>_<hh><mm><ss>
Format the only available one: WebM/VP9

But I also tried using different saving places, no difference.

> Where are you saving your recording to?

Default location: /home/XXX/Videos/Screencasts

> Is your /tmp folder a local folder?

No /tmp is a tmpfs

---

My guess is that kpipewire has a bug on amd gpu, because of this console output:

> kpipewire_record_logging: VAAPI: Display initialized
> kpipewire_record_logging: VAAPI: API version 1 . 21
> kpipewire_record_logging: VAAPI: Mesa Gallium driver 24.0.5 for AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.4, DRM 3.57, 6.8.7-1-default) in use for device "/dev/dri/renderD128"
> *** pw_stream_destroy called from wrong context, check thread and locking: Not in loop
> *** impl_ext_end_proxy called from wrong context, check thread and locking: Not in loop
> 'pthread_equal(impl->thread, thread_id)' failed at ../spa/plugins/support/loop.c:363 loop_leave()
Comment 8 bruno 2024-05-06 14:54:33 UTC
sorry for the late response, all default here too, and amd gpu here too.
Comment 9 Fernando 2024-07-01 20:47:33 UTC
I'm having the same erro on a intel GPU and on a NVIDIA GPU, I guess its unrelated to the manufacturer.


❯ spectacle
kpipewire_vaapi_logging: VAAPI: Intel iHD driver for Intel(R) Gen Graphics - 24.2.3 () in use for device "/dev/dri/renderD128"
*** pw_stream_destroy called from wrong context, check thread and locking: Not in loop
*** impl_ext_end_proxy called from wrong context, check thread and locking: Not in loop
Comment 10 hi 2024-07-02 17:10:05 UTC
Spectacle video recording worked fine on NVIDIA 535 Wayland until I upgraded to 555
Comment 11 Noah Davis 2024-07-03 22:58:12 UTC
Ferdinand, your issue may be separate from the original issue. Do you think you had pipewire 1.2 at the time that you started having this bug? If so, https://bugs.kde.org/show_bug.cgi?id=489434 might be your bug.
Comment 12 Noah Davis 2024-07-03 22:58:20 UTC
The reason I asked if /tmp was a local file is because recording currently only works with local files (i.e., on your storage device), although you should be able to save a recording to a network storage device after recording has finished. One of the ways the message from the original post is sent is when the file is not a local file.
Comment 13 Noah Davis 2024-07-03 23:00:37 UTC
(In reply to bruno from comment #8)
> sorry for the late response, all default here too, and amd gpu here too.

So you are still getting the "Failed to export video: Temporary file URL must be an existing local file" message? If you are getting the following message, you are experiencing bug 489434 instead.

> *** pw_stream_destroy called from wrong context, check thread and locking: Not in loop
> *** impl_ext_end_proxy called from wrong context, check thread and locking: Not in loop
Comment 14 Noah Davis 2024-07-03 23:02:00 UTC
Changing back to REPORTED since I was never able to reproduce the original issue with the original error message.
Comment 15 Ferdinand 2024-07-15 08:34:24 UTC
(In reply to Noah Davis from comment #14)
> Changing back to REPORTED since I was never able to reproduce the original
> issue with the original error message.

For me it was fixed for a couple of weeks now, and in general the reported issue is gone.
(But now after weeks of working versions I updated to latest version and when saving the recoding spectle now freezes for ever, so broken again but a different issue. Will try to collect information and open another ticket).
Comment 16 Michal Kec (MiK) 2024-08-08 14:03:47 UTC
I can confirm this bug occurs with the current versions.

Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.5.0-44-generic (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 580 Series
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B450 AORUS PRO
Spectacle version: 24.02.2

/tmp is tmpfs
Comment 17 medin 2024-08-09 12:20:13 UTC
For me, this problem is remaining persistent for only one specific case that requires:

- mp4 output set as output,  
- "Window" selected as recording mode,
- the selected window is not maximized,

It doesn't happen with all apps, for example Konsole and Firefox are affected.


Pipewire: 1.2.2
Operating System: Manjaro Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.10.3-5-MANJARO (64-bit)
Graphics Platform: Wayland
Comment 18 Noah Davis 2024-08-15 00:14:28 UTC
*** Bug 488895 has been marked as a duplicate of this bug. ***
Comment 19 Noah Davis 2024-08-23 14:10:01 UTC
Unfortunately, I still cannot reproduce the issue. I tried to record an unmaximized Konsole window. I'm on PipeWire 1.2.2, git master Plasma (basically 6.2 alpha) and KDE Frameworks 6.6.0, but there shouldn't be much of a difference between the behavior on our systems. Maybe there's some other setting or condition that I don't know about.
Comment 20 Nate Graham 2024-08-23 14:46:42 UTC
I can reproduce this with 100% reliability like so:

1. Have a 4K screen and scale it to 225% (total number of screens does not matter for this)
2. Have Spectacle and configured to record in MP4/H.264 by default
3. Press Meta+R to start a screen recording
4. Drag a box around the entire screen area and press return to start recording
5. After any length of time (even like one second) click the red dot in the system tray to end recording

This is with an Intel 10th gen HD630 iGPU.
Comment 21 medin 2024-08-27 10:06:09 UTC
Created attachment 172994 [details]
Spectacle fails to record a specific non maximized window in mp4 format

In terminal, when I unmaximize Konsole and start recording it in "Window" mode, I get the following errors:


kpipewire_record_logging: Hardware encoding is not supported on this device.
[libx264 @ 0x7d73141079c0] -qscale is ignored, -crf is recommended.
[libx264 @ 0x7d73141079c0] height not divisible by 2 (680x511)
kpipewire_record_logging: Could not open codec Generic error in an external library
kpipewire_record_logging: libopenh264 codec not found
kpipewire_record_logging: No encoder could be created
Failed to export video: Temporary file URL must be an existing local file


If I maximize Konsole window, and start recording again, the above errors disappear.


Operating System: Manjaro Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.6-10-MANJARO (64-bit)
Graphics Platform: Wayland