Commit graph

4621 commits

Author SHA1 Message Date
PatTheMav 745f87f21f mac-avcapture: Fix frame rate collection for camera device formats
Some devices will report different framerate ranges for formats that
are identical apart from color primaries. Without taking these into
account, only framerates for one color primary variant would be used
to populate the framerate dropdown in the property view of the camera
source.

Checking for a difference in color primaries when iterating over all
available formats for a device thus requires checking for this
variation and adding the additional frame rate range as well.
2024-02-24 17:38:18 -06:00
Lain 33043a0c3e obs-websocket: Update to version 5.4.2
Fixes a versioning issue
2024-02-21 11:22:59 -06:00
Lain cf1c5962ff obs-websocket: Update version to 5.4.1
Fixes future deprecation warnings
2024-02-20 21:46:13 -06:00
PatTheMav 03c42e5b93 mac-avcapture: Fix crash issues on Intel-based Macs and older macOS
Fixes several possible crash issues that might occur on Intel-based Macs
and older macOS versions:

On modern macOS versions (13+) allocated memory is zero-allocated by
default which makes NULL pointer checks work correctly after allocation.

On older macOS versions this is not the case, so the OBSAVCaptureInfo
struct needs to be zero-allocated to ensure the guards in the tick and
render functions bail out correctly.

On Intel-based Macs and/or older macOS versions passing a reference to
the OBSAVCapture instance inside the OBSAVCapture struct can lead to a
crash because of a possible circular reference that cannot be resolved
at runtime.

Passing only a reference of the OBSAVCapture to libobs and incrementing
the retain count at source creation (decrementing in when the source is
destroyed) avoids this issue entirely.
2024-02-20 17:57:09 -05:00
shiina424 a63714c8f1 win-capture: Add line break for capture audio tooltip 2024-02-20 16:00:40 -05:00
PatTheMav 50a19c5219 mac-capture: Fix crash in device reconnect handler
The uninit function prematurely released the memory allocated for the
channel map setting, which exists in the scope of source life cycle
(compared to channel names which are valid during the life cycle of a
configured device).

Splitting up the clean-up for both (memory for channel names is
released when the device is uninitialized, memory for channel map
setting is released when the source is removed) ensures that the memory
is released but pointers don't become unexpectedly invalid.
2024-02-20 14:18:46 -05:00
PatTheMav 5a7478d562 mac-capture: Limit number of copied audio channels to libobs limits
OBS handles up to 8 channels of audio, which requires the CoreAudio
input callback to omit/ignore any audio data from channels above that
count and also report a maximum amount of 8 channels to match the
speaker setup given to swresample by libobs.
2024-02-20 14:04:28 -05:00
PatTheMav ee28503726 mac-avcapture: Add color format selection for capture card source
Some devices do not support all color formats at all resolutions, but
the capture card source automatically uses an available color format
and compares it against the available format for a specific resolution.

Without being able to change this format, some resolutions do not
work as CMIO will not be able to find a compatible format. Thus the
color format needs to be manually selected for capture card sources
as well.
2024-02-17 19:28:28 -05:00
derrod d87cf9c7eb win-capture: Disable audio source when game capture unhooks 2024-02-17 19:03:35 -05:00
derrod fe08a773ab win-capture: Fix leak in wasapi reroute proc call 2024-02-18 10:08:59 +11:00
Kurt Kartaltepe 288ed51269 obs-ffmpeg: Receive packets while frame queue is full
Previously, we always assumed we could push more frames before an encoded
packet would be available. Actually, we can get EAGAIN when the
frame queue is full and before any encoded packets have been completed.

Instead, attempt to read packets more often as the worst that can
happen is we get EAGAIN again.
2024-02-10 17:25:14 -06:00
PatTheMav 5af8c10b0e win-dshow: Add generated Windows resource file to virtualcam sources 2024-02-10 01:50:06 -05:00
Kurt Kartaltepe e1b4c026df obs-qsv11: Disable texture encoder on linux
After adding proper adapter enumeration the linux code ends up entering
the texture encoding paths, but these paths are not correctly
implemented on linux yet.

fixes #10221
2024-02-09 20:19:55 -05:00
vico-shang 7af6a0fc51 win-dshow: Fix YUY2 line size error 2024-02-07 12:27:38 -06:00
Chris (Flaeri) 0c2f3f8049 image-source: Fix crash when randomize with 0 files 2024-02-03 17:36:26 -06:00
Evgeny Pavlov b79ba49252
obs-ffmpeg: Fix wrong framerate in AMF VUI header
Frame rate should be defined before AMF encoder initialization,
because this information is used for setting vui_time_scale in SPS.
If frame rate isn't defined before initialization,
then AMF encoder set default frame rate into VUI header (30 fps).
2024-02-03 17:31:00 -06:00
Lain 10c82e638c win-dshow: Add support for newer Elgato devices 2024-01-31 00:54:14 -06:00
Translation Updater ac484a066f Update translations from Crowdin 2024-01-29 20:47:38 +00:00
Sean DuBois 752abdc0fc obs-webrtc: Add AV1 Support 2024-01-28 02:11:51 -06:00
tytan652 76eb88d984 obs-webrtc: Require libdatachannel 0.20 or newer 2024-01-27 17:54:23 -06:00
Kurt Kartaltepe 14f068a6b2 obs-qsv11: Use the new gs_enum_adapters 2024-01-27 17:51:33 -06:00
Ryan Foster 66c0080d5c CI: Update deps to 2024-01-27 release
This commit also modifies build-aux to update libdatachannel.

This commit also modifies obs-webrtc to avoid a compiler error.

Notable changes:
 * deps.ffmpeg: Update libdatachannel to 0.20.1
 * deps.macos: Remove Carla
 * deps.macos: Add uthash to macOS deps
 * deps.windows: Remove Carla
 * deps.windows: Add uthash to Windows deps
2024-01-27 15:33:09 -05:00
bin b8155cdff7 obs-ffmpeg: Set audio stream title for FFmpeg record output 2024-01-26 22:28:36 -05:00
Juliusz Chroboczek 762e0502f2 obs-webrtc: Improve error messages on HTTP failure 2024-01-25 22:09:55 -08:00
Ryan Foster 4decb111ba obs-websocket: Update version to 5.4.0
See b61a5c243137681a206bca2cef0f92e20598353a for changelog.
2024-01-25 16:23:51 -05:00
Hong Hak-Gyu a1f853af55
Add PandaTV live RTMP service (#10117) 2024-01-25 14:35:50 -06:00
Ryan Foster fbf6c8d243 obs-browser: Update version to 2.23.3
7fa3822 - REALLY don't allow browser docks to arbitrarily close OBS
2024-01-24 16:51:29 -05:00
Ryan Foster 2874b8f1cc obs-qsv11: Use 2 tile columns in QSV AV1 for 4K+
When resolution is 4K or higher, use 2 tile columns for QSV AV1.
2024-01-23 17:31:31 -05:00
Ryan Foster c25f0592ae obs-ffmpeg: Use 2 tile columns in NVENC AV1 for 4K+
When resolution is 4K or higher, use 2 tile columns for NVENC AV1.
2024-01-23 17:31:31 -05:00
David Rosca 5d0323ea0a obs-ffmpeg: Set better VA-API defaults
Use High profile for H264 and auto level with all codecs.
Remove setting default value for unused "rendermode" option.
2024-01-23 15:19:44 -05:00
David Rosca 2dbd47441f obs-ffmpeg: Add AV1 support for VA-API 2024-01-23 15:19:44 -05:00
Albert 358ec7bf53
rtmp-services: Remove StreamVi (#10130) 2024-01-23 13:07:42 -06:00
Ryan Foster 4fbbae59e3 CI: Update deps to 2024-01-18 release
To avoid a compiler error, this commit also bumps the configured NVENC
version to match the updated version in the deps package.

Notable changes:
 * deps.ffmpeg: Update zlib to 1.3
 * deps.ffmpeg: Update SVT-AV1 to 1.8.0
 * deps.ffmpeg: Update aom to 3.8.0
 * deps.ffmpeg: Update libsrt to 1.5.3
 * deps.ffmpeg: Update nv-codec-headers to 12.1.14.0
 * deps.ffmpeg: Update AMF to 1.4.32
 * deps.ffmpeg: Update FFmpeg to 6.1
 * deps.macos: Update LuaJIT to 2.1 c525bcb902
 * deps.macos: Update FreeType to 2.13.2
 * deps.macos: Update Asio to 1.29.0
 * deps.macos: Update nlohmann JSON to 3.11.3
 * deps.macos: Update Sparkle to 2.5.2
 * deps.macos: Update Syphon Framework to 5.0 39e31383ff
 * deps.windows: Update FreeType to 2.13.2
 * deps.windows: Update curl to 8.5.0
 * deps.windows: Update LuaJIT to 2.1 c525bcb902
 * deps.windows: Update Asio to 1.29.0
 * deps.windows: Update nlohmann JSON to 3.11.3
 * deps.windows: Update VPL to v2.10.1
 * deps.qt: Update Qt6 to 6.6.1 for Windows
 * deps.qt: Update Qt6 to 6.6.1 for macOS
2024-01-22 15:31:09 -05:00
rhutsAMD ab0b0cb7e2 obs-ffmpeg: Default the number of B-frames to 3 2024-01-22 09:48:12 -05:00
rhutsAMD e657e62c29 obs-ffmpeg: Fix issue with B-frames introducing motion blur
If a user sets both AdaptiveMiniGOP=true and EnablePreAnalysis=true
in the AMF/FFmpeg options field, AMF will adaptively insert
B-pictures, and no longer uses the fixed B pattern.

For a fixed B-frames pattern, it is expected that increasing B-frames
can cause a quality drop for certain content such as with high motion.
AdaptiveMiniGOP is recommended when using B-frames to improve the
quality in such cases. AdaptiveMiniGOP is dependent on PreAnalysis
which means that trying to enable it without having PreAnalysis turned
ON will have no negative effect (AdaptiveMiniGOP won't be enabled).
2024-01-22 09:48:12 -05:00
Lain 6cb1f5451e
Merge pull request #9943 from derrod/its-a-deque
Rename `circlebuf` to `deque`
2024-01-20 17:47:01 -06:00
PatTheMav e284a79b48 mac-avcapture: Update plugin to ObjC and modern APIs
Marks old AVFoundation capture source as deprecated.
2024-01-19 16:56:10 -05:00
derrod 229b7b2b03 image-source: Migrate slideshow mk2 to deque 2024-01-16 16:45:10 +01:00
derrod 9f306fa832 obs-outputs: Replace circlebuf with deque 2024-01-16 16:45:10 +01:00
derrod 8ec91bab04 obs-filters: Replace circlebuf with deque 2024-01-16 16:45:10 +01:00
derrod f083d14143 obs-ffmpeg: Replace circlebuf with deque 2024-01-16 16:45:10 +01:00
Lain 1e09f5a543
Merge pull request #10039 from derrod/roi-libobs
libobs/plugins: Add region of interest (ROI) encoder feature
2024-01-13 18:30:31 -06:00
Ruwen Hahn 8fb32c37ee obs-ffmpeg: Add disable_scenecut option for NVENC
This is functionally the same as x264's `scenecut=0` option
2024-01-13 17:49:34 -06:00
James Hurley 7fe5cb7dad librtmp: Add missing extended timestamp in Type 3 chunks
According to https://rtmp.veriskope.com/docs/spec/#5313-extended-timestamp
extended timestamps need to be present in Type 3 chunks
(`RTMP_PACKET_SIZE_MINIMUM`) if the previous chunk also included an
extended timestamp
2024-01-13 17:47:16 -06:00
Georges Basile Stavracas Neto 03358961aa linux-pipewire: Pass framerate and resolution at construction
This allows the stream negotiation to set the camera values right
from the start.
2024-01-11 09:57:08 -03:00
Wim Taymans bc02779529 linux-pipewire: Handle camera hotplug
Rebuild the camera list when a camera was added or removed.
2024-01-11 09:57:08 -03:00
Wim Taymans 968d7259bf linux-pipewire: Use spa_strerror to convert SPA errors to string
g_strerror only works for errno values, SPA errors are negative errno
values.
2024-01-11 09:57:08 -03:00
Wim Taymans a683c5f3ce linux-pipewire: Add float property support 2024-01-11 09:57:08 -03:00
Wim Taymans a44228ef50 linux-pipewire: Add resolution and framerate list contents
Trigger a renegotiation of the camera stream when either the
resolution or the framerate change.
2024-01-11 09:57:08 -03:00
Wim Taymans 12eba3f5d7 linux-pipewire: Handle property changes 2024-01-11 09:57:08 -03:00
Wim Taymans 07cbbe9bec linux-pipewire: Collect device controls
Collect the controls on the node. Enumerate the controls as
properties.

Co-authored-by: Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>
2024-01-11 09:57:08 -03:00
Wim Taymans e6d98ebfbb linux-pipewire: Start camera only after we find the device
Wait with starting the camera until we find the device in the
registry. Avoids cases where the camera stays unlinked.
2024-01-11 09:57:08 -03:00
Georges Basile Stavracas Neto 364323e445 linux-pipewire: Factor out formats list into a file
This will help share these formats with the upcoming Camera portal
code.
2024-01-11 09:57:08 -03:00
Wim Taymans 7f765cdb4c linux-pipewire: Add NV12 support
List it in addition to YUV formats.

Co-authored-by: Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>
2024-01-11 09:57:08 -03:00
Georges Basile Stavracas Neto c1b3831ba2 linux-pipewire: Add PipeWire-based camera source
This plugin adds a camera source for capture devices available
via PipeWire using the Camera portal.
2024-01-11 09:57:08 -03:00
Georges Basile Stavracas Neto 261cb91c62 linux-pipewire: Rename a function
Make it a bit more semantic, and matching of PipeWire API.
2024-01-11 09:57:08 -03:00
Georges Basile Stavracas Neto 56d3720ffa linux-pipewire: Add obs_pipewire_roundtrip()
Generalize the async server roundtrip wait so that future consumers
can, for example, wait for all devices to be listed before acting
on the registry.
2024-01-11 09:57:08 -03:00
Georges Basile Stavracas Neto 6499d01bec linux-pipewire: Allow passing registry events on creation
This will allow consumers of obs_pipewire to handle the device
registry themselves. This is not useful for the screencast code
since there's always only one node in the registry, but it will
be used by the camera and audio code to list hardware devices.
2024-01-11 09:57:08 -03:00
Rodney 0510d673d3 obs-qsv11: Add ROI support 2024-01-11 13:36:35 +01:00
Rodney 730ab5e6d1 obs-ffmpeg: Add ROI support to AMF 2024-01-11 13:36:35 +01:00
Rodney 5e9b2d6322 obs-ffmpeg: Add ROI support for native NVENC 2024-01-11 13:36:35 +01:00
Rodney 6b1f61949b obs-x264: Implement ROI feature 2024-01-11 13:36:35 +01:00
Lain a4f2290026 image-source: Rework slideshow (slideshow mk2)
Makes it so that slideshows can have as many files as desired, and
lazily decodes image data in a separate thread to prevent decoding from
stalling the video thread.
2024-01-10 20:45:36 -06:00
gxalpha 0aaf2e518b mac-capture: Remove macOS 14 ifdef and custom CGDisplayStream header
ec9809bd43 increased the minimum macOS SDK
to 14.2, meaning that the ifdef (and as a result the custom header) is
no longer needed.
2024-01-08 20:40:33 -05:00
Ryan Foster cc25a14173 obs-ffmpeg: Fix incorrect CMake list syntax 2024-01-08 19:49:04 -05:00
derrod 24e59d1621 obs-ffmpeg: Fix NVENC compat hack ternary being inverted 2024-01-07 02:29:00 +01:00
pkv 99ae6eb2e9 obs-ffmpeg: Support multiple audio tracks (mpegts)
This adds support for multiple audio tracks for the new mpegts output.

Signed-off-by: pkv <pkv@obsproject.com>
2024-01-06 18:42:54 -06:00
derrod 4a8e8bb1bd obs-ffmpeg: Only use NVENC compatibility hack if necessary 2024-01-06 18:38:43 -06:00
PatTheMav 2457d83e0f mac-capture: Update capture to include menu bar and child windows
macOS 14.2 changed internal defaults of SCK requiring the inclusion
of the menu bar and child windows to be enabled explicitly.

This will have a slight negative impact on capture performance but is
required to restore behavior of prior macOS versions.
2024-01-06 18:09:06 -06:00
jcm 354150a992 mac-virtualcam: Reduce excessive polling for new sample buffers 2024-01-06 17:43:42 -06:00
Penwywern 7abbfb1c82 vlc-video: Fix play_pause to respect boolean 2024-01-06 17:22:27 -06:00
Rodney 051d227b51 obs-ffmpeg: Remove Windows 7 NVENC fallback 2024-01-06 17:20:26 -06:00
Rodney 3594017fac obs-ffmpeg: Remove Ubuntu 20.04 NVENC fallback
Effectively reverts dd26fe4f8a
2024-01-06 17:20:26 -06:00
tt2468 8496d58a2c rtmp-services: Add IRLToolkit Frankfurt ingest 2024-01-06 17:08:40 -06:00
nquah 14db1489e0 obs-outputs: Enable HDR for HEVC over RTMP
Removes flag guard to enable HDR streaming for HEVC over enhanced-RTMP.
This functionality is currently only supported by YouTube. See
github.com/veovera/enhanced-rtmp for the enhanced-RTMP spec.
2024-01-03 18:01:26 -05:00
nquah f1f5b34d7b obs-outputs: Switch RTMP color metadata order
Sends color metadata before the video header for RTMP streams. Only
applicable to HDR RTMP streams. Ensures the server sees the correctly
configured color metadata first, in cases where the decoder config in
the video header has incorrect or missing color information. Mitigates a
bug that users with outdated AMD drivers may encounter.
2024-01-03 16:31:58 -05:00
Ryan Foster 0e50077948 obs-websocket: Update version to 5.3.5
Update CMake in preparation for Linux CMake update.
2023-12-22 16:44:55 -05:00
Ryan Foster f348ab458d obs-browser: Update version to 2.22.3
1f9b458 - cmake: Update formatting and use find_package for Qt6
fde998c - cmake: Fix regression in 1f9b458 for legacy Windows build
2023-12-22 16:44:00 -05:00
PatTheMav 5697b085da mac-capture: Switch AudioUnits to use canonical format on output bus 2023-12-19 18:33:53 -05:00
Robert Wittams 73e9561633 mac-capture: Allow selection of channels on core audio devices 2023-12-19 18:33:53 -05:00
PatTheMav 7dbde70de1 cmake: Remove support for generators besides Xcode on macOS 2023-12-19 17:59:44 -05:00
PatTheMav 087353eb3f aja: Add shared interface library for plugin and frontend-plugin 2023-12-19 17:59:44 -05:00
PatTheMav eae5cc1e38 plugins: Update CMake formatting with manual format choices 2023-12-19 17:59:44 -05:00
PatTheMav 9ae47a7937 cmake: Update FFmpeg find package to use explicit version 2023-12-19 17:59:44 -05:00
PatTheMav 8135085a23 cmake: Replace custom Qt discovery function with CMake default
find_qt was necessary during the transitional period between Qt5 and
Qt6. With Qt6 being the only supported Qt version (for open source) for
the time being, code complexity can be reduced for easier maintenance.
2023-12-19 17:59:44 -05:00
Service Checker ebed24c767 rtmp-services: Remove defunct servers/services 2023-12-19 02:32:08 +01:00
jpark37 09ffae07d8 win-capture: Toggle premultiplied alpha for games
Keep straight alpha as default for VTuber applications.
2023-12-16 17:15:18 -06:00
jpark37 ea9df85512 graphics-hook: Fix DXGI ref leak for D3D12 capture
Create ID3D11Resource dynamically to avoid reference inflation.
2023-12-16 17:03:43 -06:00
Georges Basile Stavracas Neto 67c1202849 linux-pipewire: Add screencast cursor_visible prop
This commit adds the screencast-specific 'cursor_visible' field
in an anonymous struct within the constructor struct.

This slightly improves the connection code by properly treating
construction-time information in a constructor struct. It allows
removing the extra function call that sets cursor visibility from
the Screencast portal code.

Admittedly that's not much, but again, this will be an important
distinction when introducing the Camera portal code, since some
camera properties will need to trigger renegotiation.
2023-12-14 10:20:55 -03:00
Georges Basile Stavracas Neto a1db8e5bde linux-pipewire: Factor out connection props in a struct
So that we can expand the number of construct-time connection
properties without changing the function signature every time.
This is mostly an ergonomic change for now, but it'll be very
useful when introducing the Camera portal code.
2023-12-14 10:20:55 -03:00
Georges Basile Stavracas Neto afab71aa80 linux-pipewire: Standardize argument names
Always name obs_pipewire_stream pointers 'obs_pw_stream', so as not
to confuse with obs_pipewire pointers which are called 'obs_pw'.
2023-12-14 10:20:55 -03:00
derrod ebd6eec7f6 win-wasapi: Make reroute target a weak reference 2023-12-13 22:10:53 +01:00
Norihiro Kamae 70aa1e903f win-wasapi: Initialize a pointer reroute_target
The pointer `reroute_target` was never initialized if the reroute was
not set but read during processing audio.
2023-12-13 16:15:09 +01:00
derrod 4b28631a95 win-capture: Add audio capture option to window/game capture 2023-12-12 00:05:47 +01:00
derrod 48f9969df3 win-wasapi: Add procedure to reroute audio output 2023-12-12 00:05:47 +01:00
jpark37 263e027938 graphics-hook: Remove unused member variables 2023-12-10 04:45:33 -06:00
jpark37 395ab0fbf5 graphics-hook: Use ID3DDestructionNotifier
Cleaner and more correct than hooking IUnknown::Release.
2023-12-10 04:45:33 -06:00
Richard Stanway 87c536ebe0 image-source: Use mutex when accessing slideshow
While adding or updating files locked this mutex, the graphics thread
did not. As the update operation is not atomic, the graphics thread
might access the darray in the middle of an update, resulting in access
to freed memory (crash) if the files were updated at the same time.
2023-12-10 01:39:58 +01:00
PatTheMav be7ac828de mac-capture: Fix ScreenCaptureKit deadlock when using nil display ID
In some scenarios ScreenCaptureKit will not call our completion handler
when an internal ReplayKit error occurred. This seems to be more common
when a <nil> display id is provided as the content filter for
ScreenCaptureKit.

The issue was reported to Apple as FB13455947, but it is good practice
for us to check for an invalid display ID before even attempting to start
a capture stream.
2023-12-09 17:34:33 -06:00
xlinshan 542cb876dc obs-vst: Fix incorrect VST window size on HiDPI display
On Windows, the VST plugins' window sizes are rendered larger than the
actual content on displays that have UI scale factor. The sizes are
larger by the scale factor, for example, 100x100 content will have a
200x200 window on a 200% scaled screen, and 150x150 on a 150% scaled
screen. This change adjust the window size to fit the content size.
2023-12-09 11:30:39 +11:00