Commit Graph

3790 Commits

Author SHA1 Message Date
jp9000
feda64e9c6 virtualcam-module: Fix crash on resolution change
Certain programs can start the virtualcam filter, then they may choose
to call `Stop()` on the filter, call `SetFormat()` to change the
resolution, then call `Run()` again to start the filter again. The
Windows virtual camera filter did not account for this, thus if the
resolution was different, it had potential to cause a crash.

To fix this, store the last filter resolution, then check the resolution
every frame, and if it changes, reset the scaling information.

(Author note: This code is unclean. What we need to do with the virtual
camera filter is make it only create the thread on `Run()`, then join
the thread on `Stop()`. It's currently a bit complicated to make it do
that at the moment, so this code is a kind of an annoying stopgap for
now.)
2022-10-15 01:42:07 -07:00
jp9000
bc9ed5062d virtualcam-module: Clarify resolution variables
The `cx`/`cy`/`interval` variables specifically specify the
OBS/placeholder resolution/interval. The resolution may not be the same
as the filter's resolution (when scaling is used).

Instead, prefix these variables with `obs_` to improve clarity.
2022-10-15 01:29:05 -07:00
jp9000
e18acb57af obs-ffmpeg: Clarify name of NVENC preset 2022-10-14 16:25:22 -07:00
jp9000
bcb73cb599 virtualcam-module: Don't send frames on initial pause
Sending frames on initial pause seems to cause an odd crash on
subsequent frame calls.

(Note by author: I do not know why the crash happened because code
beyond OBS is a proprietary black box. I suspect it's just a bug in
WebRTC or something, but I can't know for sure. This is incredibly
frustrating. But at least this particular crash seems to be fixed.
...for now.)
2022-10-14 00:14:54 -07:00
gxalpha
277dafab98 mac-capture: Log CoreAudio device sample rate 2022-10-09 17:09:07 -07:00
gxalpha
dd06fe44ad mac-videotoolbox: Remove "None" profile
Selecting this would actually fall back to "main", so we should just use
main as the default.
2022-10-09 16:58:30 -07:00
Service Checker
98199315e0 rtmp-services: Remove defunct servers/services 2022-10-09 16:54:48 -07:00
Norihiro Kamae
ba77ca6592 vlc-video: Fix crash at removing files from missing-file dialog
The callback missing_file_callback will get an empty string when a user
decided to remove the file on the missing file dialog.
Avoid the empty string to be held in files array and remove it.
Also avoid passing an empty file name from the property to internal
functions.
2022-10-09 16:40:06 -07:00
Alex Kosenko
39111dab3d rtmp-services: Update ingest list for Restream.io 2022-10-09 16:38:05 -07:00
PatTheMav
e76fbaa016 obs-vst: Toggle properties button visibility upon VST selection
A prior patch made the button to show/hide a VST check the current
status of a loaded VST. This lead to situation where upon first
selection a VST might be loaded but the button's visibility is not
changed.

This change will reevaluate the status of a loaded VST upon selection
in the drop-down menu and trigger button visibility accordingly.
2022-10-09 16:33:27 -07:00
Kurt Kartaltepe
84687813e3 linux-pulseaudio: Use DONT_MOVE for non-default devices
Ask the PA server to kindly not migrate our streams to the default
device unless the user chose the default device for input/output
captures.

Fixes #3211
2022-10-09 16:31:00 -07:00
derrod
a372c1c0b3 win-capture: Update D3D9 signature for Win 11 22H2 2022-10-09 16:21:02 -07:00
PatTheMav
992d18b66c win-capture: Fix reporting valid width and height if not capturing
While the inject-helper tries to hook an application, the source is
set to `active` until the inject-helper reports being unable to hook.

If the graphics thread updates the transformations of every source in
that time frame, the game-capture source will report the width and
height used from the last valid capture, leading to its selection box
flickering in and out of view.

Ensuring that width and height are only reported when the source is not
only made active but is also capturing content fixes the flickering
issue.
2022-10-09 16:17:05 -07:00
Luke Strickland
046b95dac9 rtmp-services: Update Glimesh to add RTMP ingests 2022-10-08 22:44:50 +02:00
jp9000
53f4627b0c obs-ffmpeg: Add NVENC AV1 support 2022-10-07 14:34:39 -07:00
jpark37
51c452e937 libobs: Precompute more accurate matrices
These are generated with .NET BigInteger fractions, and late divide.
2022-10-05 08:36:29 -07:00
gxalpha
ff0f5ca681 mac-videotoolbox: Remove unused defines 2022-10-01 16:25:05 -07:00
jpark37
39183c76b5 win-wasapi: Fix Stop hang
Fix hang when audio capture is active in the background and stopped by
either closing OBS, or switching scene collections.
2022-10-01 10:36:08 -07:00
jpark37
cbb910a99c win-wasapi: Don't reconnect when inactive
Unnecessary reconnect attempts may cause noticeable hitches.
2022-10-01 07:06:56 -07:00
jp9000
843fec57be obs-ffmpeg: Fix unpause causing certain encoders to fail
Due to the timeout detection, we need to factor in the current pause
offset to prevent pause from affecting the timeout.

Closes obsproject/obs-studio#7313
2022-09-30 13:09:29 -07:00
shinji3
9d7a6e7e8c obs-ffmpeg: Fix m3u8 recording in AMF 2022-09-29 15:47:26 -07:00
Aleix Pol
6fb83abaeb linux-pipewire: Close sessions as we are done with them
This way the stream can be cleaned up. Otherwise, we closed them all
when OBS closes which works but is not entirely correct.
2022-09-27 11:50:49 -03:00
Kurt Kartaltepe
1249ebe53d linux-capture: Fixup window name/class checking
There were a couple mistakes here that caused the fallback checks other
than window ID to fail to ever return valid results. This restores this
functionality that was broken since the c++/c transition.

fixes #7404
2022-09-24 20:42:57 -03:00
Ryan Foster
c5f1446ab3 obs-ffmpeg: Cap AMF encoder at 100 Mbps
The AMF docs specify that the maximum value for TARGET_BITRATE and
PEAK_BITRATE is 100,000,000 bit/s. Trying to set values above this
maximum value results in AMF choosing from its defaults instead of
capping at the maximum value. Let's cap at 100,000 Kbps in the UI to
prevent users from running in to this.

Fixes GitHub Issue obsproject/obs-studio#7423.
2022-09-24 16:38:17 -07:00
pkv
dba3401ceb obs-filter: Update model for NVIDIA Audio FX
This updates the model when swapping effects with NVIDIA Audio Effects.
This fixes a bug where the model was not updated. :(

Signed-off-by: pkv <pkv@obsproject.com>
2022-09-22 06:47:23 -07:00
jp9000
3df0c61c8c obs-ffmpeg: Fix when NVENC retries without psycho aq
In obsproject/obs-studio#6963, a crash was fixed when retrying NVENC
without psycho aq. Unfortunately, the code forgot to reinitialize the
session, and thus the retry always failed. This reinitializes the
session as it was likely meant to.
2022-09-22 02:42:32 -07:00
jp9000
3b7f15a046 obs-ffmpeg: Show detailed NVENC error messages 2022-09-22 02:42:32 -07:00
jp9000
6c474fecab obs-ffmpeg: use NvEncGetSequenceParams for NVENC header
The NvEncGetSequenceParams is the function used for extracting the
header, so let's use that rather than manually splitting the packet.
2022-09-22 02:42:32 -07:00
jp9000
b9f562729a obs-ffmpeg: Refactor NVENC defaults/properties
Removes unnecessarily duplicated code
2022-09-22 02:42:32 -07:00
jp9000
d7c7180a8c obs-ffmpeg: Update NVENC to new presets
(This commit also modifies the UI)
2022-09-22 02:42:32 -07:00
jp9000
5c9e620315 obs-ffmpeg: Refactor NVENC
There's a lot of duplicated code, so refactor it
2022-09-22 02:42:32 -07:00
PatTheMav
07c4ba7b07 obs-transitions: Allow fetching source properties without source
Per OBS API documentation, `get_properties` can be used to get the
properties of a source, but also of a source type. The latter would
pass a NULL pointer for a given source.

This adds the necessary change to avoid crashing OBS by passing such
a null pointer.
2022-09-21 14:28:59 -04:00
PatTheMav
8388cc22d2 mac-avcapture: Allow fetching source properties without source
Per OBS API documentation, `get_properties` can be used to get the
properties of a source, but also of a source type. The latter would
pass a NULL pointer for a given source.

This adds the necessary change to avoid crashing OBS by passing such
a null pointer.
2022-09-21 14:28:59 -04:00
PatTheMav
6b56cfddb6 mac-capture: Allow fetching source properties without source
Per OBS API documentation, `get_properties` can be used to get the
properties of a source, but also of a source type. The latter would
pass a NULL pointer for a given source.

This adds the necessary change to avoid crashing OBS by passing such
a null pointer.
2022-09-21 14:28:59 -04:00
PatTheMav
2a721d92b3 coreaudio-encoder: Allow fetching source properties without source
Per OBS API documentation, `get_properties` can be used to get the
properties of a source, but also of a source type. The latter would
pass a NULL pointer for a given source.

This adds the necessary change to avoid crashing OBS by passing such
a null pointer.
2022-09-21 14:28:59 -04:00
PatTheMav
2dbd6c2a2f obs-vst: Make VST editor buttons reflect UI and VST loaded state
This changes the buttons to better reflect the state of the filter:
* When no VST is loaded, hide both buttons
* Check if VST is loaded before changing visibility
* Check if VST is loaded and editor is open before changing visibility
2022-09-21 11:05:01 -04:00
PatTheMav
4a73b01581 obs-vst: Add public function to check for load state of VST
The bundle/dllHandle/soHandle property is private, so a getter method
is needed to fetch the status of a loaded VST.
2022-09-21 11:05:01 -04:00
PatTheMav
e0f1f95c7a obs-vst: Fix crash on macOS when no VST bundle was loaded
When loading a function from the bundle fails, the binary is unloaded
and the reference is released, but the pointer itself is not reset -
thus the check in the unload function will succeed and try to unload
an invalid bundle reference.

Similar to Linux and Windows, the pointer needs to be explicitly set
to a null pointer to ensure this check fails.
2022-09-21 11:05:01 -04:00
PatTheMav
9c3c2edd6f obs-vst: Allow fetching source properties without source
Per OBS API documentation, `get_properties` can be used to get the
properties of a source, but also of a source type. The latter would
pass a NULL pointer for a given source.

This adds the necessary change to avoid crashing OBS by passing such
a null pointer.
2022-09-21 11:05:01 -04:00
PatTheMav
967bce5e15 mac-virtualcam: Fix distorted virtual cam image when using full range
The root cause of the issue is `swscale` dropping the second plane of
biplanar pixel data, resulting in an "incomplete" frame being fed to the
CVPixelBuffer.

As CVPixelBuffers have dedicated support for full range colour, use
these directly, which improves performance even further (as any
conversion for full range data is avoided as well).

To ensure that OBS does not implicitly enable conversion via `swscale`
a video conversion struct needs to be set in any case, ensuring that the
output range and colourspace match the output configuration.
2022-09-21 11:04:25 -04:00
PatTheMav
ee34d8fbfe mac-virtualcam: Fix virtualcam video on Intel-based Macs
This issue primarily seems to affect Intel-based Macs without unified
memory: While an IOSurface is supposed to be shared via a mach port
with other processes, each process needs to lock the surface during
access (as is common with other shared resources).

Apple Silicon-based Macs seem to be less affected as a switch between
GPU and CPU memory (which can happen dynamically for IOSurfaces) would
still point to the same unified memory.
2022-09-21 11:04:25 -04:00
gxalpha
332c1b4176 mac-capture: Undeprecate traditional capture sources on macOS 12
SCK has too many bugs on macOS 12 that don't like they will get fixed or
backported for it to be the recommended capture source.
This commit removes the "Deprecated" flag from traditional capture
source if the user is on macOS 12 (even if SCK is available) and marks
SCK as Beta.
2022-09-20 18:49:13 +02:00
Georges Basile Stavracas Neto
fb51f8b224 obs-outputs: Drop unused config file
The obs-outputs-config.h.in file is not actually used. It only
defines the FTL_FOUND variable, but the build system takes care
of that by setting a compiler argument for that.

Drop that file.
2022-09-17 16:38:50 -07:00
Wahaj Dar
ff7720bfe8 rtmp-services: Add Livepush to service list
Adding latest Livepush rtmp endpoints to streaming service list
2022-09-17 16:37:13 -07:00
Stefan Hoffmeister
fbb7b93226 linux-v4l2: Remove redundant non-NULL check on FILE 2022-09-17 16:14:05 -07:00
Stefan Hoffmeister
e8f27c2a79 linux-v4l2: Fix resource leak on device open error path 2022-09-17 16:14:05 -07:00
Kurt Kartaltepe
b1c65af2b1 linux-capture: Ensure name pixmap is checked
The void cookie will never return an error unless we use the explicitly
checked version of this function.
2022-09-12 12:50:53 -03:00
WarmUpTill
2a4f91bbee image-source: Update media states when source is de-/activated 2022-09-10 16:31:23 -07:00
jpark37
afeb78e022 graphics-hook: Print DXGI swap chain desc 2022-09-10 15:36:53 -07:00
jpark37
5fd22f3dfd graphics-hook: Remove unused code 2022-09-10 15:36:53 -07:00