Commit graph

4694 commits

Author SHA1 Message Date
Ruwen Hahn 103ef76e5e rtmp-services: Allow loading Multitrack Video config from JSON
Add support for loading Multitrack Video configuration data from
services.json.
2024-05-07 21:56:53 -04:00
Ruwen Hahn 1959f6852e rtmp-services: Always copy service info to settings 2024-05-07 21:56:53 -04:00
Ruwen Hahn 4029ff2ac1 rtmp-services: Extract common json->settings logic 2024-05-07 21:56:53 -04:00
tytan652 832ac4bfa8 linux-capture: Rename Screen Capture as Display Capture 2024-05-04 16:15:38 -07:00
John Bradley 627308bd53 obs-webrtc: Add null terminator to codec array
This fixes an issue where, when the MAX_CODECS length was equal to the
amount of supported codecs (3), it would leave the list without a null
terminator and crash when iterating over the elements.
2024-05-03 22:52:30 -07:00
Ruwen Hahn 64caf0401d obs-outputs: Add video_id_t value for 0
This will be initialized to 0 in various cases, so let's make that
a valid enum value (even if it's not valid in rtmp?)
2024-05-03 13:06:50 -04:00
John Bradley fab8f0f80e obs-outputs: Add eRTMP/eFLV support for FLV 2024-05-03 13:06:50 -04:00
John Bradley c5ef7beda8 obs-outputs: Add initial eRTMP multitrack implementation 2024-05-03 13:06:50 -04:00
Ruwen Hahn 7f82426dc4 obs-outputs: Always define CODEC_HEVC 2024-05-03 13:06:50 -04:00
Kurt Kartaltepe 01b61fafbf obs-ffmpeg: Release encode texture early
During high graphics thread pressure it can take a significant time to
acquire the graphics lock. This change releases the OpenGL texture after
rendering to avoid the 2nd lock after sending the frame to FFmpeg. This
improves 99%-tile/100%-tile and median encode in a near encoder overload
scenario, and modestly raises the ceiling before encoder overload in my
test scene.

Master:
min=0 ms, median=4.29 ms, max=33.072 ms, 99th percentile=8.877 ms
min=0 ms, median=4.438 ms, max=77.157 ms, 99th percentile=9.853 ms
min=0 ms, median=4.527 ms, max=57.292 ms, 99th percentile=9.282 ms

This commit:
min=0.97 ms, median=3.009 ms, max=13.215 ms, 99th percentile=5.899 ms
min=1.181 ms, median=2.91 ms, max=9.854 ms, 99th percentile=5.56 ms
min=0.461 ms, median=3.013 ms, max=10.693 ms, 99th percentile=5.871 ms
2024-05-02 18:15:01 -04:00
Paul Hindt 182410cf6c aja: Prepare plugins for new libajantv2 repo
Support building AJA plugins with either the new libajantv2 library, or
the deprecated ntv2 library.

Finder scripts updated to search for libajantv2 and fall back to ntv2 if
not found. This allows this PR to be merged without requiring a
corresponding update to the pre-built obs-deps packages.
2024-05-02 14:31:16 -04:00
Ryan Foster e693f644ae win-dshow: Fix compiling with FFmpeg 7.0 2024-04-30 11:17:40 -04:00
derrod 14f588f318 obs-ffmpeg: Fix output path logging 2024-04-24 16:03:14 -04:00
tt2468 065d4533ee obs-webrtc: Add support for audio-only and video-only outputs
Adds the `whip_output_audio` and `whip_output_video` output kinds,
which selectively advertise only video or only audio support.

To use these types, it is effectively the same as with the AV
version. Just create the output, assign your video or audio encoder,
and you're good.

libobs does not have support for "optional" outputs. With an AV output,
if you only assign a video or audio encoder, start will fail.
2024-04-22 01:04:55 -07:00
Kurt Kartaltepe cfb10ece79 text-freetype2: Use a shader uniform instead of vertex attributes
We used to swap in a buffer with (0,0,0,1) for all vertex colors for
drop shadows and outlines. However, this vertex buffer couldn't be
uploaded separately from the vertex data in OBS, so we were reuploading
the text vertices every frame.

Instead, let's use a uniform for this uniform data and save 500us (or
more when handles are visible), a significant portion of my test scenes
render time.
2024-04-22 01:01:47 -07:00
derrod 8d2f4ed3e1 obs-ffmpeg-mux: Use new process args/pipe API 2024-04-20 18:30:46 -07:00
Kurt Kartaltepe 68768e13ae obs-qsv11: Fix adapter detection and fallback to sysmem
Pass down texture/host memory choice for fallback encoders. During
fallback we don't (can't) initialize a shared texture pool and should
use the regular host memory path.

This fixes usage on multi-GPU systems, and enables texture encoders.
2024-04-20 17:06:46 -07:00
Kurt Kartaltepe ebea709381 obs-qsv11: Implement texture encoder on Linux
Implements the texture allocator for QSV using VA-API surfaces and
implement encode_texture2 for using OpenGL textures directly.
2024-04-20 17:06:46 -07:00
David Rosca 06e364b670 obs-ffmpeg: Implement texture encoding for VAAPI 2024-04-20 17:03:54 -07:00
Kurt Kartaltepe e9b42e6c58 text-freetype2: Use cached glyph advances
We had these advances laying around but didn't use them here. Loading
the glyphs from the fonts is extremely slow, so let's avoid that since
we take the time to cache these already.
2024-04-20 16:28:12 -07:00
Sergio Garcia Murillo 414580b624 obs-webrtc: Add HEVC support 2024-04-17 15:27:39 -07:00
tytan652 02ead5b096 obs-ffmpeg: Fix unused variable in native NVENC 2024-04-16 11:15:22 -04:00
Ruwen Hahn dcd1bd9a80 obs-outputs: Fix FLV file info offset 2024-04-15 10:27:39 -07:00
Ruwen Hahn bdd7d9cf53 obs-outputs: Change FLV tag size according to v10 spec 2024-04-15 10:27:39 -07:00
Ruwen Hahn 7373f326f3 obs-outputs: Extract previous tag size writing logic
It's not repeated that often, but only two instances had
the explanatory comment.
2024-04-15 10:27:39 -07:00
PatTheMav be09cfe242 plugins: Update platform selection for adding plugins to build tree 2024-04-13 23:48:38 -04:00
PatTheMav 34f8abae1f plugins: Update Linux slice of cross-platform plugins for CMake 3.0
Also silences acknowledged compile warnings introduced by the updated
compiler settings in the CMake update.
2024-04-13 23:48:38 -04:00
PatTheMav 4ecfdb722f plugins: Add Linux-specific plugins for CMake build framework 3.0 2024-04-13 23:48:38 -04:00
PatTheMav 2bc4c69ee9 plugins: Fix compile errors introduced by CMake build framework 3.0 2024-04-13 23:48:38 -04:00
Kurt Kartaltepe befce71219 linux-pipewire: Fix future compiler errors
Unused variables and missing switch branches will break in cmake 3.0,
and are breaking for me right now so let's merge this early.
2024-04-13 21:37:17 -04:00
PatTheMav 9c90c721a0 mac-avcapture: Add pointer check for outputting NULL video frames
When a capture card or video capture source is contained in the scene
collection's list of sources, but the source is not a part of any
scene, it will be first created but then destroyed again in a deferred
fashion (as it has no strong references to it anymore).

This will happen before the capture source has finished its own
initialization, hence why the source pointer can be invalid at that
point.
2024-04-13 17:06:56 -07:00
tt2468 8b6924b80f plugins: Set keyframe flag on encoded audio packets
Not strictly necessary, and does not fix any bug. This just corrects a
nitpick that technically audio encoder packets are start points, but
that they aren't being labeled accordingly as keyframes.
2024-04-13 17:04:48 -07:00
Alex Luccisano c0f71f002c obs-ffmpeg: Use video_output_info in amf_create_encoder()
The frame rate used to initialize an AMF encoder should be aligned
with the derived frame rate in video_output_info instead of the global
obs_video_info structure. With this change, IDRs can be aligned when
multiple renditions are being encoded.

Using video_output_info members for the format, colorspace, and range
parameters in addition to the frame rate provides a single source for
this information and obs_video_info is no longer needed.
2024-04-13 17:00:26 -07:00
Colin Edwards 79dd0214a8 decklink: Update SDK to 12.0 2024-04-13 16:50:05 -07:00
Service Checker 97b03e3c54 rtmp-services: Remove defunct servers/services 2024-04-11 20:47:09 -04:00
tt2468 3d30a4efea obs-ffmpeg: Remove mpegts format override for SRT and RIST
FFmpeg is already very effective at detecting the correct input format
for socket-style protocols (SRT, RIST, TCP, UDP, etc.). By overriding
the format of SRT and RIST manually to mpegts, the user is being
prevented from using other container formats via these protocols.

In the rare case that libavformat is unable to detect the correct
container format for an SRT or RIST stream, the user may manually
specify that format in the existing format field.

With the FFmpeg options field which was recently added, probe options
may be specified by the user to further tune format detection.
2024-04-10 18:45:45 -04:00
Chaturbate 15b5dae9c2 rtmp-services: Update Chaturbate 2024-04-10 14:09:28 -04:00
Warchamp7 b67338c448 plugins: Remove dynamic default path properties 2024-04-09 21:10:50 -04:00
derrod f47fc81d32 obs-qsv11: Remove adaptive CQM option
Without setting the ScenarioInfo to game streaming, which was removed
in 03b70f0672, this is a no-op and its
existence is just confusing to users.
2024-04-07 02:07:59 +02:00
Gale 4c6e2a6722 obs-qsv11: Fix for QSV AV1 in multi-GPU system 2024-04-06 17:06:31 -07:00
tytan652 7d4501131a linux-v4l2: Fix deprecation with FFmpeg 7
FFmpeg 7 header states that avcodec_close should not be used since
avcodev_free_context already close the context.
2024-04-06 16:59:52 -07:00
tytan652 8dbad9ac29 obs-ffmpeg: Fix incompatible-pointer-types with FFmpeg 7 2024-04-06 16:59:52 -07:00
Ryan Foster 206af52467 win-wasapi: Fix legacy CMake
Follow-up to 1d5d4b29e7:

win-wasapi: Handle changes to the default monitoring device

Splits the WASAPINotify class out of win-wasapi.cpp and makes it a
shared object in the plugin, then also creates a callback to reset
audio monitoring if the default output device changes.
2024-04-03 14:44:39 -04:00
WuLongyue 685bc561d9 rtmp-services: Update "CHZZK" platform 2024-04-02 12:45:28 -04:00
derrod 3a1035576e obs-ffmpeg: Add Linux NVENC texture encoder 2024-03-31 02:33:07 -07:00
derrod 2f55f046fe obs-ffmpeg: Add native non-texture NVENC implementation 2024-03-31 02:05:40 -07:00
tytan652 78cd07bd58 UI,plugin: Refactor virtual camera enablement 2024-03-30 16:43:30 -07:00
derrod 4e18bb6e50 obs-outputs: Set AV1 packet priority 2024-03-30 16:15:03 -07:00
derrod 53319e05f7 obs-outputs: Cleanup some unused leftovers 2024-03-30 16:15:03 -07:00
Len 1badf8e11b rtmp-services: Add Hakuna Live RTMP service 2024-03-28 19:34:06 -04:00
Ryan Foster 6f3f7b4e5a obs-ffmpeg: Fix NVENC compatibility hack for old drivers/hardware
Add a COMPAT version of NV_ENC_INITIALIZE_PARAMS_VER, which changed
between SDK 12.0 and 12.1.

If using drivers older than the configured SDK/API requires, fall back
to the compatibility version of the API (11.1).

An example scenario would be encoding in H.264 on driver version 512.15.
SDK 12.1 requires driver version 531.61 on Windows. Currently, in this
scenario, OBS will fall back to the FFmpeg encoder path, which will do
its own driver check, which will fail on this driver version.

With this change, this scenario will instead leverage the existing
compatibility hack to fall back to the compatibility version of the API
without falling back to FFmpeg.

It should be noted that while neat, the compatibility hack that enables
Kepler GPUs to continue to be able to use NVENC in this way is expected
to be removed at some point.
2024-03-27 19:11:26 -04:00
Ryan Foster 24470b351a obs-ffmpeg: Set needs_compat_ver before struct version checks
Because 4a8e8bb1bd changed the
NVENCAPI_STRUCT_VERSION define to rely on enc->needs_compat_ver, we must
do the conditional check and define needs_compat_ver before any structs
are initialized because they will check the version when doing so by
calling NVENCAPI_STRUCT_VERSION internally.

In this case, make sure that we define enc->needs_compat_ver before
NV_ENCODE_API_FUNCTION_LIST_VER is called for
NV_ENCODE_API_FUNCTION_LIST.
2024-03-27 19:11:26 -04:00
Exeldro 8c9e4c2822 obs-text: Fix alignment with extents 2024-03-27 18:45:01 -04:00
Kurt Kartaltepe 4a903d5f85 obs-qsv11: Check all encoders are Intel devices
On Linux, we enumerate all VA-API devices, which incorrectly enables
QSV AV1/HEVC encoders when AMD devices report these capabilities.
2024-03-21 15:43:13 -04:00
Florian Zwoch 823e968a71 mac-capture: Fix string length when duplicated 2024-03-19 16:20:31 -04:00
PatTheMav 3af1b78f35 win-dshow: Set MSVC runtime on virtual camera targets directly
The MSVC_RUNTIME_LIBRARY property is not propagated to targets which
link against a target which has this property set. Thus the property
needs to be set on the actual virtualcam targets and not the interface
library.
2024-03-16 19:36:33 -04:00
PatTheMav 14654807cb win-capture: Add missing MSVC runtime setting to 32-bit build 2024-03-16 19:36:33 -04:00
jcm 7fab3d03e0 mac-capture: Standardize early return behavior in init_screen_stream() 2024-03-15 15:26:09 -04:00
derrod 5f2bb795f0 obs-ffmpeg: Fix HDR metadata not being written when using FFmpeg 6.1+ 2024-03-14 17:12:20 -04:00
Ryan Foster e1e1b6daab obs-browser: Update version to 2.23.4
9c235de - Update translations from Crowdin
58c7365 - CI: Update first-party GitHub Actions from v2 to v4
fc2cbaf - Update translations from Crowdin
2024-03-12 14:37:49 -04:00
Translation Updater 10b02e11d0 Update translations from Crowdin 2024-03-12 18:11:06 +00:00
PatTheMav f4733ec6a2 Update source code formatting with clang-format 17.0.3
Added SCDisplayRef type alias to fix a quirk of this specific
clang-format version with ObjC block syntax.
2024-03-11 15:55:30 -04:00
derrod 7cacd18e55 win-capture: Always reconfigure audio source when game capture hooks 2024-03-09 20:13:58 -05:00
invalidtask 725f495213 rtmp-services: Update Vaughn Live and Breakers ingests 2024-03-08 22:35:12 -05:00
Ryan Foster d25042a8ca obs-webrtc: Add additional error messaging for WHIP output
Adding to the previous commit, let's also use obs_output_set_last_error
to provide localized error messages to the user if we run into these
failure cases.
2024-03-08 21:51:42 -05:00
PatTheMav 12d25f9a91 mac-avcapture: Fix possible crash if camera uses BGRA format
BGRA or other formats that do not use color primaries will not yield
a valid color primary value. Initializing the CFComparisonResult to a
default value and replacing it only if a non-NULL color primary value
was retrieved avoids a possible crash.
2024-03-08 17:38:40 -05:00
Aleks Todorov 4953c5d517 obs-webrtc: Avoid crashing on invalid answer
PeerConnection::setRemoteDescription validates the input SDP, throwing
an exception whenever it is invalid.

Currently, instead of handling the exception, we just crash.

Instead, add an exception handler which logs a short description of the
issue as well as the error message from the exception.
2024-03-07 13:52:00 -05:00
Bart F e4ec414690 rtmp-services: Add SharePlay.tv 2024-03-07 11:50:32 -05:00
Ramjivan Jangid 5bfcedcad8 rtmp-services: Add Streamway to ingest list 2024-03-07 11:35:50 -05:00
WuLongyue 1e163d795e rtmp-services: Add "CHZZK" platform 2024-03-06 19:52:22 -05:00
Sherwin Dapito 71660dc9a1 rtmp-services: Update Switchboard Live servers 2024-03-06 19:25:27 -05:00
Tobias Speicher 97375e541b rtmp-services: Add "Vault - by CommanderRoot" to ingest list 2024-03-06 19:01:59 -05:00
Vainock 7ae66c72fd Update translations from Crowdin 2024-02-28 14:20:05 -05:00
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