Commit Graph

310 Commits (361eebc6f3e07bb09e726c0a6724991a4dab9de2)

Author SHA1 Message Date
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
Roman Sivriver 7029304b32 ftl-stream: Fix reconnect loop on FTL ingest disconnect
When connection to FTL ingest is lost, ftl_event() calls
obs_output_signal_stop() to trigger a reconnect. However, during the
reconnect delay, send_thread is still waiting on send_sem semaphore.
After the delay, ftl_stream_start() is called, which in turn resets
the semaphore and creates a new send_thread. Old send_thread now exits
the loop and triggers another reconnect and the whole process repeats
again. The fix resets the semaphore in ftl_event() so the old
send_thread exits immediately.
2021-01-12 18:28:41 -08:00
Gol-D-Ace 7368a2c7cc Update translations from Crowdin 2020-12-14 00:29:44 +01:00
Gol-D-Ace 7ab98ca00f Update translations from Crowdin 2020-11-25 20:11:39 +01:00
Ryan Foster 548938c210 obs-outputs: Log unhandled status description as debug level
Certain RTMP status descriptions can contain stream keys. We don't want
to log those normally, so log the description for unhandled status codes
as RTMP_LOGDEBUG. If someone needs to debug an RTMP server's return
messages, they can compile OBS with the RTMP Log Level set to
RTMP_LOGDEBUG.
2020-11-24 14:17:49 -08:00
Vadim Zhukov 0d222b6b56 Add OpenBSD support 2020-11-14 11:55:22 -08:00
Gol-D-Ace c66ebde080 Update translations from Crowdin 2020-09-27 23:07:27 +02:00
Shaolin 420823bfaa plugins: Clear compile warnings on Linux 2020-08-26 01:34:03 -03:00
jp9000 d310f1532b obs-outputs: Remove legacy multitrack code 2020-08-24 13:07:55 -07:00
Jim aef10d46c4
Merge pull request #3322 from kkartaltepe/unused-var-cleanup
obs-filters/obs-outputs: Cleanup unused var warns
2020-08-23 12:40:54 -07:00
Kurt Kartaltepe 43da6eacd0 obs-filters/obs-outputs: Cleanup unused var warns
Fix unused variables when compiling without rnnoise
Fix unused variable warnings in GCC when using assert() in release
2020-08-23 12:09:59 -07:00