It's not that uncommon for apps on Windows to use a hacky method of
extending their windows 1-2px past the supported monitor resolution
to preserve "true" windowed fullscreen and circumvent some exclusive
fullscreen-related issues presented by their graphics library,
Windows itself, or both.
Therefore, the fullscreen detection technique has been relaxed
to properly identify windows slightly larger than the monitor's
viewport as fullscreen.
Windows also does something similar, evident by the fact that
the taskbar disappears, as it always does for fullscreen windows,
even when a window stretches slightly beyond the defined viewport.
I discovered while testing that the first split would always be one GOP
too long (e.g. 1m2s instead of 1m) due to the fact that b-frames and
negative start DTSes were not accounted for.
This is now fixed by setting the start_time to the nonzero negative DTS
produced for the first packet. Additionally, a small tolerance of 1 ms
was also added to account for rounding issues present in the first GOP.
Originally, before file splitting was introduced, I made the choice to
simply ignore the last frame in the packet queue of the muxer, because
frame N+1 is required to properly determine the duration and I figured
nobody would notice if their recording is one frame short.
However, when using frame splitting this would result in the last frame
before the split being dropped. To fix this, we can simply reuse the
previous sample's duration for the final sample in a file. Since OBS
only does CFR, they should all be identical anyway.
This process mitigation flag is inherited by child processes and applies
to load-time DLL resolution, pushing the application's own directory
below the system directories. If there are system-installed copies of
dependent DLLs such as FFmpeg, those get loaded when OBS is updated as
the updater and subsequent relaunch of OBS inherit the mitigation.
As we use SetDefaultDllDirectories, this mitigation is less important,
the proper fix would be to use /DEPENDENTLOADFLAG to protect load-time
import resolution.
We suspect users hit errors updating the system-wide hook files even if
the file is not in use, but without logging we have no way to know for
sure. This commit adds additional logs. Not logging source paths
anywhere is intentional to avoid wide char to utf-8 issues making this
more complicated than it needs to be - the source will always be the OBS
install dir regardless.
The CUDA calls in AUDIO FX were added initially to big a bug on the SDK
side where the SDK functions where not checking the CUDA context.
This led to interference with the VIDEO FX, potentially breaking it.
These bugs have been fixed by the SDK so we don't need anymore these
CUDA calls.
Signed-off-by: pkv <pkv@obsproject.com>
Previously it was setting the `averageBitRate` value to what is being set in Variable Bitrate rate control mode. However, CQVBR is initialized with a value of `0` and instead Target Quality is being used. This adds a check for the CQVBR mode and if it's set will update the `targetQuality` value, otherwise it will update `averageBitRate`.
Additionally reset `averageBitRate` to 0 if CQVBR is active, and reset `targetQuality` to 0 if it's not in any VBR mode
Frontend plugins should not require being placed in the frontend
directory to be built successfully. Indeed they should only depend
on libobs and the obs-frontend-api and thus their source tree should
be able to exist anywhere (even standalone) and the plugin should still
compile successfully (just like any 3rd party plugin).
Thus moving those plugins into the main plugin directory ensures that
they don't require on any "special sauce" within the source tree to
compile.
Use the new `OBS_ENCODER_CAP_MULTITRACK_DYN_BITRATE` flag when
streaming with multiple tracks, instead of relying on the single-
track `OBS_ENCODER_CAP_DYN_BITRATE` flag. In multitrack cases where
multiple codecs are being used (e.g. mixed AVC and HEVC), all encoders
must support the multitrack capability flag otherwise the dynamic
bitrate (DBR) feature is disabled for the streaming session.
The `amf_xxx_update()` functions for AVC, HEVC, and AV1 are
unconditionally invoking Flush() and ReInit() even though this is not
required in all situations. Changing the bitrate at least in CBR mode
does not require the flush operation and can result in unaligned IDR
frames across members of an encoder group. Do not flush the pipeline
for CBR bitrate changes; instead, force an IDR to occur with the
bitrate change.
Replaced implicit type conversion within macOS plugins (mac-capture,
mac-syphon, mac-videotoolbox, mac-virtualcam) with explicit type
conversions to clear compile errors with Apple Clang 21.0 and Xcode
26.4.
Co-authored-by: PatTheMav <patthemav+github@gmail.com>
Co-authored-by: jcm <6864788+jcm93@users.noreply.github.com>
CreateFileW returns INVALID_HANDLE_VALUE on failure, not NULL.
The previous check would always evaluate to true on failure,
causing ReadFile and CloseHandle to be called on an invalid
handle.
Previously, the Image Slide Show source skipped *.webp files when
adding images via 'Add Directory'. This update ensures that .webp
files are now correctly included.
The NVENC session was destroyed before its child resources
(textures, surfaces) were cleaned up, causing resource cleanup
calls to operate on an invalid session handle.
Reorder destruction to free all registered resources before
destroying the encoder session.
Reverts much of PR #11906 in favor of a different way to detect whether
or not the output capabilities must be reset.
The new approach will contain false positives for which the workaround
is not needed but it won't have negative side effects.
When a new device is selected, a best-possible frame rate is chosen
for the initial configuration of the device. This has to be set in the
source settings, as those are the "source of truth" for the properties
and the device configuration.
The object has to be created explicitly first before setting the
frame rate value. The source then has to be updated explicitly as well
to ensure that the change will be picked up by the next iteration
of the render thread to "tick" the source and thus make it configure
a capture session with the fallback framerate set.