Commit graph

4265 commits

Author SHA1 Message Date
PatTheMav 349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00
Jeremy Woertink 90e8e81e99 rtmp-services: Add Joystick.TV
Adding JoystickTV as an official service

Closes obsproject/obs-studio#8414
2023-03-26 14:40:57 -07:00
tt2468 1cd802810b rtmp-services: Add IRLToolkit Sydney ingest 2023-03-26 14:23:23 -07:00
Yuriy Chumak d68a75c60c rtmp-services: Add AV1 and HEVC to YouTube RTMPS service 2023-03-26 16:37:31 +02:00
derrod 4b038c9a40 rtmp-services: Add AV1 to services schema 2023-03-26 16:37:31 +02:00
derrod e767cacf0a rtmp-services: Explicitly set codecs for RTMP services 2023-03-26 16:37:31 +02:00
Yuriy Chumak 27dc30b672 obs-outputs: Prevent streaming HDR AV1/HEVC over RTMP
Currently unsupported by all remotes accepting enhanced RTMP. This
commit may be removed at a later date.
2023-03-26 16:37:31 +02:00
Yuriy Chumak 2d4f0ac440 obs-outputs: Add support for AV1/HEVC over RTMP
Implements AV1 and HEVC according to enhanced RTMP spec found at
https://github.com/veovera/enhanced-rtmp

Co-authored-by: derrod <dennis@obsproject.com>
2023-03-26 16:37:31 +02:00
jpark37 ccb2c06540 decklink: Add HDR capture support
Also add true 10-bit support.
2023-03-26 01:52:44 -07:00
Richard Stanway 0ed53ada03 obs-ffmpeg: Use more actionable error messages for hardware encoders
Telling a user to "Check your driver is up to date" is too open to
interpretation, many users will use Windows Update or Device Manager to
check for updates which doesn't help. Instead, let's explicitly tell
them what is most likely to fix the problem.
2023-03-25 22:48:19 -04:00
tytan652 4d5cf98de0 linux-pipewire: Add missing struct typedef for older PipeWire
This allows building against PipeWire versions lower than 0.3.62.

The missing structure is copied verbatim from:
https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1423
2023-03-25 22:02:29 -04:00
shiina424 af5d4fb8bb vlc-video: Fix translation key 2023-03-25 18:29:07 -07:00
shiina424 100258b0f6 obs-filters: Fix translation key 2023-03-25 18:29:07 -07:00
Jim 7a30d535aa
Merge pull request #8289 from derrod/more-audio-codecs
libobs,obs-ffmpeg: Add option for recording lossless audio
2023-03-25 16:52:49 -07:00
cg2121 1ac609f1ff UI, libobs: Fix not handled in switch warnings
These warnings were being spit out by GCC on Linux.
2023-03-26 10:47:01 +11:00
derrod 1a51aad582 obs-ffmpeg: Add unclamped 32-bit floating point PCM encoder 2023-03-25 10:38:18 +01:00
derrod cf837fa38a obs-ffmpeg: Add FLAC encoder 2023-03-25 10:22:45 +01:00
derrod 3ae98511d0 obs-ffmpeg: Add PCM and ALAC encoders 2023-03-25 10:22:45 +01:00
derrod 33e4ffd3fe ffmpeg-mux: Properly support lossless codecs
- Do not set sample rate (not required here, but can be 24/32 now)
- Only set bit_rate for lossless codecs
- Only set frame_size for codecs using a fixed one
2023-03-25 10:22:45 +01:00
tytan652 19acb8cc5f rtmp-services: Fix supported audio codecs in rtmp_common 2023-03-25 10:03:22 +01:00
jpark37 feae65c472 graphics-hook: Handle VK_KHR_imageless_framebuffer
Applications that use this Vulkan extension would have image usage
mismatches because we add VK_IMAGE_USAGE_TRANSFER_SRC_BIT to
VkSwapchainCreateInfoKHR::imageUsage, so make the same modification to
VkFramebufferAttachmentImageInfo::usage.
2023-03-24 15:17:43 -07:00
Yuriy Chumak 1a05097304 obs-ffmpeg: Add HDR and HEVC to VA-API encoder 2023-03-24 15:16:10 -07:00
tytan652 6f755451d9 rtmp-services: Set protocol in rtmp_common if none set 2023-03-24 16:07:40 -04:00
Matt Gajownik f1e728ea03 obs-browser: Update version to 2.20.0
30d2b6f - Add ability to zoom browser docks with Ctrl - and +
cbad08a - Use officially documented data type to persist CEF preferences
4236b56 - Persist CEF Preferences
501f624 - Add proc handler for javascript event
5a55d18 - Replace SIGNAL and SLOT macro with new style
72afb16 - Increased maximum width and height
e9eb123 - Fix leak with SchemeHandlerFactory
ea9f59d - Fix issue with unknown speaker layouts
00f1396 - Remove redundant macOS hardware acceleration check
c2aaaef - Move custom FPS property next to its FPS
2023-03-22 08:51:52 +11:00
Matt Gajownik 1af982fcfa rtmp-services: Fix formatting and indentation of services schema
Also define editorconfig for rtmp-services to match existing structure.
2023-03-21 20:58:05 +11:00
Jim 1ea5917973 image-source: Add slide_changed signal
Allows a plugin or script to know when a slide has changed, and which
index/file it's switched to
2023-03-20 11:31:21 -07:00
derrod f96ae65d1b obs-ffmpeg: Pass correct audio codec to muxer subprocess 2023-03-20 17:01:47 +01:00
derrod 198debe945 ffmpeg-mux: Set experimental compliance for FFmpeg < 6.0
With 5fe417bce1 it became possible to use
Opus in local recordings, this could potentially have the user try to
record Opus in MP4.

FLAC in MP4 was marked as stable in FFmpeg 6.0
Opus in MP4 was marked as stable in FFmpeg 4.3

For Ubuntu 20.04 we still need the latter, for 22.04 (and potentially
other Linux distributions) the former.

While FLAC is not yet implemented, we may want to do that in the near
future so for simplicity just keep it at 6.0.
2023-03-20 17:01:47 +01:00
Jim e9ef38e3d3
Merge pull request #7978 from jpark37/dxgi-display-sdr-on-hdr
libobs-d3d11,win-capture: Add Force SDR for DXGI duplicator
2023-03-20 01:43:14 -07:00
Jim 0a9ed4569b
Merge pull request #7814 from jpark37/decklink-preview-rescale
decklink: Move preview output rescaling to GPU
2023-03-20 01:42:36 -07:00
tytan652 d917ceafe8 rtmp-services: Add connect infos checks 2023-03-19 17:38:02 +01:00
tytan652 5e4ed49a2d obs-outputs,obs-ffmpeg: Use connect infos in outputs 2023-03-19 17:38:02 +01:00
tytan652 258e339d2f rtmp-services: Add connect infos to services 2023-03-19 17:38:02 +01:00
tytan652 b2d686e8f4 obs-ffmpeg: Allow opus for SRT and RIST 2023-03-19 17:27:43 +01:00
tytan652 cd83b94c7c plugins: Rename audio encoders 2023-03-19 17:27:43 +01:00
tytan652 1514f1597a plugins: Fix codec name on AAC encoders 2023-03-19 17:27:42 +01:00
tytan652 aeab6b8fc4 libobs,docs,rtmps-services: Add supported audio codecs
Also remove Opus-only "supported audio codecs" in the services JSON.
2023-03-19 17:27:42 +01:00
tytan652 213eb613d3 rtmp-services: Remove output getter from rtmp_common 2023-03-19 17:16:13 +01:00
tytan652 e317c88f55 obs-ffmpeg: Remove AV1 from SRT/RIST supported codecs
MPEG-TS standard is not ready for AV1
2023-03-19 17:08:06 +01:00
tytan652 9d8d98b142 rtmp-services: Remove fallback to H264 if no codec found
The fallback in now inside the output.
2023-03-19 17:08:06 +01:00
tytan652 fa58a38b24 rtmp-services: Add protocol getter to services 2023-03-19 16:31:05 +01:00
tytan652 513c6bc489 rtmp-services: Add protocols to services JSON
If the server URL is not an RTMP(S) URL, the protocol field becomes
required.

The output field becomes required on non-RTMP(S) services to keep
backward compatibility.

Also skip service if the protocol is not available.
2023-03-19 15:29:03 +01:00
tytan652 855956f60e obs-outputs,obs-ffmpeg: Add protocol to service outputs 2023-03-19 15:29:03 +01:00
derrod f1c95b2bd0 win-capture: Fix compatibility info showing in any mode 2023-03-19 02:16:05 -07:00
Jim 6eace37e06
Merge pull request #8229 from derrod/hashed-tables
Hashtable Adventures
2023-03-19 00:34:44 -07:00
9p4 23ce4fe2f1 linux-v4l2: Fix fallback framerate for camera 2023-03-19 09:39:36 +11:00
Richard Stanway c9dd230a72 obs-outputs: Explicitly close RTMP socket on send error
Some send() errors are not treated as fatal but the connection gets shut
down regardless. When this happens, librtmp may send an FCunpublish
message which various services interpret as an "end of stream" message
and disable features like "disconnect protection". Instead, let's
explicitly close the socket so that the remote end is aware that this is
an unclean disconnect.
2023-03-18 15:38:54 -07:00
tytan652 a0905d3972 obs-outputs,UI: Disable Windows-only options on non-Windows
"New Socket Loop" and "Low Latency Mode" RTMP options are only available
on Windows.

Those options should be ignored and forced-disabled on non-Windows
builds.
2023-03-18 15:29:50 -07:00
derrod 5aecbebc98 obs-outputs: Remove Windows 7 sndbuf auto-tuning check 2023-03-18 15:19:48 -07:00
Norihiro Kamae 8938aeebfa obs-ffmpeg: Remove an empty clause
The empty clause was originally introduced to set a cutoff settings as a
hack at a commit ae862c16a and later removed at a commit a89470d2e. At
this time, the clause became empty but another commit aa58b9cf5 reuse
the clause and finally a commit 9baedb1c6 removes so that the clause is
empty now.
2023-03-18 15:16:44 -07:00
Norihiro Kamae b742938a6f aja: Remove an empty clause
Remove an `if` statement that test a variable `rd`, which is an `enum
class RasterDefinition` type .
2023-03-18 15:16:44 -07:00
Richard Stanway 7e9b071a6c
obs-ffmpeg: Add GeForce MX450 variant to unsupported NVENC list 2023-03-18 13:31:42 +01:00
derrod 13040ad241 obs-ffmpeg: Fix translation key capitalisation 2023-03-18 10:47:50 +01:00
Kurt Kartaltepe 9bde0afc74 linux-pipewire: Report modifiers in hex
Use hex for modifiers because they are generally formed from a high byte
and low bytes. This makes it easier to see these bytes and identify
unusual modifiers.
2023-03-17 10:48:51 -03:00
田七不甜 03691eb0a9 win-capture: Remove the redundant "-" in the CSGO launch option and Steam url language code 2023-03-15 22:31:06 +01:00
Robert Mader 0a36dc9d80 linux-pipewire: Clear cursor texture on empty bitmap
If we receive an empty cursor bitmap - one without valid size - we
should hide the cursor. Do so by clearing the texture.

This fixes visible cursors when recording various games with Wayland
compositors.

Closes https://github.com/obsproject/obs-studio/issues/4895
2023-03-14 10:52:17 -03:00
Norihiro Kamae baddacc111 Revert "obs-ffmpeg: Use FFmpeg's "fast" AAC encoder by default"
This reverts commit aa58b9cf5f.

FFmpeg has reverted their default AAC encoder from fast to twoloop,
which has much better rate control management, making it closer to CBR,
and it sounds much better.
2023-03-12 10:21:27 -07:00
gxalpha 9c6a3a1d49 obs-vst: Fix memory leaks on macOS when VST's fail to load
Detected by clang-analyzer.
2023-03-09 15:18:38 -05:00
Mathijs Kadijk 970c284a65 mac-virtualcam: Prevent PTS rounding
All presentation time stamps are rounded to whole seconds during the
conversion from nanoseconds to seconds, because of the immediate cast
to `int64_t`. This results in the same presentation time stamp being
send to consumers for a whole second.

In previews/live streams this isn't super visible as last frame is
often assumed to be the newest and the stream is updated. It's more
problematic when recording since APIs like Apple's AVFoundation don't
allow duplicate presentation time stamps or it can look like frames are
produced in huge bursts once per second.

In this PR `CMTimeMakeWithSeconds` is used instead of `CMTimeMake` to
make sure the conversion is done correctly and simplify the calculation
we have to do a little.
2023-03-09 15:45:48 +01:00
Mathijs Kadijk ecaa5466cb mac-virtualcam: Fix incorrect PTS on Apple Silicon
The `fillFrame` method of the mac-virtualcam plugin is creating samples
directly using the value from `mach_absolute_time()` as `hostTime`.
This assumes this value is in nanoseconds, while it is in fact in mach
tick units. On Intel Macs mach tick units will be exactly 1 nanosecond
resulting in valid values, but on Apple Silicon macs this is no longer
the case.

This results in sample buffers with the placeholder image that have
much lower presentation time stamps than the samples containing content
produced by OBS. In previews/live streams this shows due to the last
content sample being shown frozen until the whole buffer is filled with
samples containing the placeholder image. Applications recording the
video stream are even more confused and crash or record videos with
wildly incorrect lengths.

In this PR `clock_gettime_nsec_np` is used to convert from mach tick units
to nanoseconds. This will make sure the `hostTime` value is correct on
both Apple Silicon and Intel macs. Making sure we produce stable
presentation time stamps from the virtual camera plugin at all times.
2023-03-09 15:45:48 +01:00
Ryan Foster 002bd0b5a4 win-capture: Suppress LNK4098
Suppress LNK4098 to allow building against pre-built Jansson for now.
2023-03-08 17:14:11 -05:00
derrod 2c48e61207 UI,obs-vst: Set Qt RCC format to 1
v2 introduces last-modified timestamps that ruin reproducibility.
2023-03-07 18:13:24 -05:00
tytan652 278973576e obs-outputs: Fix RTMP undefined symbols if built without Mbed TLS 2023-03-07 17:01:49 -05:00
derrod 2e57e09036 win-capture: Display compatibility information 2023-03-07 16:03:18 -05:00
tytan652 f4e90a5bd7 obs-ffmpeg,cmake: Add a finder for AMF headers 2023-03-07 14:55:03 -05:00
tytan652 6db418fb3f obs-ffmpeg: Replace external/AMF folder by obs-deps headers 2023-03-07 14:55:03 -05:00
PatTheMav 0fe28e9ceb mac-syphon: Fix warnings in ObjC code for CMake rework
Removes unused functions and explicitly casts higher-precision
CoreFramework data types into lower precision obs-module types.
2023-03-07 19:23:35 +01:00
Kurt Kartaltepe 0fb89dc9a1 obs-ffmpeg: Fix crash during ratecontrol check
When iterating over an array of structs we incorrectly check for a null
pointer, but the actual sentinel value is the empty struct.
2023-03-04 16:07:12 -08:00
gxalpha ffd6ae699c obs-transitions: Add long description for full decode option 2023-03-04 15:33:17 -08:00
Chris (Flaeri) e7cd29bbe5 obs-ffmpeg: Implement QVBR for AMF encoders
Makes QVBR rate control usable. Fix wrong rate control check on line
1457. Switch from bitrate to CQ/QP value (no bitrate needed).
2023-03-03 21:48:59 +00:00
Mico Häsänen d33abf68e5 rtmp-services: Add Enchant.events to service list 2023-03-02 18:00:52 -05:00
Ryan Foster 681014bec2 rtmp-services: Fix whitespace issues in services.json
* Remove trailing whitespace
 * Use spaces instead of tabs for indents
2023-03-02 13:24:39 -05:00
Georges Basile Stavracas Neto f62f370edd linux-pipewire: Remove unnecessary variable
No functional changes. The code is just ever so slightly easier to
read now.
2023-03-01 20:47:49 -03:00
Georges Basile Stavracas Neto 436787c1f4 linux-pipewire: Check for effective crop region
Some compositors send buffer crop information even when the crop
matches the buffer size. It doesn't really matter in practice,
but it's good hygiene to check for the effective crop instead of
simply checking if crop exists.
2023-03-01 20:47:49 -03:00
Georges Basile Stavracas Neto d68b061d57 linux-pipewire: Adjust cosmetics
Move code into auxiliary functions, to improve the legibility of the
draw function. It also gets rid of these pesky switch fallthroughs.
No functional changes.
2023-03-01 20:47:49 -03:00
Georges Basile Stavracas Neto 925888b763 linux-pipewire: Fix wrong error message
In the non-DMA path, we are logging an error message saying that
the DMA format is wrong. That's not the DMA format, it's the raw
buffer format.

Fix the message.
2023-03-01 20:47:49 -03:00
Georges Basile Stavracas Neto f520b251fb linux-pipewire: Demote yet another error to debug
This was an oversight from commit be629b93c.
2023-03-01 20:47:49 -03:00
Albert 414937a963
rtmp-services: Update Streamvi (#7921)
Co-authored-by: Joel Bethke <joel.bethke@gmail.com>
2023-03-01 17:36:58 -06:00
Stripchat 8fd6949778
rtmp-services: Update Stripchat streaming service (#8269) 2023-03-01 16:16:01 -06:00
Tophicles 87b7f7785f
rtmp-services: Add LiveStreamerCafe (#8203)
Incremented version number as requested.

Co-authored-by: Kristopher Marentette <tophicles@syslog.brucenet>
2023-03-01 16:15:45 -06:00
Regan Black 6e0f5dccb2
rtmp-services: Update Switchboard Live Servers (#8180)
Co-authored-by: Regan Baah <one0ten@outlook.com>
2023-03-01 16:15:25 -06:00
Kevin Deng 480a8700da
rtmp-services: Update Mildom more_info_link (#8334)
Co-authored-by: kevin.dww <kevin.dww@nonolive.com>
2023-03-01 16:13:38 -06:00
derrod 166dc4909d enc-amf: Update submodule 2023-03-01 20:39:53 +01:00
derrod 3c92413674 win-dshow: Remove obsolete name in REGFILTERPINS 2023-03-01 20:39:53 +01:00
derrod 2ac8ce8f65 obs-ffmpeg: Fix __VA_ARGS__ for comma ellision 2023-03-01 20:39:53 +01:00
derrod 19b6d79597 win-capture: Fix possible macro redefinition 2023-03-01 20:39:53 +01:00
pkv 2e79d4c902 obs-ffmpeg: Fix for FFmpeg 6 deprecating a flag
Also modifies libobs & deps/media-playback.
AV_CODEC_CAP_TRUNCATED was removed in avcodec 60 [1].
We ifdef the code depending on it to allow compilation.

[1] avcodec: remove FF_API_FLAG_TRUNCATED
3ceffe7839

Signed-off-by: pkv <pkv@obsproject.com>
2023-03-01 13:23:51 -05:00
gxalpha fea4a19c8b obs-ffmpeg: Add full_decode to media source log
This is an option that while very powerful also provides a footgun for
users if they don't have enough memory. It will be helpful for support
volunteers to be able to see if the option has been enabled.
2023-02-25 19:26:51 -08:00
Jim 4bf14d09b4 obs-transitions: Add option to preload stinger video to RAM
Stingers -- and especially track matte stingers -- are currently subject
to real time decoding, which can be detrimental in a production
environment where a stinger video may not be able to decode in a timely
fashion.

To remedy this, this change adds an option to fully decode stingers
immediately and cache the decoded video/audio in RAM for playback to
greatly improve stinger performance.
2023-02-25 18:13:11 -08:00
columbarius 8abc3528cf linux-pipewire: Read buffer transformation from PipeWire
PipeWire allows since 0.3.62 [1] to attach metadata to a buffer
describing a transformation of the buffercontent. Clients should then
undo that transformation to import it correctly.

We can enable this feature using macro guards and runtime server version
checks on supported systems.

[1] https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1423
2023-02-25 11:49:51 -03:00
Georges Basile Stavracas Neto a1a98f9cfd plugins: Drop win-ivcam
Apparently this was a prototype from Intel that never really
properly launched. Remove the plugin.
2023-02-24 14:04:29 +01:00
Georges Basile Stavracas Neto 4ab9cd1005 plugins: Drop win-mf
The win-mf plugin is deprecated, and disabled by default. Let's drop
it entirely.
2023-02-24 13:22:52 +01:00
PatTheMav 8061652051 mac-videotoolbox: Refactor implementation
Existing code made use of macros which broke parsing in Xcode and
complicated debugging as crucial code was executed within macros and
not actual source code.

Use of mutable CoreFramework data structures (which were never mutated)
is replaced by use of faster non-mutable variants.

When an allocator needs to be used, `kCFAllocatorDefault` is specified
explicitly.

VideoToolbox session properties are also set in bulk instead of
multiple consecutive calls.

Also simplifies detection of Apple Silicon hosts to make code more
readable.
2023-02-21 21:29:12 +01:00
jpark37 09c2a321ce mac-videotoolbox: Add ProRes 4444 (XQ) support
Also leverage P216/P416 pixel formats to retain precision.
2023-02-21 18:48:44 +01:00
jpark37 463bf0dff5 libobs,UI: Add P216/P416 pixel formats
Will be useful for ProRes.
2023-02-21 18:48:44 +01:00
gxalpha 433c85bcd7 mac-capture: Fix various SCK memory leaks
Detected by clang analyzer.
2023-02-21 17:40:56 +01:00
jpark37 06b8cef665 decklink: Set video conversion earlier
Owner needs this info set sooner to move rescale from CPU to GPU.
2023-02-19 11:46:20 -08:00
jpark37 695f476553 win-capture: Add logging for Force SDR checkbox 2023-02-19 11:40:32 -08:00
jpark37 7bf3015864 win-capture: Add Force SDR for DXGI duplicator
Also plumb support for wide SDR although DXGI chooses narrow anyway?
2023-02-19 11:40:32 -08:00
PatTheMav 8c8a44b26a mac-virtualcam: Fix compiler warnings
CMake build framework 3.0 introduces more strict typing checks, which
require additional code fixes to silence.

* Fixes warnings about implicit casts
* Fixes warnings about weak references used multiple times inside
  blocks
2023-02-18 15:22:33 -08:00
PatTheMav f98c2d2514 mac-capture: Fix compiler warnings
CMake build framework 3.0 introduces more strict typing checks, which
require additional code fixes to silence.

* Fixes warnings about multi-character assignments
* Fixes warnings about implicit casts
* Fixes warnings about shadowing variables
2023-02-18 15:22:33 -08:00
PatTheMav c5bb6218b6 mac-avcapture: Fix compiler warnings
CMake build framework 3.0 introduces more strict typing checks, which
require additional code fixes to silence.

* Fixes warnings about multi-character assignments
* Fixes warnings about implicit casts
2023-02-18 15:22:33 -08:00
PatTheMav 1bb06a8bdc rtmp-services: Fix missing newline at the end of files 2023-02-18 15:22:33 -08:00
PatTheMav f67c1bcceb obs-x264: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
PatTheMav f4bbe080bf obs-vst: Fix missing newlines at the end of files 2023-02-18 15:22:33 -08:00
PatTheMav bb2a99cec8 obs-transitions: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
PatTheMav 3175e699ea obs-filters: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
PatTheMav 19c131c981 obs-ffmpeg: Remove unused variables 2023-02-18 15:22:33 -08:00
PatTheMav 6e0d802874 obs-ffmpeg: Fix non-exhaustive switch statements 2023-02-18 15:22:33 -08:00
PatTheMav c4d60f47c7 decklink: Add missing newlines at the end of files 2023-02-18 15:22:33 -08:00
PatTheMav ce9854a11b aja: Remove unused variables 2023-02-18 15:22:33 -08:00
pkv e355a32066 obs-ffmpeg: Relax 'lookahead' constraint when bitrate is updated
When bitrate is updated, a check against 'lookahead' setting is done.
If 'lookahead' is enabled, the bitrate update is disabled.
We indeed used to observe crashes with nvenc when frequent bitrate
resettings were effected while lookahead option was enabled.
But recent tests have shown that the issue is gone.
As a result this commit allows 'lookahead' with bitrate live update.

Signed-off-by: pkv <pkv@obsproject.com>
2023-02-17 15:41:43 -05:00
Lukáš Cezner 5d1f0efc43 vlc-video: Fix videos larger than 1080p being squished
Fix an overflow in display_width caused by unsafe multiplication of the
video width by Sample Aspect Ratio.
2023-02-17 14:59:08 -05:00
Richard Stanway e280fd6cd0 obs-ffmpeg: Add GeForce MX350 variant to unsupported NVENC list 2023-02-17 11:19:08 -05:00
Richard Stanway 25f01357e6 obs-ffmpeg: Handle NV_ENC_ERR_NO_ENCODE_DEVICE error 2023-02-17 11:19:08 -05:00
Richard Stanway 7dae8d307c obs-ffmpeg: Restore bad GPU index NVENC error message
FFmpeg wipes priv_data if the encoder fails to start, so we need some
way of knowing if the GPU index was non-zero. This is a bit ugly but the
best way to do it for now.
2023-02-17 11:19:08 -05:00
Richard Stanway e593335086 obs-ffmpeg: NVENC error logging improvements
This writes the result of nvEncGetLastErrorString to the last encoder
error instead of just the log file. This makes it user-visible, which
should help users diagnose and solve the problem.

Also strips off leading colons from NVENC error strings as these can
look odd given our format string. An example of such an error:

::NV_ENC_TWO_PASS_FULL_RESOLUTION is only supported multipass encoding
on this architecture.
2023-02-17 11:19:08 -05:00
univrsal cddf69d69f linux-jack: Prepend devices with "OBS Studio: "
This makes it more clear that the device belongs to OBS.
Fixes #7988
2023-02-16 15:17:11 -03:00
Richard Stanway 0121533e3e win-capture: Convert monitor name to UTF-8 for display
Also increase the buffer size to account for potential wide characters
consuming many bytes.
2023-02-15 15:36:13 -05:00
Jan Beich 0a257a71e8 plugins: Enable linux-pipewire on FreeBSD 2023-02-15 14:44:36 -05:00
Jan Beich e98c9fbd65 linux-pipewire: Drop unused Linux-only header
<dma-buf.h> provides DMA_BUF_IOCTL_* which were never used by OBS.
2023-02-15 14:44:36 -05:00
Paul Hindt 003241511c aja: Add audio channel selection to capture
Adapted audio repacker for 32-bit samples,

with an ifdef to use SIMD or C version.
2023-02-15 10:38:39 -05:00
练亮斌 b5b3563479 vlc-video: Support subtitle track up to 1000 2023-02-15 10:05:28 -05:00
Georges Basile Stavracas Neto be629b93ce linux-pipewire: Demote error to debug message
Receiving buffers flagged as corrupted, or empty, is a casualty of
how things are implemented in various compositors, and it's not
a critical situation to be afraid of. We can expect a few buffers
to be flagged as corrupted here and there, and that's fine.

Demote these warnings to debug messages, as they're still useful
for debugging.
2023-02-14 18:50:57 -03:00
Roman Huts c5a06d3cf2 obs-ffmpeg: Update AMF SDK to v1.4.29 2023-02-13 14:38:18 -05:00
Georges Basile Stavracas Neto fad7420198 linux-pipewire: Trivially shuffle some code around
A trivial cosmetic change. This groups the constructor and
destructor together. Two sides of the same coin, yin and yang,
bound by their nature, and linked by their position in code.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto f8a7b13cd3 linux-pipewire: Rename obs_pipewire_data to obs_pipewire
Next commits will introduce new obs_pipewire_* types, so this
renaming will make it slightly easier to read the code with
different types.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto b7daa89f85 linux-pipewire: Split initialization of core and streams
This commit introduces an important distinction in the initialization
process that is essential to future camera and audio work: it splits
creating and connecting to the PipeWire socket, from connecting to
specific PipeWire nodes.

Right now, for the only consumer in existence - the ScreenCast portal
code - this distinction is irrelevant, but from an API perspective it
just makes sense to model it this way.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto 5065e86bb9 linux-pipewire: Remove unnecessary struct field
We don't actually need to restore the node id anymore, since this
is handled by the screencast-portal.c code now.

Remove the pipewire_node field, and just create the stream directly
from the passed file descriptor now.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto 890ca94b0b linux-pipewire: Inline play_pipewire_stream()
This separation of obs_pipewire_create() and play_pipewire_stream()
was an artifact of how the original code was written, and there is
no reason to keep this separation anymore. Inlining it will help
future commits too.
2023-02-13 12:28:09 -03:00
columbarius 86be35ae99 linux-pipewire: Move stream properties to constructors
And let each portal pass the stream properties relevant to them.
This makes the pipewire.c more independent of the actual portal
by providing a wrapper to create a stream. This will be relevant
later, when linux-pipewire introduces more portals like the Camera
one.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto 874c30cb88 linux-pipewire: Cleanup D-Bus proxy on unload
When the linux-pipewire plugin is unloaded, make sure to cleanup
the D-Bus proxy for the ScreenCast portal too. This effectively
doesn't change anything, but it's always good to keep up with the
code hygiene.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto b8cfe1aab1 linux-pipewire: Return actual type in obs_pipewire_create
Instead of returning an opaque void* pointer, return the leaf
C type obs_pipewire_data*.

This commit introduces no functional changes.
2023-02-13 12:28:09 -03:00
Service Checker 5b370d4e3a rtmp-services: Remove defunct servers/services 2023-02-13 02:20:50 +01:00
gxalpha 67e6b8649a mac-videotoolbox: Load encoders from system asynchronously
Copying the encoder list takes a while which blocks the main thread.
Doing the copying asynchronously removes instead of blocking the main
thread improves startup performance by about 60ms.
2023-02-12 17:38:21 +01:00
Exeldro 3840f92777 win-dshow: Fix virtualcam output a default video format 2023-02-11 16:21:49 -08:00
bin d831e9403f obs-vst: Read plugins in symlink 2023-02-11 15:50:29 -08:00
bin 228a170361 obs-filters: Fix preset properties refresh 2023-02-11 15:14:00 -08:00
pkv ad3df88fe3 obs-ffmpeg: Fix encoding of 2.1 with FFmpeg aac encoder
The aac spec has a list of default channel layouts that are implemented
by all aac encoders / decoders.
Unfortunately 2.1 is not in that list. When I wrote the surround sound
support into OBS, as a workaround I decided to encode 2.1 as
AV_CH_LAYOUT_SURROUND = FL+FR+FC.
The LFE channel is encoded as a regular audio channel which uses more
bits but this allows compatibility with all aac decoders.
Recently we updated to the new channel layout API of FFmpeg, but the
mapping of 2.1 to AV_CH_LAYOUT_SURROUND was forgotten in the FFmpeg
native aac encoder. This is remedied here.

Signed-off-by: pkv <pkv@obsproject.com>
2023-02-11 15:06:47 -08:00
jpark37 6734167bf1 win-capture: Log display ids 2023-02-11 15:05:28 -08:00
tt2468 b2375a0660 obs-ffmpeg: Initialize SRT stats object before requesting stats
The `srt_bstats()` function is not guaranteed to zero the stats object
before filling in stats. If a socket was connected, then disconnected,
without any data being sent over it, the stats object would remain
uninitialized, and weird results could occur.
2023-02-08 11:13:41 -08:00
Jim 4488202247 obs-ffmpeg: Remove unused variables 2023-02-05 02:55:24 -08:00
jpark37 148122f5aa graphics-hook: Stop trying to connect early
It never works, and leaves a confusing message behind.
2023-02-04 15:44:16 -08:00
R1CH c36583d794 obs-filters: Ensure gain is positive for upward compressor
The gain should be positive for an upward compressor. Initially, the
gain would be zeroe'd below -60 dB to ensure noise is not amplified by
the upward compressor. This created a discontinuity at -60 dB since
just above -60 dB, the audio is boosted by +20 dB (at default
settings). This was fixed in commit 50db097 which decreased smoothly
the gain so that it's 0 dB at -60 dB. However that commit forgot to
limit the gain decrease which was negative below -60 dB.
This is fixed by the current commit.
Additionally initialization allowed -inf gain. We hard limit to positive
gains only as they should be for an upward compressor.
The bugfix was found by R1ch and put in form by pkv.

Co-authored-by: pkv <pkv@obsproject.com>
Signed-off-by: pkv <pkv@obsproject.com>
2023-02-04 02:05:46 -08:00
Crocodile Gena a96211a0ee obs-vst: Add reporting of vendor name 2023-01-28 23:07:48 -08:00
Norihiro Kamae e7c40a1d29 obs-ffmpeg: Remove unused macro 2023-01-28 19:03:55 -08:00
Norihiro Kamae 72e7437ce9 win-capture: Remove unused macros 2023-01-28 19:03:55 -08:00
Norihiro Kamae a4a85af787 obs-text: Remove unused macros 2023-01-28 19:03:55 -08:00
Norihiro Kamae d89ca58467 obs-outputs: Remove unused macro 2023-01-28 19:03:55 -08:00
Norihiro Kamae 1069d81019 obs-filters: Remove unused macro 2023-01-28 19:03:55 -08:00
Norihiro Kamae be2e082961 mac-capture: Remove unused macros 2023-01-28 19:03:55 -08:00
Richard Stanway 668775f4f0
obs-ffmpeg: Use gai_strerrorA for error logging on Windows
Avoids wide characters in the format string which cause truncation.
2023-01-27 23:41:07 +01:00
Richard Stanway 062cfcf63d
obs-filters: Fix wrong number of arguments to error macro 2023-01-27 23:21:41 +01:00
Richard Stanway 9b1f7d6d21 virtualcam-module: Update filter size immediately when used in OBS
Fixes a crash due to the previous output size being used when scaling
the frame.
2023-01-27 13:03:22 -08:00
pkv 10e6d0fbd0 obs-filters: Improve upward compressor with soft knee
This adds a knee setting to the upward compressor.

Signed-off-by: pkv <pkv@obsproject.com>
2023-01-26 23:23:45 -08:00
Norihiro Kamae 50db09760c obs-filters: Make continuous gain on upward compressor
The upward compressor has a -60 dB threshold to stop increasing the
gain. At the threshold, the gain was not continuous, which is not ideal.

Co-authored-by: pkv <pkv@obsproject.com>
Signed-off-by: pkv <pkv@obsproject.com>
2023-01-26 23:23:45 -08:00
pkv f625bb579f obs-filters: Fix expander and upward compressor above threshold
Fixes behaviours above threshold for expander and upward compressor.
Fixes issues #8052 & #8030 .

Signed-off-by: pkv <pkv@obsproject.com>
2023-01-26 23:23:45 -08:00
columbarius e0a4d8628d linux-pipewire: Reject invalid buffers
PipeWire supports two flags to signal an invalid buffer:
SPA_META_HEADER_FLAG_CORRUPTED signals that the whole buffer is invalid
and should not be used
SPA_CHUNK_FLAG_CORRUPTED signals that one single buffer plane is invalid

Skipping a buffer because of size 0 was moved to only the SHM case.
For DMA-BUFs the size of a single plane is not relevant and should be
ignored [1].

Compatibility note:
GNOME pre 43 sets the chunk size to 0 when a buffer copy failed.
Luckily GNOME doesn't use the META_Header and thus we can detect if we
should use the new or old style of invalid buffer detection.
This workaround should be dropped when reasonable.

[1] https://docs.pipewire.org/page_dma_buf.html
2023-01-26 21:40:05 -03:00
tytan652 ee144377dc cmake,obs-ffmpeg: Refactor Libva finder
This refactor adds Libva DRM, required for obs-ffmpeg
2023-01-25 13:14:41 -05:00
jpark37 0b30ff1deb win-capture: Support EnumDisplayDevices failure
Seeing EnumDisplayDevices fail in the wild, so use GetMonitorInfo name
when the persistent name is unavailable.
2023-01-25 10:44:10 -05:00
jpark37 3462ea3fda obs-ffmpeg: Tell FFmpeg that BGRA uses alpha
Prevents alpha from getting dropped with custom encoders.
2023-01-24 18:39:12 -08:00
Richard Stanway 5a4283816d obs-filters: Improve NVIDIA effects SDK version checks
- Don't repeatedly query version at runtime in case a user installs the
  SDK while OBS is running
- Restore default DLL search directory
- Don't show outdated SDK message if the SDK is not found
- Protect minimum version macro with brackets
2023-01-24 12:53:15 -05:00
tytan652 323d2f60da obs-outputs: Calm some warnings if FTL on Clang and GCC
-Wenum-conversion is only available with GCC from the version 10.
2023-01-19 13:08:46 -05:00
tytan652 1007a0cf42 linux-capture: Fix format-overflow warning 2023-01-19 13:08:46 -05:00
tytan652 77a174ddac aja,aja-output-ui: Calm deprecation warnings on Clang and GCC 2023-01-19 13:08:46 -05:00
tytan652 c648222332 libobs,libobs-opengl,obs-ffmpeg-mux: Calm deprecation warnings on *nix
Calm libobs-opengl deprecation warnings on macOS.

Calm FFmpeg deprecation warning with LIBAVFORMAT_VERSION_MAJOR < 59.
2023-01-19 13:08:46 -05:00
tytan652 2f11151056 obs-filters: Disable RNNoise warning on Clang 2023-01-19 13:08:46 -05:00
tytan652 d473c9416f obs-ffmpeg: Fix compilation warnings on Clang and GCC
- Fix format warnings
- Fix unused-parameter warnings
2023-01-19 13:08:46 -05:00
tytan652 ba92da8d74 aja: Fix compilation warnings on Clang and GCC
- Fix format warning
  On Linux uint64_t is a unsigned long and on macOS it is
  a unsigned long long.
- Fix macro-redefine warning on macOS
2023-01-19 13:08:46 -05:00
tytan652 e4f004cdf8 mac-syphon: Fix unused parameter warning 2023-01-19 13:08:46 -05:00
tytan652 e58a2d49e0 obs-filters: Fix unused parameter warnings 2023-01-19 13:08:46 -05:00
tytan652 2839837ed6 plugins: Fix -Wsign-compare on Linux 2023-01-19 13:08:46 -05:00
tytan652 b0c1c9c86c libobs,plugins: Remove individual -Wno-switch 2023-01-19 13:08:46 -05:00
PatTheMav 447adfbe38 mac-virtualcam: Fix memory access issues for shared IOSurfaces
The DAL plugin-based virtualcamera shares data between OBS and the
plugin using an IOSurface. IOSurface locks are necessary to ensure
race conditions between data generation (OBS side) and consumption
(virtual camera side) and also that an IOSurface is not offloaded to
GPU memory when it is indeed needed in CPU memory.

Also moves the invalidation of the NSMachPort for the frames to after
the IOSurface data has been converted into a pixelbuffer and added to
the frame queue of the virtual camera, as an early invalidation will
cut off access to the pixel data shared with the DAL plugin.
2023-01-16 12:16:16 -05:00
tytan652 107b2a8f27 libobs-d3d11,libobs-opengl,plugins: Remove unneeded cast in switches
Those casts were usually used to workaround switch warnings.
2023-01-16 11:52:26 +01:00
tytan652 cf5c68b773 UI,libobs,libobs-opengl,obs-ffmpeg: Remove unneeded cast in switches
Those casts were usually used to workaround switch warnings.

Also adds default to OBS frontend event switches that had this
workaround.
2023-01-16 11:52:26 +01:00
tytan652 7de0bd350f libobs,plugins: Remove one-case switches 2023-01-16 11:43:47 +01:00
jpark37 22ea8f4e1f libobs-winrt,win-capture: Add Force SDR for WGC display
Leverage existing window capture support for display capture.
2023-01-14 15:49:43 -08:00
jpark37 fb58f60ae4 win-capture: Show Force SDR setting on Windows 10
Was using wrong bool for visibility.
2023-01-14 15:49:43 -08:00
Richard Stanway bf00ef1ea3 obs-outputs: Improvements to Windows interface logging
Now uses GetIfEntry2 which supports 64-bit values for reporting speed, so
10+ gbps adapters are now reported correctly in the log. Also added an
additional log line if the interface error counters are non-zero to possibly
help identify physical faults. Finally the transmit and receive speeds are
logged independently so that asynchronous mediums such as Wi-Fi that might
have good RX but poor TX can be better diagnosed.
2023-01-14 15:48:43 -08:00
Chris (Flaeri) 1166e504bb obs-ffmpeg: Remove forced x264 and aac for RTMP
Remove code forcing x264 and ffmpeg aac encoder. People using custom
ffmpeg output should be able to use other video and audio encoders when
streaming with RTMP, given its h264 or aac.
2023-01-13 09:42:41 -08:00
kevin.dww 321776efa3 rtmp-services: update Mildom servers 2023-01-13 00:30:32 -08:00
pkv ace518804b obs-filters: disable NVIDIA FX audio model loading when SDK is not installed
This fixes a bug reported by R1ch internally.
If someone uses NVIDIA noise suppression filter and later uninstalls
the SDK, there can be a crash because the filter tries to load the
models.

Signed-off-by: pkv <pkv@obsproject.com>
2023-01-10 13:32:29 -08:00
Translation Updater 783bd52197 Update translations from Crowdin 2023-01-08 04:10:37 +00:00
columbarius d8b7906954 linux-pipewire: Check format availablity against DRM only for dmabufs
Whe using a software renderer there will be no formats available for
using with dmabufs. We should only consider those formats wrt. to
modifiers and as such move this check after adding general support for
that format.

fixes #7985
2023-01-07 15:42:34 -08:00
Richard Stanway b51773b97b rtmp-services: Specify RTMP_SERVICES_FORMAT_VERSION in package.json 2023-01-06 21:16:21 +01:00
Richard Stanway 20d4bab77a win-capture: Always reset timeout when searching for target display
If the display wasn't found, the timer was not reset, causing the code
to execute on every single tick, stalling the graphics thread and using
excessive CPU.
2023-01-04 23:20:41 -08:00
pkv 85b714706c obs-filters: Log NVIDIA Effects version only if lib is found
Put the version logging behind a condition of having found a library.

Signed-off-by: pkv <pkv@obsproject.com>
2023-01-03 16:51:39 -05:00
jp9000 122e864c38 obs-ffmpeg, obs-qsv11: Ensure adapter order in encoder tests
On systems with multiple graphics adapters, one card can be configured
as power saving, and another card can be configured as performance.
Sometimes, OBS and the encoder test subprocesses will not be configured
the same way, so it's necessary to provide adapter order to the encoder
test subprocesses.

This change ensures the adapter order by passing the LUIDs to the test
subprocesses. The adapter indexes will then be updated accordingly.
2022-12-19 12:17:30 -08:00
jp9000 2396c4a01c obs-ffmpeg: Remove EnumOutputs from encoder tests
This call will fail on multi-adapter systems, and isn't used anyway, so
just remove it. Not sure why it was called in the first place; pretty
sure it was unintended and was likely just copied over from the D3D11
subsystem code.
2022-12-19 12:03:01 -08:00
Service Checker 626dbd3c3d rtmp-services: Remove defunct servers/services 2022-12-12 01:28:41 +01:00
jpark37 b7b7f0ae88 obs-ffmpeg: Set chroma location for VA-API 2022-12-11 14:12:36 -08:00
jpark37 2a816c5fa7 obs-qsv11: Put mastering primaries in GBR order 2022-12-10 21:53:04 -08:00
jpark37 0fc3cb1962 mac-videotoolbox: Add HDR metadata 2022-12-10 21:43:50 -08:00
Jim c84fae52e8 obs-ffmpeg: Fix AMF default CQP value
Was 7 for some reason, was supposed to be 20
2022-12-10 19:03:15 -08:00
Roman Huts 4ba6b8b6ee obs-ffmpeg: Add new rate control method mappings for AVC/HEVC 2022-12-09 15:37:09 -08:00
pkv c15cd23fcb obs-filter: Fix upward compressor
This fixes a bug where the upward compressor would hard limit above the
threshold.
Also this changes detection to RMS instead of peak for the upward
compressor.
This sounds better than peak (tested on regular mike and a test tone).

Signed-off-by: pkv <pkv@obsproject.com>
2022-12-09 12:12:55 -08:00
Jim ddba05c36c obs-ffmpeg: Use enum for av1 encoders
Allows us to add rav1e later
2022-12-05 19:19:20 -08:00
Roman Huts ad407eccab obs-ffmpeg: Bump AMF version to v1.4.29 2022-12-03 15:39:38 -08:00
Roman Huts 72a2c3baaa obs-ffmpeg: Add new rate control methods for AMD AVC/HEVC 2022-12-03 15:39:38 -08:00