dimtpap / obs-pipewire-audio-capture

🔊 Audio device and application capture for OBS Studio using PipeWire
https://obsproject.com/forum/resources/pipewire-audio-capture.1458/
GNU General Public License v2.0
298 stars 9 forks source link

REQ: Allow multiple apps to be excluded from Application Audio Capture (PipeWire) #24

Closed flexiondotorg closed 9 months ago

flexiondotorg commented 1 year ago

Thank you very much for obs-pipewire-audio-capture 🙇 It has resolved several audio-related issues in my OBS Studio setup and helped simplify my scene/source composition.

Feature Request

When adding an Application Audio Capture (PipeWire) source, include the capability to Capture all apps but exclude multiple apps.

Rationale

With this capability added it would be possible to:

dimtpap commented 1 year ago

Audio Input/Output captures stream directly from the devices. What you really want is the App Capture to be able to exclude multiple apps

flexiondotorg commented 1 year ago

I've updated the issue accordingly.

dimtpap commented 1 year ago

Turns out OBS's API doesn't allow for an easy way to create a nice interface for this. I've pushed what I've come up with so far on the multiple-apps-per-source branch.

⚠️ Before proceeding, please backup your scenes/sources, existing app captures may break

You can do this in OBS Studio by going on Scene Collection, then Export image Use Import to restore your backup.

Here's a build for you to try out

flexiondotorg commented 1 year ago

Thank you for working on this 🙇

I've updated PipeWire to 0.3.63 on Ubuntu 22.04.1 because I read #17

I run my own from source OBS Studio, so I've built 29.0.0 and built your plugin from the multiple-apps-per-source branch.

I created a simple scene based on my original feature request.

I've tested local recordings only and just for a few minutes, and it works perfectly ⭐ Each audio source can be manipulated independently and I haven't encountered any audio distortion/corruption. I'll update my usual streaming setup and test it for real in the next few days and report back.

But thank you, this is ace!

flexiondotorg commented 1 year ago

No issues during a 2-hour live stream using multiple instances of Audio Application Capture without and with exceptions applied.

flexiondotorg commented 1 year ago

I've streamed several times now, and sadly, this branch of the plugin is introducing audio distortion that manifests as clicks and stutters. I'm aware of the expander/limiter bug in upstream OBS 29 and applied the patches; it is not that.

I am using a build of this plugin from the tip of the main branch 32889fc1a0af5e31bd2eb5f1ab45a9c5368ddd4e, and I haven't encountered any audio distortion.

dimtpap commented 1 year ago

That's interesting, no audio related changes were made. Do you have a clip where the distortions occur?

flexiondotorg commented 1 year ago

@dimtpap It might be PipeWire itself, as I do hear the clicks in the regular version of the PipeWire Plugin too. Using PulseAudio Input Capture for my Mic in OBS seems to clear things up.

I'm at conferences for the next several days, but I will do some thorough testing and report back.

dimtpap commented 1 year ago

The feature branch was actually created after I made some audio related changes to the plugin. I'd assume either https://github.com/dimtpap/obs-pipewire-audio-capture/commit/ff03b02dd1b364ccce4689a637cfc3cc9fabed96 or https://github.com/dimtpap/obs-pipewire-audio-capture/commit/91b71f1201ca77ace5085ac17acb2c3bbb4290a9 is responsible for the sound glitches but I cannot reproduce them. If you find that the plugin is indeed responsible for the glitches open another issue and as a workaround use the latest (1.0.5) release as it was published before the audio changes.

VladimirMrzv commented 1 year ago

@dimtpap can you add option to see all application in list for chooseing source, some games disable sound when switching to obs for configuration. And maybe multiple list for apps with more 2 sound streams or for other apps.

ezracelli commented 1 year ago

I'd love to try this out, but I need some features from 1.1.0 — can the feature branch be rebased?

dimtpap commented 1 year ago

Rebased linux-pipewire-audio-b59f1d5.zip

VladimirMrzv commented 1 year ago

@dimtpap excellent build. It is works for me. I can add application by his execute name and more than one.

flexiondotorg commented 9 months ago

@dimtpap Sorry for the long delay in getting back to you on this. It has been a few months since I've been not streaming to prioritise work and home life.

Thank you for working on this feature and for your patience in waiting for my feedback.

VladimirMrzv commented 8 months ago

@dimtpap

Rebased linux-pipewire-audio-b59f1d5.zip

can you update this build with new feature for showing paused sources or merge builds with option for extended config

dimtpap commented 8 months ago

can you update this build with new feature for showing paused sources

linux-pipewire-audio-71fdfdd.zip

I don't know if enough people need this to justify making the workflow harder for those that only capture single apps

VladimirMrzv commented 4 months ago

@dimtpap please update again this build, this is very comfortable for me

dimtpap commented 4 months ago

linux-pipewire-audio-c35fb3c.tar.gz

You can also find builds for any new commit here, under the "Artifacts" section of any entry.

3urobeat commented 3 months ago

Hey, the multiple-apps-per-source branch is amazing!
Sadly the associated program names are not saved for me when I quit OBS, otherwise it's working great!
I've installed the latest artifact version on OBS 30.1.0-1.

Are there any significant drawbacks to the "normal" version, which is why you don't want to merge it into the base branch yet?
I don't see any reason anybody would want less freedom for routing audio and I don't find the UI more complicated at all

Using this branch of the plugin I can separate Browser, Discord & Spotify into different channels and lump everything else (any arbitrary game and whatever is left) together, while also bypassing my EasyEffects EQ (capturing desktop audio was otherwise full of artifacts).

I couldn't do that without this branch of the plugin and it has been quite the gamechanger for me.

dimtpap commented 3 months ago

Sadly the associated program names are not saved for me when I quit OBS

I'll look into that

Are there any significant drawbacks to the "normal" version, which is why you don't want to merge it into the base branch yet? I don't see any reason anybody would want less freedom for routing audio and I don't find the UI more complicated at all

I think finding the app in the list, clicking on it, then clicking a button is more complicated than just finding and clicking the app in the list, especially when most users want to capture a single app (just a guess). Here is my comparison

Single app:

Multiple apps:

So the obvious way forward is to provide a mode drop-down, so that users can choose what trade-offs they'd rather make. I'll work on this and see how it goes (scared of complexity and feature creep)

3urobeat commented 3 months ago

Thanks for the response! Yeah, I guess three clicks is more than two :'D
A setting to have both options would be better of course and would allow you to have one code base instead of two.

I get the fear of feature creep, I have experienced the same in multiple projects but I think selecting multiple sources is quite a fundamental and powerful feature and is worth it to implement.

Btw one thing I noticed - the plugin saves the last selected item in the dropdown menu, it just does not save what I put into the list.

EmersonBiggons commented 2 months ago

I can second the need for it, it makes recording universal audio and removing music and discord MUCH nicer. The alternative would be making 50 billion unnecessary audio captures for everything I want audio for and that would be absurdly annoying. Before this branch I was genuinely considering never listening to music while playing games again just to get around the issue.

Libroru commented 1 month ago

Thanks for the response! Yeah, I guess three clicks is more than two :'D A setting to have both options would be better of course and would allow you to have one code base instead of two.

I get the fear of feature creep, I have experienced the same in multiple projects but I think selecting multiple sources is quite a fundamental and powerful feature and is worth it to implement.

Btw one thing I noticed - the plugin saves the last selected item in the dropdown menu, it just does not save what I put into the list.

Big issue right now. Any updates on this? 🙏