0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

320 Commits

Author SHA1 Message Date
Norihiro Kamae
d89ca58467 obs-outputs: Remove unused macro 2023-01-28 19:03:55 -08: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
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
Translation Updater
783bd52197 Update translations from Crowdin 2023-01-08 04:10:37 +00:00
Jim
301730f40c obs-outputs: Shorten dynamic bitrate increment timeout
The dynamic increment timeout does not need to be 30 seconds. Change it
to 4 seconds instead to make dynamic bitrate something that people
actually want to use.
2022-11-15 09:37:45 -08:00
Richard Stanway
63c3299a9f
obs-outputs: Increase librtmp send timeout to 15 seconds
Based on what we're seeing after the release of OBS 28, six seconds is
too low and causes disconnects instead of dropped frames.
2022-11-11 20:53:10 +01:00
PatTheMav
5913be9198
obs-outputs: Fix snprintf calls with literals as buffer sizes 2022-11-11 19:51:28 +01:00
PatTheMav
bf692d816e
obs-outputs: Replace invocations of sprintf with snprintf
Fixes deprecation warnings in Xcode 14/clang on macOS and reduces
chance of buffer overflows.
2022-11-11 19:51:27 +01:00
Translation Updater
f065f20ce1 Update translations from Crowdin 2022-10-25 22:32:14 +00:00
Georges Basile Stavracas Neto
fb51f8b224 obs-outputs: Drop unused config file
The obs-outputs-config.h.in file is not actually used. It only
defines the FTL_FOUND variable, but the build system takes care
of that by setting a compiler argument for that.

Drop that file.
2022-09-17 16:38:50 -07:00
Translation Updater
cc2d0791ca Update translations from Crowdin 2022-08-30 09:00:44 +00:00
Translation Updater
4aaa07f93d Update translations from Crowdin 2022-08-17 04:22:50 +00:00
Translation Updater
81734be37c Update translations from Crowdin 2022-07-31 23:40:53 +00:00
tt2468
70f33f7794 obs-outputs: Improve librtmp timeouts on Linux
Replaces the usage of SO_SNDTIMEO with TCP_USER_TIMEOUT on Linux.
- Noted as more effective than SO_SNDTIMEO by multiple sources.
- Drops TCP connection on timeout instead of returning send() errors,
meaning more predictable reconnect timing and reconnect.
- Timeout period actually reflected in practice. SO_SNDTIMEO takes
double the timeout time than actually requested to time out on
unix, whereas WinSock actually waits the specified time.
2022-07-23 17:24:11 -07:00
Ryan Foster
614ff22e8d obs-outputs: Fix TLS_client init for mbedTLS 3.1.0+
When trying to update to mbedTLS 3.2.1, I ran into failures with RTMPS
output. After consulting an mbedTLS implementation example, I determined
that we were not setting up the SSL/TLS context config in the correct
order, causing the connection to fail. Performing the setup in the
recommended order fixes that.
2022-07-23 16:40:59 -07:00
Vainock
eb06594381 Use property suffixes for units everywhere 2022-07-22 08:24:51 -04:00
jpark37
cb5f718d1d obs-outputs: Suppress LNK4098
defaultlib 'MSVCRT' conflicts with use of other libs; use
/NODEFAULTLIB:library
2022-07-18 03:52:04 -07:00
jpark37
df96e68ca6 cmake: Disable LNK4099 warning
We are very unlikely to ship PDBs for deps.
2022-07-11 22:07:10 -07:00
tt2468
97756861b4 obs-outputs: Rework RTMP context init/deinit
This commit fixes what is arguably a long-winded series of previous
commits that have possibly caused just as many problems as they have
fixed. I'll spare the details, but basically, there's no reason that
any of the RTMP object should ever be used across socket sessions.

This provides a slight enhancement by removing the `RTMP_Init` call
in `rtmp_stream_create()`, since it effectively just initializes TLS
just for `try_connect` to deinitialize it before it is even used.

This also fixes the current `SO_RCVTIMEO` timeout functionality by
making sure that `RTMP_Reset` is called last.
2022-07-09 17:04:37 -07:00
Richard Stanway
17c39ccb07 obs-ffmpeg, obs-outputs: Check return of obs_encoder_get_extra_data
A race condition can occur in obs-outputs where the send_thread is in
the process of (re)connecting but the encoder was shut down in the
meantime. This causes the expected header data to be garbage, resulting
in a crash.
2022-06-25 16:03:12 -07:00
Richard Stanway
dada82fec1
obs-outputs: Don't shutdown RTMP session when silently reconnecting
The silent reconnect (GOAWAY) is supposed to be used for switching the
connection to a different server. As such, cleanly shutting down the
RTMP connection can destroy state that needs to be preserved in order
for the GOAWAY-enabled server to properly resume the same stream on
reconnect.

This commit closes the TLS/TCP connection before calling RTMP_Close,
causing librtmp to skip the FCUnpublish and deleteStream messages.
2022-06-20 22:10:06 +02:00
jp9000
a31d7acb14 obs-outputs: Fix missing function declaration 2022-06-15 00:52:43 -07:00
jp9000
7ba9db3744 obs-outputs: Reset TLS on reconnect
Reverts e8b2b2092b and properly fixes an issue where bad TLS data
would persist through reconnections when the connection is encrypted.
2022-06-15 00:31:08 -07:00
jp9000
e8b2b2092b obs-outputs: Clear RTMP data before initiating connect
Sometimes when reconnecting the internal RTMP data is not cleared
(particularly the TLS data). This can cause TLS data to carry over from
one connection to another, causing issues with the secondary connection.
2022-06-06 10:12:50 -07:00
tytan652
16e19d2e9c obs-output: Fix compiler warnings
* obs-output: Fix unused-parameter warning

* obs-output: Fix pointer type mismatch warning
2022-05-04 01:37:10 -07:00
tt2468
66a7db7f2a obs-outputs: Implement send timeout in librtmp
This fixes a bug where the RTMP send thread can deadlock upon the
underlying TCP connection being broken. By introducing a send timeout,
this allows the thread to unblock and give up, triggering a reconnect
as normal. The correct solution to this problem would be to rewrite
librtmp with asynchronous IO, but that seems like something unlikely
to happen.

**Before**:
- Start stream in OBS
- Use tool (pfSense) to invalidate connection state
- OBS bitrate drops to 0
- Output does not respond to stop signals, and hangs for an undefined
amount of time (usually multiple minutes) before finally giving up

**After**:
- Start stream in OBS
- Use tool (pfSense) to invalidate connection state
- OBS bitrate drops to 0
- Output sits in blocked state for maximum of 8 seconds, then cleans
up and triggers the reconnect logic
2022-04-30 16:22:10 -07:00
tt2468
9168797361 libobs,obs-outputs: Fix librtmp1 interference
Details in #6226, basically this fixes an issue where OBS links
to the system-installed librtmp1, which is incompatible with our
librtmp.

Co-authored-by: ewhac <ewhac@ewhac.org>
2022-04-25 18:45:05 -07:00
PatTheMav
aae3a6a466 cmake: Fix diverging prefix padding for OBS status outputs
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.

By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
2022-03-26 09:44:23 -04:00
tytan652
7d07b57993 obs-outputs,librtmp: Remove encrypted RTMP support
RC4 and Diffie-Hellmann Key related codes are removed
2022-03-18 13:34:03 -07:00
tytan652
179ad9e67b librtmp: Add mbedtls 3 compatibility
Since Mbed TLS 3 doesn't support RC4 algorithm,
encrypted RTMP is disabled if OBS is built with
the version 3 or later of Mbed TLS.
2022-03-18 13:34:03 -07:00
PatTheMav
49e9d49943
plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
Richard Stanway
a39d174100 obs-outputs: Set a fixed size socket buffer on Windows 7
Auto tuning apparently doesn't work very well on this version and
af6844f5c2 caused throughput
regressions.
2022-02-20 16:16:17 -08:00
Translation Updater
ac8dbf67be Update translations from Crowdin 2022-02-06 02:24:08 +00:00
Richard Stanway
af6844f5c2 obs-outputs: Only log SO_SNDBUF on RTMP socket
From Windows 7 onwards, dynamic send buffering is enabled. By setting
SO_SNDBUF explicitly, we actually disabled the dynamic send buffering
feature which results in reduced throughput. Thankfully this did not
affect the majority of users since the default send buffer is usually
already 64k.

This commit replaces the setting of SO_SNDBUF with log output showing
the current value of SO_SNDBUF at stream start and end. This will aid in
debugging throughput issues caused by a buffer that isn't big enough,
perhaps as a result of the user disabling dynamic send buffering
system-wide.
2021-12-27 14:29:43 -08:00
jp9000
a593fe6755 obs-outputs: Add support for "RTMP Go Away" feature 2021-12-21 09:44:21 -08:00
jp9000
b4fb1db460 obs-outputs/librtmp: Add custom connect data callback
Allows the ability to add custom connect data to the connect signal
encoding
2021-12-21 09:44:21 -08:00
jp9000
6a72cd64e7 obs-outputs: Add support for reading RTMP packets
Instead of ignoring RTMP packets, allow the ability to read incoming
RTMP packets
2021-12-21 09:44:21 -08:00
liu.haibin
1883b774e8 obs-outputs: Reset dbr bitrate before end_data_capture_thread start 2021-12-17 04:31:16 -08:00
Translation Updater
261345f9ef Update translations from Crowdin 2021-12-12 02:38:59 +00:00
jpark37
cf6e106939 obs-outputs: Remove unnecessary header 2021-10-10 19:12:45 -07:00
jpark37
e581802812 obs-outputs: Remove WIN32_LEAN_AND_MEAN define
It should already be defined near the Windows.h include.
2021-10-10 19:12:45 -07:00
Vainock
11a690b038 Update translations from Crowdin 2021-09-24 09:42:08 -07:00
Tommy Vercetti
e075ad5bca obs-outputs: Add WIN32_LEAN_AND_MEAN to avoid symbol clash 2021-09-11 15:50:06 -07:00
Richard Stanway
9411c548d3 obs-outputs: Disable Windows socket loop when using RTMPS
Since this is activated after starting the output, it assumes there is
no need to read anything from the connection as RTMP is send-only from
that point on. However with TLS, reading protocol messages is required
for proper operation, causing it to immediately fail on RTMPS
connections. This is a complex fix due to the way it interacts with
librtmp and mbedTLS so let's just disable it for now to avoid breaking
things for users.
2021-09-03 18:15:17 +02:00
Kazuki Yamaguchi
fb7a037bc8 obs-outputs: Fix binding to IPv6 addresses on *nix
Fix inet_ntop()/inet_pton() being called with an incorrect argument for
IPv6 addresses.

On Linux, the offset of the sin_addr and sin6_addr fields differ and
the confusion on the inet_ntop() call produces an erroneous IPv6 string
representation such as "0:0:2001:db8::". This is visible on the UI,
Settings -> Advanced -> Network -> Bind to IP.

The same goes for the inet_pton() call.
2021-08-15 02:50:32 -07:00
Translation
ef2b1eb1c6 Update translations from Crowdin 2021-06-11 07:18:15 -07:00
Gol-D-Ace
90df8d44df Update translations from Crowdin 2021-05-30 20:33:35 +02:00
Thulinma
244b6c92e6 obs-outputs: Fix RTMP restart not always working
Bug is caused by the internal connection variables not being reset on
reconnect, leading OBS to both be unable to parse valid packets from and
send valid packets to the remote end.  This commit splits RTMP_Init off
into a new RTMP_Reset function, which resets these internal variables
without re-initing the rest of the library.  The original RTMP_Init
calls the new function, perfectly preserving the old behaviour while
adding a new reset function to address the issue with.

Fixes obsproject/obs-studio#2865
2021-01-31 18:44:11 -08:00
Sefa Eyeoglu
90244212f3 obs-outputs: Use system-wide FTL if present
To support FTL, it needed to be present in-tree to be compiled. This PR
adds support for system-wide installations of libftl. It uses
pkg-config to find the system-wide installation. If pkg-config can't
provide libftl we just fall back to using the in-tree submodule. If
that's also not available it won't be included at all like before.
2021-01-17 20:07:03 -08:00
Hayden McAfee
96ef45cef5 UI: Support FTL URLs for custom streaming service
Custom streaming service URLs beginning with `ftl` are handled by the
`ftl_output` plugin.
2021-01-13 09:44:52 -08:00