MatcherClosestFrameRateSelector updates best_match as a side effect of
visiting every VideoInfo instance, but CapsMatch uses std::any_of,
which will stop iterating prematurely on first match. This means that
the highest FPS is not selected.
This change switches to a for loop that doesn't exit early.
In the Twitch chat dock window, the "Moderation Tools" link in the chat
settings should not navigate the window to the new URL; it should pop up
the URL in the user's system browser instead.
According to nvidia's documentation using b-frames as reference results in
a slight quality improvement with no/negligible performance impact and is
recommended to be enabled by default when using multiple b-frames.
When window capture is not capturing a window, don't try to find the
window every frame. Instead, just check once per frame. The process of
finding a window has a lot of checks and requires a surprising amount of
processing.
Defers the update of the slideshow source until the user has pressed OK
or exited the properties dialog. This ensures images aren't reloaded
every time the user adjusts a setting.
Because the new NVENC implementation requires texture sharing, if the
user chooses to use a secondary GPU, fall back to the old implementation
instead.
Fixes the Profile Level problem with integrated AMD Vega GPUs.
(Jim: Also fixes an issue where the amf-test executable would not build)
Closesobsproject/obs-studio#1619
Adds a texture-based NVENC implementation which passes OBS NV12 output
textures directly to NVENC without downloading them off of the GPU,
increasing NVENC performance by a significant margin.
If NV12 textures are unavailable or the new encoder fails to initialize
for whatever reason, it will fall back to the FFmpeg NVENC
implementation safely.
Adds VBR rate control mode, adds a lookahead option, adds psycho visual
tuning option, removes level property (now always set to 'auto'),
removes "2pass" option (replaced by new "Max Quality" preset which uses
2pass by default), modifies a few defaults, and updates their locale
text.
This implements a blacklist of devices that ship with NVENC libraries,
but do not support NVENC, which would cause the plugin to mistakenly
think that NVENC was available when it was not. If these devices are
the only NVIDIA devices on the system, consider NVENC unavailable.
This is much more efficient than spawning an encoder on startup to see
if NVENC is available, which would incur a ~500 millisecond hit on
startup. Additionally, also much less crash-prone.
Operating systems don't report monitors from 0, so OBS shouldn't
either. This avoids user confusion when display capture doesn't work.
This does not change monitor count internally.
They now provide ingest URLs on demand in their panel.
The ones in our list point to random OVH IPs that are likely assigned to
new customers by now and refuse the connection on TCP port 1935.
The GDI+ based Text Source actually uses Premultiplied Alpha. The edges
of the fonts are therefore incorrectly blended, causing ugly artifacts
especially if bright text above a bright background is used. Here's an
image comparing the new text blending (left) to before (right):
![https://i.imgur.com/VhhkQcZ.png](https://i.imgur.com/VhhkQcZ.png)
Additionally, the game capture has the same problem, so premultiplied
alpha is used there as well now.
A bit of a hack, but this is one of the more common errors that users
are encountering, so showing useful information will help cut down on
the number of support issues.
Input buffer by default is set to 2MB - for some sources, for example streaming
RTSP input over UDP, this is not enough and causes significant playback issues
that are not present while playing back the same source under ffplay/mpv.
It looks like someone actually started working on this feature as there are
translated strings, properties and everything ready - only the control was
missing from the UI. This commit adds that control.
Currently, the range is set to 1-16MB, step 1MB. This is somewhat arbitrary,
so suggestions to tweak this range with more real-world use cases are welcome.
Allows the ability for services to specify alternate or old names that
they used to have in the json service list so they can safely be renamed
seamlessly and use the proper service settings. This way, if a user is
using an older service in their configuration, it can still detect which
service it's supposed to be using and apply those service-specific
settings for that user.
fdk-aac v2.0.0 (aacenc 4.0.0) changes the AACENC_InfoStruct:
the encoderDelay parameter is replaced by two, nDelay and
nDelayCore. This patch checks the lib version and adjust the parameter
accordingly.
Rather than inheriting the exact visuals from the window,
find whether the color buffer has alpha, find a config with
the necessary attributes for capture, and match its depth to
the depth of the window instead of the color buffer. Also,
cleanup glxpixmap texture binding before destroying the texture.
Update: Style conformancy changes
Previously toggled swapRedBlue every update regardless of settings being set, which resulted in
moving or resizing of windows causing undesired color-swapping behavior. Also now use more direct
method of comparing visualIDs without type-casting and base the glxpixmap attributes on texture
format being used rather than the bit-depth of the window.
The UI currently is dependent on browser source files being present,
when in actuality the files may not have been fetched (i.e. not fetching
submodules). This fixes that by using a macro to detect whether it's
available or not.
Closesobsproject/obs-studio#1490
Decklink cards accept 2, 8 or 16 audio channels.
If obs audio output is setup to n channels ( 8 >= n > 2), and the
decklink card captures n channels, one needs to squash the silent
channels (n+1, .., 8) or sampling issues occur.
This had been done on windows but is required also on macOs and linux.
The commit adds the fix for macOS and linux.
Some code factoring has also been done.
Closesobsproject/obs-studio#1350
Adds support for windows with alpha channels as well as swapping red
and blue when using GS_BGRX. glXFBConfig now attempts to inherit
its format from the captured window when possible.
Change log message
Allows inverting the polarity of the audio data, which can be useful for
ether purposefully canceling out audio or preventing audio cancellation.
Amends pull request obsproject/obs-studio#1404
Makes Visual C runtime libraries consistent across
Debug/MinSizeRel/Release/RelWithDebInfo, rather than just changing those
flags for RelWithDebInfo. Also adds /Zl for statically linked
libraries.
Closesobsproject/obs-studio#1421
(This also modifies the CI scripts accordingly)
It was difficult to build local obs-browser builds on macOS due to the
way the frameworks work and libraries are linked. This solves that
issue so that local builds of obs-browser should always work fine.
Some security layer libraries code path used by the rtmp output had a
not used variable and not used param on HMAC_finish macro that was
triggering warnings during compilation.
On 64bit systems, this check will always evaluate to false due to
SIZE_MAX type and triggers a compiler warning.
This both makes it clearer that its only needed on 32bit system and
clear the compiler warning.
Occasionally users accidentally select the following applications built
into Windows 10 using game capture, which cannot be captured.
This PR simply hides them from the game capture list.
The latter takes up 6 entries in the dropdown.
LockApp.exe - the lock screen which doesn't run in user space
WindowsInternal.ComposableShell.Experiences.TextInput.InputApp
* Hitbox/Smashcast NBG/VIE servers are unavailable
* Dailymotion seems to have removed public live streaming
* Watchpeoplecode removed their live streaming functionality
* All gameplank servers are unavailable
* Afreeca KR en-ko server is unavailable
* Afreeca TW servers are unavailable
* Afreeca JP servers are unavailable
Prevents services with special exception services from unintentionally
using the wrong server. There's no real reason to be doing this on
anything but Facebook at the moment anyway.
The browser source would always create the source on first start
regardless of whether "shutdown when not showing" was set or not and the
source wasn't visible. This fixes the issue by checking whether the
source is actually showing or not in that case.
"Auto" is sort of a special use-case for certain services
(Twitch/Mixer), and the code recently added in be8ddc06a would
unintentionally override it. This would for example cause the "Auto"
setting on Twitch to set the user to use an Asia server unintentionally
because "auto" is not in the json file.
- Allow user to change # of B frames. New Default -> 1
- Allow user to enable Content Adaptive Quantization (MBBRC) if CPU is Skylake or newer.
- Allow user to choose LA_CBR as a rate control.
- LA depth: New Default -> 15, only when LA rate control is used.
Re-fetch texture when cursor's either width or height changed.
When the cursor icon changed and the new one has the same width or height,
it may not recreate the texture and thus cause memory access violation.
If the user had a valid service selected, but the server that the user
originally was using is now (for whatever reason) no longer listed, the
rtmp-common service would still use that server rather than any of the
newer servers, and the user would have to physically go in to their
settings to reconfigure to get it to use that new server.
Instead, make sure that the server the user has selected exists within
the server list, and if it doesn't, use the first server in the list
instead by default.
This diff adds mbedTLS support to the obs-outputs plugin. PolarSSL and
mbedTLS have grown so different between 2015-or-so when libRTMP was
written, and now it's no longer feasible to just use the USE_POLARSSL
flag.
This commit adds a WITH_RTMPS tri-state CMake variable (auto/on/off),
set to "Auto" by default. "Auto" will use RTMPS if mbedTLS is found,
otherwise will disable RTMPS. "On" will make it require mbedTLS,
otherwise fails configuration, and "Off" disables RTMPS support
altogether.
Closesobsproject/obs-studio#1360
obs_audio_data* sent to compressor_filter_audio had audio->frames == 0.
The analyze_envelope was trying to access an array at index -1 in result
of that. Just return if no samples are provided.
This fixes Mantis issue: 1261
* Updated AMF SDK to 1.4.7.0.
* Fixed a crash in api::base if Direct3D 9 or Direct3D 11 was not found.
* Changed how the capability testing reports supported devices to the log file.
* Fixed the order that codec properties are applied. (Thanks to Qiang Wen, see commit c292f6de41f22a0521300e8ce0b74bbe5e4d0edf)
* Fixed a crash caused by very old drivers that predate H265 support.
Allow multiple QSV encoders, usefull for live + recorded parallel
sessions. The first QSV encoder will create a DirectX device and return
a handle / pointer. Any additional QSV encoder will use that same
pointer to the DirectX device. We keep track of the number of open
QSV encoders so that we wait to close the DirectX resources after all
encoders are closed.
Closesobsproject/obs-studio#1341
This adds a build-time option for disabling the SpeexDSP-based
Noise Suppression filter support in cases where users do not
wish to build it, but have the required library installed.
As of version 3, libvlc on macOS is linked against libvlccore
differently. Previously libvlccore was referred to via the @loader_path
macro, now @rpath is used. As such, dlopen is no longer able to find
libvlccore. Explicitly load libvlccore so that the symbols that
libvlc needs can be found.
Tested against VLC versions 2.2.8 and 3.0.3.
This reverts commit 958167c4f7.
This caused certain transcoders (specifically Twitch's transcoders) to
misinterpret the data and transcode the video incorrectly.
If the transition point was above or equal to 1.0, it would cause a
divide by 0 error a few lines down. This could cause audio data to
become corrupted with NAN audio data when mixing, which can cause
certain audio encoders (namely the FFmpeg AAC encoder) to fail.
It was possible for the transition point to be above or equal to 1.0 if
the stinger media file was no longer loadable for whatever reason.
Back in an older commit, the default YUV colorspace was changed to 601
in order to ensure correct playback in video players that ignore the
contents of the H264 header.
x264's "undef" is unfortunately not what players that don't ignore the
header expect for BT.601, resulting in incorrect colors when played
back. Setting it to "bt470bg", similar to what is specified in ffmpeg
outputs, remedies this issue.
We're expecting a variable with double precision. Since we don't read
the value of these doubles with a particular precision, it can often
lead to unpredictable results where the value set isn't the one
intended due to the loss of precision from float->double conversion.
When drawing cursor to window capture area - use actual resource width
and height instead of system metric values for icons. Fixes an issue
where under rare circumstances, certain cursors would not draw at the
correct size.
Closesobsproject/obs-studio#1284
Allows the ability to (optionally) synchronously create/update a
directshow device source rather than always asynchronously update the
device. This is useful if creating/destroying scenes/sources very
quickly, and helps minimize the risk of creating new directshow sources
that use the same device, yet may not activate because an existing
source may already exist. To use, set "synchronous_activate" to true in
its settings when updating or creating. Note that this setting will be
erased after it's used, and will not be saved to user settings, so it
must be set each time in order to be used.
Closesobsproject/obs-studio#1228
After you call av_frame_alloc(), ffmpeg expects you to fill in certain
fields on the frame, depending on whether it's an audio or video frame.
obs-ffmpeg did this in the two places where it allocates video frames,
but not where it allocates audio frames. On my system, using trunk
ffmpeg and the Opus codec, this causes OBS to crash while calling
avcodec_send_frame, ultimately because av_frame_copy fails due to
'dst->format < 0' (as 'format' stays at the default of -1), causing a
null pointer to be added to a buffer queue, which later gets
dereferenced.
Oddly, the fields in question can just be copied directly from
corresponding fields in the AVCodecContext, but I don't see any ffmpeg
API to automatically copy all relevant fields, and all the examples I've
seen do it by hand. So this patch does the same.
If the user selected the "default" device for audio capture on mac, it
would no longer be able to be switched to another device due to the
"default_device" variable being set.
In the vt_h264_video_info function, the format of the video to be encoded is
always being set to VIDEO_FORMAT_NV12, dispite the presence of code to set
the video format to VIDEO_FORMAT_I420 or VIDEO_FORMAT_I444. This commit fixes
that function to respect the video format choice of the user.
In addition, whilst testing this fix initially, I also discovered that the
4:4:4 colour format is not supported by the VideoToolbox H264 encoder.
Looking at the VideoToolbox code in ffmpeg as a reference, the ffmpeg code
errors out if a color format other than NV12 or I420 is set. Therefore, this
commit also logs a warning about I444 not being supported, and uses the NV12
default.
The fullrange variable is used to set appropriate video format information in
vt_h264_video_info. Set fullrange first so the video format data is correct in
all cases.
The cutoff hack was added many, many years ago as recommended by
Konverter. Since then, there has been much work on the AAC encoder, so
this hack should no longer be necessary.
The windows media foundation H264 encoders have been deprecated for over
a year, and microsoft's media foundation AAC encoder has had a continued
issue with occasional random audio glitches. The FFmpeg AAC encoder has
had recent development, and is more than sufficient to be able to handle
the task of encoding in terms of both quality and performance, so it's
better just to use the FFmpeg encoder from here on out.
As this plugin is no longer needed, for the next year or two it'll still
be compiled and included, but as a blank plugin that does nothing. The
reason why it's still being included as a blank no-operation plugin is
to overwrite older versions of the plugin. That way if a user installs
a newer OBS version over an older one, it won't load up the older win-mf
plugin where the encoders still were enabled.
This also fixes some rarely reported media foundation crashes that can
happen on startup.
Fixes an issue where align_pos could be smaller than
sizeof(struct shmem_data), potentially overwriting memory of the header.
References jp9000/obs-studio#1202
(This commit also modifies the obs-ffmpeg module)
The default channel layouts from aac spec are implemented in FFmpeg
native aac encoder as follows:
AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_SURROUND,
AV_CH_LAYOUT_4POINT0,
AV_CH_LAYOUT_5POINT0_BACK,
AV_CH_LAYOUT_5POINT1_BACK,
AV_CH_LAYOUT_7POINT1,
The correspondence of speaker layouts to AV_CH_LAYOUT from FFmpeg is
changed to reflect the previous table.
Although FFmpeg native aac encoder can now encode all the layouts listed
in avutil channel_layout.h (on master), there might be issues with older
FFmpeg binaries.
Note that 2.1 speaker layout will be encoded as AV_CH_LAYOUT_SURROUND
(FL FR FC) because it is not listed as the default layout for three
channels.
This just means some optimizations for LFE channel will not be used by
the encoder which will treat it as an SCE (single channel element).
Closesjp9000/obs-studio#1182
Adjusts the enc-amf submodule remote to the jp9000 fork, which tests AMF
support in a separate process before attempting to initialize AMF
in-process. Reduces the possibility of driver crashes caused by AMF
initialization.
The reason this code is being reverted/removed is because this code is a
risk to startup stability. This check will be added again in the
future, however this code needs to be executed from a secondary piped
process instead of directly in the process to reduce risk of
driver/hardware issues impacting program startup. The same needs to be
accomplished for the AMF plugin as well.
When using more than two channels, the channel map of pulse-audio is incorrect.
Add an API for getting a speaker map based on OBS speaker layout. Then use the
speaker map when connecting to a pulse-audio device, for both source and
monitor output.
This reverts commit 94b5982216.
Reverting this commit because it had some negative side effects, such as
adding 500 milliseconds to the startup time. NVENC detection should
really be done through its proper API, and not via creating an encoder
on startup.
There were cases where the channel format could be set to 7, which used
to be a valid format but now no longer is. If that format is set, just
use SPEAKERS_7POINT1 instead.
Makes it a bit more clear this option shouldn't be used unless you're on
SLI/crossfire.
In the future, something should be put in to the program that detects
laptops and warns on how to set up their adapter for efficient capture.
Closesjp9000/obs-studio#1138
This pull request changes the fallback sample format for pulse-audio
to from PA_SAMPLE_S16LE to PA_SAMPLE_FLOAT32LE.
The pulseaudio plugin can handle the following sample format:
* PA_SAMPlE_U8
* PA_SAMPLE_S16LE
* PA_SAMPLE_S32LE
* PA_SAMPLE_FLOAT32LE
When an audio device advertises itself as another format, the pulseaudio-plugin
will ask pulse audio to convert to the fallback sample format.
The fallback PA_SAMPLE_S16LE is not ideal when your audio interface advertises
as PA_SAMPLE_S24LE since the conversion will lose precision.
With PA_SAMPLE_FLOAT32LE there is no precision loss and it is also equals OBS's
internal format.