Bug 482705 - MP4/H.264 recordings are garbled unless "AMD_DEBUG=noefc" environment variable is set
Summary: MP4/H.264 recordings are garbled unless "AMD_DEBUG=noefc" environment variabl...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 24.02.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-07 12:31 UTC by Antti Savolainen
Modified: 2025-03-07 20:30 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Savolainen 2024-03-07 12:31:32 UTC
SUMMARY
The MP4/H.264 option in spectacle doesn't work properly. I've attached a example video.


STEPS TO REPRODUCE
1. Set Spectacle to record in MP4/H.264
2. Record

OBSERVED RESULT
Video comes out as garbled

EXPECTED RESULT
Video should be normal

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Comment 1 Antti Savolainen 2024-03-07 12:34:53 UTC
Sorry, file upload failed due to being too large. Here's a youtube link: https://www.youtube.com/watch?v=hdNqrMj1lF8
Comment 2 Antti Savolainen 2024-03-07 13:10:09 UTC
Setting AMD_DEBUG=noefc removes the garbling. The video isn't perfect, but at least it's watchable.
Comment 3 Noel 2024-04-10 17:51:12 UTC
Can reproduce this. I;'m using AMD CPU+GPU, might be hardware specific? I can provide more info for debugging if instructed.
Comment 4 illode 2024-05-07 04:29:05 UTC
I have the same issue.

Arch Linux with these versions:
lib32-libva-mesa-driver 1:24.0.6-2
lib32-mesa 1:24.0.6-2
lib32-vulkan-radeon 1:24.0.6-2
libva-mesa-driver 1:24.0.6-2
mesa 1:24.0.6-2
mesa-utils 9.0.0-4
vulkan-radeon 1:24.0.6-2

CPU: Ryzen 7950X3D
GPU: Radeon 6900XT

Logs say it's using the GPU to record. Last I checked (>1 year), I'm able to record H.264 / H.265 without issue using either the iGPU or dGPU via OBS. I know for sure H.264 / H.265 on the iGPU work currently with OBS, since it's what I use for normal recording. Recording using vp9 also works fine. The only difference in the logs are these lines:

[h264_vaapi @ 0x7dd9c80b3680] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).

which it says once when the recording starts, and

EE ../mesa-24.0.6/src/gallium/drivers/radeonsi/radeon_vcn_enc_1_2.c:1224 radeon_enc_encode_params UVD - DCC surfaces not supported.

which it spams until the recording stops.
Comment 5 Eli 2024-11-14 10:17:12 UTC
Similar issue happening on Intel, but rather than producing a completely garbled video Spectacle instead creates a weird artifact right at the bottom. 

Screencast example: https://youtu.be/SbxUWhWl9Ek

GPU: Intel HD Graphics 5500
Distribution: Arch Linux
Package versions:
spectacle 24.08.3-1
kwin 6.2.3-1
libva 2.22.0-1
libva-intel-driver 2.4.1-3
libva-mesa-driver 1:24.2.6-1
libva-utils 2.22.0-1
mesa 1:24.2.6-1
mesa-utils 9.0.0-5
Comment 6 Nate Graham 2025-03-07 15:05:57 UTC
https://docs.mesa3d.org/envvars.html says this environment variable "Disable[s] hardware based encoder color format conversion".

Xaver, could this be a driver bug?

Antti, what GPU are you using? Also is it still reproducible today with the version of Spectacle shipped in Plasma 6.3?

Eli, that's probably a different issue; please open a new bug report for it. Thanks?
Comment 7 Zamundaaa 2025-03-07 15:40:42 UTC
This was worked around in kpipewire for Plasma 6.1, not sure how it would still happen in 6.2+: https://invent.kde.org/plasma/kpipewire/-/merge_requests/135
Comment 8 Antti Savolainen 2025-03-07 20:26:28 UTC
AMD Radeon RX 5700.
This seems to be fixed when I tried this on spectacle 6.3.2. Setting file format to MP4/H.264 produces normal videos.
Comment 9 Nate Graham 2025-03-07 20:30:30 UTC
The original report was from 6.0.1, so it seems like it's fixed.