Commit graph

4265 commits

Author SHA1 Message Date
gxalpha ded9aba106 mac-videotoolbox: Remove encoder sorting 2023-06-03 13:48:47 -07:00
PatTheMav 2966c4030e libobs: Use static library for version string information
Switching to a static library that contains version information as
const char strings has multiple benefits:

* The version information provided externally via compiler definitions
  will fail compilation early if malformed
* An updated version string (which will happen with every commit) will
  not invalidate existing compilation units, because only the static
  library is affected by the change
* An update of the version change just requires a recompilation of the
  static library and a linker update
* An update of the version will _not_ infect the rest of the codebase
  (as it does currently, because everything includes obsconfig.h one
  way or another)
* Other modules which used the macro definition directly have been
  updated as much as possible to use the proper getter method from
  `libobs` instead (some Windows-specific modules use preprocessor
  string composition, the value has been added as a compiler definition
  directly in those cases)
* Because the impact of a version change due to a commit hash change
  is limited to the static library, ccache hit rates should be
  improved considerably
2023-05-27 16:48:24 -07:00
Norihiro Kamae 4fb2bc38de text-freetype2: Fix crash after reaching buffer size
The texbuf has a fixed size that won't expand. When a lot of multi-byte
characters has arrived, it overflow and src_glyph becomes NULL.
2023-05-27 16:28:48 -07:00
Vainock 177b3f5a0f linux-alsa: Make 2 strings translatable 2023-05-27 16:24:57 -07:00
gxalpha 2a4c8594a1 mac-virtualcam: Release pixel buffer pool for DAL as well
The pixel buffer pool is used to create pixel buffers with both the CMIO
extension and the DAL plugin. As such, it is created independent of
which camera type is used, and should be released independent of it as
well.
2023-05-27 17:37:11 +02:00
Richard Stanway 48a0e7822a
obs-outputs: Remove support for "RTMP Go Away" feature (#8959)
Meta have filed a patent application on the Go Away feature. This goes
against the spirit of free software and puts the use of this feature in
questionable legal status, so let's remove this code until the patent
situation is resolved.

This reverts commits a593fe6755 and
dada82fec1.
2023-05-26 13:55:48 -05:00
gxalpha 8151785c45 mac-virtualcam: Adjust admin privilege strings to use Apple terminology 2023-05-25 14:50:44 -04:00
gxalpha a874c19bef mac-virtualcam: Fix admin password locale string 2023-05-23 03:58:34 -07:00
CodeYan01 1d45881fcb obs-ffmpeg: Add option to disable settings logging
Allows plugins to disable the logging of settings every time the ffmpeg
source is updated, by passing "log_changes" as true in the settings.
2023-05-20 17:52:56 -07:00
Exeldro d9bb556c97 win-dshow: Set audio only active when there is audio 2023-05-20 17:21:40 -07:00
David Rosca 17cb966c62 obs-ffmpeg: Add FFmpeg Options for VA-API 2023-05-20 16:56:39 -07:00
PatTheMav fb9b5c829a mac-capture: Switch to UUID-based display management
Using UUIDs to store display references in obs-studio's settings file
allows us to "rediscover" devices even between restarts
(as CGDirectDisplayID changes between those) and select the same device.
2023-05-20 16:50:16 -07:00
tt2468 d314d4725d libobs, plugins: Deprecate obs_output_t functions with flag parameters
This deprecates the following functions, replacing them with new
versions:
- `obs_output_can_begin_data_capture()` - now `*capture2()`
- `obs_output_initialize_encoders()` - now `*encoders2()`
- `obs_output_begin_data_capture()` - now `*capture2()`

The flags parameter was initially designed to support audio-only or
video-only operation of an output which had the `OBS_OUTPUT_AV` flag,
however, full support for that was never implemented, and there are
likely fundamental issues with an implementation, mainly that most
outputs are programmed assuming that there will always be at least one
audio and one video track. This requires new flags specifying support
for optional audio/video, among other things.

An implementation to allow audio/video to be optional is best done
using the flag technique above, with audio/video enablement specified
by whether media (raw, `video_t/audio_t`) or encoder (`obs_encoder_t`)
objects are specified.

Since every implementation I could find always specifies `flags` as 0,
I was able to safely conclude that immediately removing the parameter's
functionality is safe to do.
2023-05-20 16:41:55 -07:00
gxalpha 47d6d7e943 mac-virtualcam: Omit enqueue result codes 2023-05-21 01:35:43 +02:00
Norihiro Kamae 1291461219 win-dshow: Remove obsolete translation
A commit f50aa5e01b added a translation ConfigureAudio but never used.
2023-05-20 16:35:05 -07:00
Norihiro Kamae 7a3486ba6d win-capture: Remove obsolete translation
A commit 80b4a65cd2 added a translation `Method.Auto` but the source
code uses `WindowCapture.Method.Auto` instead.
2023-05-20 16:35:05 -07:00
Norihiro Kamae 82ea5aaa48 obs-qsv11: Add missing translation 2023-05-20 16:35:05 -07:00
Norihiro Kamae e9b65d58bb obs-outputs: Add missing translations 2023-05-20 16:35:05 -07:00
Norihiro Kamae efa69ab0bd obs-filters: Remove obsolete translation in expander-filter
Expander.None was never used.
2023-05-20 16:35:05 -07:00
Norihiro Kamae 38b4cce99e obs-filters: Add missing translation in chroma-key-filter
A selection Custom for a property key_color_type was not translated.
Use the same translation key CustomColor as color-key-filter.
2023-05-20 16:35:05 -07:00
Norihiro Kamae d9c34eff8b obs-ffmpeg: Add missing translations
The name of the obs_output_t won't appear in usual operation but some
output types have the translation and others do not. Let's translate
them.
Also translate `FilePath` property name.
2023-05-20 16:35:05 -07:00
Norihiro Kamae abb92878f1 obs-ffmpeg: Add missing translations 2023-05-20 16:35:05 -07:00
Norihiro Kamae 4aaffe16ec obs-ffmpeg: Remove obsolete translations
A commit 4e140d2ff added AMF error messages but they were never used.
A commit 45d029b1f removed some code but a translation key "Advanced"
was left.
A commit 77fbfbe5c removed code to translate NVENC.TooManyBFrames but
the translation key was left.
A commit 6cc7cf3d5 removed the code to select codecs but the translation
was left.
2023-05-20 16:35:05 -07:00
Norihiro Kamae 9c7d535b13 mac-videotoolbox: Remove obsolete translation
A commit e461ec4be1 added a translation key "VTEncoder" but never used.
2023-05-20 16:35:05 -07:00
Norihiro Kamae fe626f444c mac-syphon: Remove obsolete translations
A commit f9cf458c1 removed syphon-inject but translations were left.
2023-05-20 16:35:05 -07:00
Norihiro Kamae 21144b7200 mac-avcapture: Add missing translation 2023-05-20 16:35:05 -07:00
Norihiro Kamae 05bc8c4ff1 linux-pulseaudio: Add missing translation 2023-05-20 16:35:05 -07:00
Norihiro Kamae 6815c09aba linux-capture: Remove obsolete translation
"LockX" was added by 15fb027647 and removed by later commit 1604400e4.
2023-05-20 16:35:05 -07:00
Norihiro Kamae 33f1f198fa linux-alsa: Add missing translations 2023-05-20 16:35:05 -07:00
Lain 106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
gxalpha 0cc7ea7a2a mac-videotoolbox: Fix incorrect keyframe interval calculation 2023-05-18 18:28:53 -04:00
PatTheMav 3f85e447a8 mac-virtualcam: Add Camera Extension to main CMake plugin project
Camera Extensions require specific entitlements for the hosting app,
which also require a provisioning profile. To avoid breaking local
builds that do not require the camera extension, an additional
entitlements file that will not trigger the provisioning profile
requirement will be used if the virtualcam (but not the Camera
Extension) is configured.
2023-05-18 14:41:08 -04:00
gxalpha aae2f7e8ff mac-virtualcam: Update obs-plugin to support macOS camera extensions
Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
2023-05-18 14:41:08 -04:00
gxalpha 5c6e471a56 mac-virtualcam: Add macOS camera extension project
Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
2023-05-18 14:41:08 -04:00
columbarius 155fb8ad8f linux-pipewire: Support colour format GS_R10G10B10A2
PipeWire supports 10bit colour formats with little endian order.

Adding two new formats required increasing the buffer size for building
PipeWire buffers.

This formats are supported since PipeWire 0.3.41. To allow building
against
older PipeWire versions we will hide those formats. Complications when
running on a host with an older PipeWire version are not expected, since
format negotiation is only done via the numerical values.
2023-05-17 16:35:43 -03:00
tytan652 6e887f8158 obs-ffmpeg,cmake: Replace external folder by obs-deps headers 2023-05-13 17:06:39 -07:00
PatTheMav f7ec81ca12 obs-outputs: Fix keychain API deprecation warnings on macOS 2023-05-13 16:59:42 -07:00
PatTheMav 585152c566 mac-capture: Add option to hide OBS windows in desktop capture 2023-05-13 16:55:11 -07:00
Florian Zwoch 8b816eba8e obs-ffmpeg: Fix compilation when ENABLE_HEVC is not set
When ENABLE_HEVC is not set the 'bool hevc' function parameter
is not being used in this function causing a warning and aborting
compilation.
2023-05-13 16:12:25 -07:00
gxalpha d63ed016b4 obs-websocket: Update submodule to pull translations 2023-05-07 11:11:12 -07:00
gxalpha be42d97315 mac-syphon: Remove macOS 10.15-only code
The minimum version of macOS for OBS is 11.0 now, so this can be removed
2023-05-06 16:24:20 -07:00
PatTheMav f20f788d0b mac-capture: Fix possible division by zero error
Possibility of `mChannelsPerFrame` being 0 is not properly covered by
current code, which will result in a division-by-zero error.
2023-05-06 16:15:30 -07:00
Richard Stanway ba0c273846 obs-ffmpeg: Show error if trying to use AV1 fallback 2023-05-05 15:58:13 -04:00
Jim 8dbc4761a3 linux-pipewire: Reduce debug message verbosity 2023-05-02 01:50:13 -07:00
Translation Updater a0fbdc3c34 Update translations from Crowdin 2023-05-01 23:11:13 +00:00
Ryan Foster c0adff2863 obs-qsv11: Set error message for QSV with P216/P416
If P216 or P416 color formats are selected with QSV, these color formats
were not explicitly handled, so the switch statements would end up in
the default case. If the user had also selected a Rec. 2100 color space,
this would result in the strange error message:
"OBS does not support 8-bit output of Rec. 2100."

This message is confusing and does not correctly reflect the chosen
settings. Let's explicitly handle the P216/P416 cases and provide a more
accurate error message.
2023-05-01 18:45:32 -04:00
Ryan Foster 877c1c74d0 obs-ffmpeg: Set error message for AMF with P216/P416
If P216 or P416 color formats are selected with AMF, these color formats
were not explicitly handled, so the switch statements would end up in
the default case. If the user had also selected a Rec. 2100 color space,
this would result in the strange error message:
"OBS does not support 8-bit output of Rec. 2100."

This message is confusing and does not correctly reflect the chosen
settings. Let's explicitly handle the P216/P416 cases and provide a more
accurate error message.
2023-05-01 18:45:32 -04:00
Ryan Foster 19cec08494 obs-ffmpeg: Set error message for NVENC with P216/P416
If P216 or P416 color formats are selected with NVENC, OBS will fall
back from the native implementation to the FFmpeg implementation. Here,
P216 and P416 were not explicitly handled, so the switch statements
would end up in the default case. If the user had also selected a Rec.
2100 color space, this would result in the strange error message:
"OBS does not support 8-bit output of Rec. 2100."

This message is confusing and does not correctly reflect the chosen
settings. Let's explicitly handle the P216/P416 cases and provide a more
accurate error message.
2023-05-01 18:45:32 -04:00
gxalpha 2ac3767e7a obs-x264: Disallow 16-bit color formats 2023-04-29 16:17:26 -07:00
gxalpha 1c15066cc4 mac-videotoolbox: Differentiate unsupported format and range errors 2023-04-29 16:15:42 -07:00
Service Checker dba6544265 rtmp-services: Remove defunct servers/services 2023-04-27 15:21:40 +02:00
Adam Taylor c25b81886d obs-filters: Add invert LUT 2023-04-24 12:35:47 -07:00
tytan652 ac241faff1 rtmp-services: Fix building with service updates disabled
Two constants are marked as -Wunused-variable which turns into an error
2023-04-24 12:04:11 -07:00
tytan652 15e0064179 rtmp-services: Enable service updates by default
Fix an oversight of 1f6cf34c2c

Which turns off by default service updates on any *nix
2023-04-24 12:02:57 -07:00
tt2468 1f6cf34c2c rtmp-services: Allow service updates to be disabled on *nix
Effectively reverts 8b315186a7, as the
cmake referenced in the description has long since been completely
rewritten and replaced.
2023-04-23 23:47:09 -07:00
jpark37 901986cbf4 libobs,obs-filters: Align HDR to SDR disparity
Adjust colors from BT.1886 to sRGB.
2023-04-23 23:43:09 -07:00
Kurt Kartaltepe f0f704249f linux-pipewire: Only consider chunks with size set
Compositors did not agree on how to communicate invalid buffers until
recently, so e0a4d8628d resulted in
regressions on KDE. This restores our old behavior which is too
conservative but mostly works on old and new compositors (which contain
similar workarounds to pass in invalid but non-zero sizes for dma-bufs).

Once all old compositors are out of use we can remove this workaround
and then compositors can remove their random size workaround.
2023-04-22 16:45:50 -07:00
tytan652 41cec5540c rtmp-services: Bump format version to v5 2023-04-22 16:17:40 -07:00
derrod 72759ae69d obs-outputs: Don't set DTS offset for enhanced FLV SEQ start/end packets
Sequence start and end packets never have a valid DTS, but with a
non-zero offset the timestamp in the packet would end up also being
non-zero, which leads to librtmp attempting to calculate a timestamp
delta and underflowing.

As a fix, simply remove the ability to even set a DTS offset for
start/end packets and always keep it at zero.
2023-04-17 17:42:15 -04:00
derrod 64f3070753 obs-outputs: Fix enhanced RTMP frame type not being set 2023-04-17 16:39:13 -04:00
PatTheMav ea60fc2869 mac-virtualcam: Fix DAL plugin entrypoint not being exported
With the recent change to enforce C17 standard for compilers, default
visibility was also enforced to be hidden. This also automatically hid
the `PlugInMain` symbol required for DAL plugins. Adding the
`__exported` decorator makes the symbol explicitly visible.
2023-04-15 16:51:18 -07:00
pkv dfac68b189 obs-outputs: Log encoder incompatible with dynamic bitrate
This logs that dynamic bitrate is disabled when a codec which does not
support bitrate reconfiguration is used, such as aom, svt-av1 ...

Signed-off-by: pkv <pkv@obsproject.com>
2023-04-15 16:33:33 -07:00
jpark37 5adcd51a68 decklink: Ignore "default" output device
obs_get_output_properties leads to a callback with an empty settings
object, so ignore it to avoid adding a dummy entry to the device list.
2023-04-09 11:53:12 -07:00
PatTheMav 158a2e10aa cmake: Skip plugin target setup when ENABLE_PLUGINS is not set 2023-04-08 16:33:18 -07:00
PatTheMav 8b186bac9b mac-avcapture: Fix questionable use of comma 2023-04-08 16:26:34 -07:00
PatTheMav 1172629492 rtmp-services: Remove macro-based constant usage
Macros make the code you see different from the code the compiler sees.
Modern C renders traditional uses of macros for constants and utility
functions unnecessary. Macros should only be used when there is no
other solution available.
2023-04-08 16:12:55 -07:00
derrod 3de564258d obs-outputs: Fix AV1 header parser adding ref count to data
The header packets are only used within the rtmp-output and do not need
or use the ref counter as the data is manually free'd directly.

The presence of this ref counter causes a crash on *nix platforms due to
our memory alignment hack attempting to free memory but reading the
wrong offset due to the ref counter being there rather than the
alignment offset.
2023-04-06 23:30:24 +02:00
derrod 3fed2e081e mac-videotoolbox: Enforce non-zero keyframe interval in CRF mode 2023-04-05 17:03:21 -07:00
derrod cf6adf84ab obs-ffmpeg: Fix iteration over sample formats 2023-04-05 21:53:23 +02:00
derrod ba38a7d9f4 obs-ffmpeg: Disable AMF texture encoder runtime reconfiguration 2023-04-05 10:18:20 -07:00
PatTheMav 43f12d1fbd mac-videotoolbox: Fix compile issue if HEVC is disabled
The format is only checked for 10-bit capable formats, which in this
case applies to HEVC only. When HEVC is disabled, then `format` is
not checked and becomes an unused variable otherwise.
2023-04-04 23:14:27 +02:00
nquah eca5c51df0 obs-outputs: Fix HEVC/RTMP composition time missing
Fixes bug in Enhanced RTMP implementation. Populates non-zero
HEVC composition times in the FLV extended video tag header.
2023-04-04 23:14:14 +02:00
Ryan Foster 13dc9a2b0d obs-websocket: Update version to 5.2.2
See 6ef055a369249f6d7b008914fe2bc360c96f23dc for changelog.
2023-04-04 15:30:14 -04:00
Ryan Foster 27f5c307c3 obs-browser: Update version to 2.21.1
ee2f309 - CI: Fix build errors with Xcode 14.3 and platform SDK 13.3
2023-04-04 15:28:36 -04:00
tt2468 bfbc189853 obs-ffmpeg: Use event for source reconnect thread
Fixes an issue where update/destroy of a media source during reconnect
would block the parent thread until the next reconnect attempt. This
would result in significant quantities of dropped frames, delayed OBS
shutdown, or frozen UI during this period.
2023-04-04 15:11:59 -04:00
PatTheMav ee3c2d0e8a CI: Fix build errors with Xcode 14.3 and platform SDK 13.3
Xcode 14.3 and the macOS 13.3 platform SDK introduced a few breaking
changes:

* Updated AppleClang emits warnings about unqualified std cast calls
  when using C++ - as `move` is too broad a word, developers are to use
  `std::move` to make this explicit. Alas this is exactly what `json11`
  uses and because that library is archived, there is no possibility
  of an upstream update.

* Apple guarded calls to old screen capture APIs as "available but
  deprecated", but seems to have chosen the wrong lower version
  boundary: The calls are flagged as being available for macOS 13 and
  macOS 14 only.

  To fix this, the existing macOS platform SDK header is replaced by a
  local copy that uses macOS 11 as the lower boundary (the oldest macOS
  version supported by obs-studio anyway)
2023-04-04 17:27:59 +00:00
PatTheMav 6e07b86729 cmake: Remove EXCLUDE_FROM_ALL directive from interface libraries 2023-04-04 17:27:54 +00:00
Ryan Foster a4f3eb7fcf obs-qsv11: Log selected codec 2023-04-04 00:48:03 +00:00
Ryan Foster a973b97036 obs-ffmpeg: Set framerate for AVCodecContext outputs
In avcodec.h, the docs for AVCodecContext->framerate say:
encoding: May be used to signal the framerate of CFR content to an
          encoder.

OBS is designed to always output Constant Frame Rate (CFR) content.
Instead of letting this be implied, let's explicitly set the framerate
per the docs.
2023-04-03 23:28:31 +00:00
derrod c2e66942d0 obs-ffmpeg: Allow specifying audio sample format 2023-04-03 23:37:22 +02:00
tt2468 d2902c1316 obs-ffmpeg: Compensate for invalid NVENC DTS when using b-frames
When using FFmpeg-based NVENC, with b-frames, and a non-1 framerate
numerator (eg. `1001/60000` aka 59.94fps), the DTS values outputted
by FFmpeg result in invalid DTS values.

Detect when using an unpatched FFmpeg build and correct the values
accordingly.
2023-04-03 16:42:31 -04:00
Matt Gajownik b620dd4c50 obs-ffmpeg: Don't use standard newlines in HTML error messages
Qt by default will render strings that contain new line characters as
plain text, bypassing the HTML renderer.
2023-04-02 04:09:54 +02:00
jpark37 b2a83a3145 decklink: Pass frames between threads using queues
Eliminates the stalls that have been seen when waiting for frame copies.

We shouldn't be copying at all ideally, but that would break the API.
2023-04-01 16:49:12 -07:00
Richard Stanway 0f614034ca obs-ffmpeg: Handle mux errors when writing replay buffer
Without this, we could continuously call signal_failure in write_packet,
crashing OBS with a stack overflow with all the error callbacks.
2023-04-01 16:21:37 -07:00
gxalpha eaf6444236 mac-capture: Simplify coreaudio_get_device_id
The current method would enum though all devices looking for a matching
uid instead of directly asking for kAudioHardwarePropertyDeviceForUID.
Asking directly instead would also enable finding hidden devices that
can only be found directly via uid and not via enumerating (were we ever
to need to find such a device).
2023-04-01 16:13:17 -07:00
Asahi Lina 584de6b264 linux-pipewire: Use premultiplied alpha
Pipewire desktop portal capture assumes premultiplied alpha, so make
sure to use the right blend equation to make translucent pixels work
correctly.

This is still broken for emissive pixels (alpha < color) since OBS seems
to unpremultiply at some point during blending, but it works properly
for translucent pixels (emissive pixel support requires an end-to-end
premultiplied pipeline).
2023-04-01 16:11:19 -07:00
jpark37 7a3beec87b decklink: Avoid swscale for color space
Any color space adjustments should be done on the GPU.
2023-04-01 16:08:54 -07:00
jpark37 e4a80d0396 decklink: Query for preroll frame count
Three is recommended though, so use at least that many.
2023-04-01 16:08:54 -07:00
Friedhelm Birth b3b5e7eae8 win-dshow: Change buffering for Elgato devices
The default is now buffering disabled except for very old devices
accessed through virtual capture filter "Elgato Game Capture HD".
2023-04-01 16:03:33 -07:00
Richard Stanway d71fa5248f obs-ffmpeg: Fix memory corruption during cleanup
We were calling avio_close on a field that might have held an
AVIOContext. This commit checks which type was allocated so we
can call the appropriate cleanup function.
2023-03-31 13:19:48 -04:00
derrod aea0867945 obs-outputs: Do not strip AV1 padding for RTMP/FLV 2023-03-29 16:53:33 -04:00
derrod d98abf8ce9 obs-ffmpeg: Enable padding for NVENC CBR modes 2023-03-29 16:53:33 -04:00
derrod 82c63db94b win-capture: Fix compat info showing in hotkey mode 2023-03-29 03:16:34 +02:00
jpark37 ac87106f03 decklink: Schedule video frames for playback
DisplayVideoFrameSync is unusable at 4K, over 20 milliseconds per call.
ScheduleVideoFrame is probably what we should have been using all along.
2023-03-28 11:19:43 -07:00
Ryan Foster ddb4f41d7d obs-websocket: Update version to 5.2.1
Fix macOS build failures.
2023-03-27 13:07:16 -04:00
Translation Updater 7c5560bf1b Update translations from Crowdin 2023-03-27 13:39:03 +00:00
Ryan Foster 5a2567a604 obs-websocket: Update version to 5.2.0
See 7ca8d5fc2b7738d5cf04a4bddbbae0468b8a150d for changelog.
2023-03-26 22:28:08 -04:00
Ryan Foster c1cc7fc6e7 obs-browser: Update version to 2.21.0
75b926d - Add Copy page address option to browser dock context menu
35226e9 - obs-browser: Update for CMake Framework 3.0
2023-03-26 22:28:08 -04:00
Ryan Foster 2cbbc28f86 enc-amf: Update to 2.8.0
Changes:
 * Fixes for stricter MSVC standards compliance
 * Modernization of CMake
2023-03-26 22:28:08 -04:00
derrod 678a98ace2 obs-outputs: Fix compilation without ENABLE_HEVC 2023-03-26 20:43:27 -04:00