Bug 474798 - Wayland / Screencast: add ability to record audio along with video
Summary: Wayland / Screencast: add ability to record audio along with video
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: 23.08.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
: 508551 519300 (view as bug list)
Depends on: 490867
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-23 07:29 UTC by Peter Ries
Modified: 2026-07-09 04:18 UTC (History)
23 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.8.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Ries 2023-09-23 07:29:25 UTC
Feature request (if not already on list)

As Plasma / Wayland breaks Simple Screen Recorder and other tools like Wayfarer or Kooha didn't for for whatever reason on my machine and OBS Studio is too bloat for a simple recording of an e. g. Websession SPACTACLE would be sufficient for that case - if it could record an audio device as well.

Would be perfect if thic can be implemented in the future.
Comment 1 Noah Davis 2023-12-13 21:28:59 UTC
I think supporting audio would be nice. We don't currently have a way to do that with the backends we have, AFAIK.
Comment 2 Kaloian Kozlev 2025-05-21 12:06:40 UTC Comment hidden (spam)
Comment 3 Filip 2025-08-21 18:34:15 UTC
*** Bug 508551 has been marked as a duplicate of this bug. ***
Comment 4 gdpr 2025-08-31 04:16:54 UTC Comment hidden (spam)
Comment 5 agile268 2025-11-16 18:33:27 UTC Comment hidden (spam)
Comment 6 cmdr 2026-02-22 20:59:27 UTC Comment hidden (spam)
Comment 7 esqmx 2026-04-05 15:15:16 UTC
is this planned yet or no?
Comment 8 Mr Roke Julian Lockhart Beedell 2026-04-05 17:03:58 UTC
> is this planned yet or no?

It's confirmed, which is as much confirmation as KDE tends to provide, because if nobody actually does the work (they're all volunteers), there's always a chance that it shan't be included any time soon.
Comment 9 Noah Davis 2026-04-28 02:16:35 UTC
*** Bug 519300 has been marked as a duplicate of this bug. ***
Comment 10 Jaypers 2026-05-26 08:18:18 UTC
Just checking the capability needs to be added to KPipeWire right?
Comment 11 Nate Graham 2026-05-26 13:34:13 UTC
Yes.
Comment 12 Khudoberdi Abdujalilov 2026-06-13 07:49:54 UTC
I've implemented this and opened two merge requests, following the direction from the earlier discussion that the capture/encoding/muxing belongs in KPipeWire rather than Spectacle:

- KPipeWire (capture, encoding, muxing, sync): https://invent.kde.org/plasma/kpipewire/-/merge_requests/261
- Spectacle (two checkboxes + settings): https://invent.kde.org/plasma/spectacle/-/merge_requests/549

Summary: system audio (default sink monitor) and/or microphone (default source) are captured as native PipeWire streams, encoded with Opus (WebM) or AAC (MP4), and muxed as a second stream into the same container, sharing a clock with video (no post-processing step, no external processes). Both sources mix into a single track. Formats without audio support (GIF/WebP) ignore the options.

Tested on Plasma 6.6/Wayland with ffprobe-verified recordings (A/V duration deltas under 0.1 s, start offsets under 35 ms, mid-recording default-device switches, device death, stop-tail preservation).

Several behavior questions are explicitly left open in the KPipeWire MR description (single mixed track vs per-source tracks, per-window audio, device selection, defaults) — input from maintainers welcome there.
Comment 13 Arjen Hiemstra 2026-07-08 09:03:05 UTC
Git commit 06d7720daf9a0ec4163b51db9e38c561ff8580ea by Arjen Hiemstra, on behalf of Khudoberdi Abdujalilov.
Committed on 08/07/2026 at 08:53.
Pushed by ahiemstra into branch 'master'.

recording: Expose audio recording on PipeWireRecord

Add recordSystemAudio and recordMicrophone properties on
PipeWireRecord and thread them through to PipeWireRecordProduce. setupFormat()
picks the matching audio encoder (libopus for WebM, native aac for MP4), adds a
second AVStream to the container and muxes the encoded packets via
processAudioPacket(). Formats without audio support ignore the properties with
a warning.
Related: bug 490867

M  +5    -0    src/encoder.cpp
M  +8    -0    src/encoder_p.h
M  +5    -0    src/gifencoder.cpp
M  +1    -0    src/gifencoder_p.h
M  +5    -0    src/libwebpencoder.cpp
M  +1    -0    src/libwebpencoder_p.h
M  +97   -2    src/pipewirerecord.cpp
M  +11   -0    src/pipewirerecord.h
M  +7    -1    src/pipewirerecord_p.h

https://invent.kde.org/plasma/kpipewire/-/commit/06d7720daf9a0ec4163b51db9e38c561ff8580ea
Comment 14 Nate Graham 2026-07-09 04:18:23 UTC
Git commit b983c07b3c48f250a2c4a207749f891f1425e389 by Nate Graham, on behalf of Khudoberdi Abdujalilov.
Committed on 09/07/2026 at 04:18.
Pushed by ngraham into branch 'master'.

Add options to record system audio and microphone


Adds two checkboxes to the recording settings — "Record system audio"
and "Record microphone" — backed by KPipeWire's new `PipeWireRecord`
properties.

Both options default to off: microphone off for privacy, system-audio
off to preserve current behavior for existing users.

The checkboxes are disabled for video formats that cannot carry audio
(GIF, WebP).
FIXED-IN: 6.8.0

M  +18   -0    src/Gui/OptionsMenu.cpp
M  +39   -2    src/Gui/RecordingSettingsColumn.qml
M  +5    -0    src/Gui/RecordingView.qml
M  +8    -0    src/Gui/SettingsDialog/spectacle.kcfg
M  +5    -0    src/Platforms/VideoPlatform.cpp
M  +3    -0    src/Platforms/VideoPlatform.h
M  +8    -2    src/Platforms/VideoPlatformWayland.cpp

https://invent.kde.org/plasma/spectacle/-/commit/b983c07b3c48f250a2c4a207749f891f1425e389