Commit Graph

273 Commits (535e7dfa157b68562ab185c09d6bcc2c9add2d3f)

Author SHA1 Message Date
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
jp9000 2220884498 obs-outputs: Check support for mbedtls func 2020-08-22 11:22:24 -07:00
jp9000 dd19c29b3e obs-outputs: Fix Windows memory leak
When using alternate mutex implementations, you need to explicitly free
the mutexes with the mbedtls_threading_free_alt() function.
2020-08-22 11:07:16 -07:00
jp9000 189fc7ab6a obs-outputs: Add support for metadata-based multitrack 2020-08-22 08:27:58 -07:00
jp9000 746a522986 obs-outputs: Don't assume @setDataFrame
Don't assume @setDataFrame when using an info packet.  I'm guessing
librtmp did this because the only time this packet type was normally
used was when you use onMetaData.
2020-08-22 08:27:58 -07:00
jp9000 c38f370ad0 obs-outputs: Enable Windows mbedTLS threading support 2020-08-19 07:02:33 -07:00
fengyifan 4ffe5859a1 obs-outputs: Use FLV codec IDs for videocodecid/audiocodecid
Fixes the codec IDs in onMetaData to be compliant with FLV spec.  Using
string representation of these values is non-standard
2020-07-12 14:00:56 -07:00
Eric Lindvall 1939472912 obs-outputs: Log unhandled rtmp status responses
rtmp status responses that are not handled are currently silently ignored
making it difficult to identify issues.
2020-06-18 18:00:45 -07:00
Eric Lindvall 6a880530f1 obs-outputs: Handle rtmp NetStream.Publish.BadName response
Adobe Media Server and nginx-rtmp can return this status response to a
publisher if the key is already being used to publish.
2020-06-18 18:00:45 -07:00
Kurt Kartaltepe d928bfd1ea cmake: Fix warnings and normalize variables/errors
As of 3.17 using find_package_handle_standard_args checks that the name
of the FindXXX file and the first argument are the same case.

Some modules used non-standard variables or the old singular variables
instead of plurals. This normalizes variable usage to the new-style.

Some CMakeLists.txt did custom error checking instead of propagating
find_package errors. These were changes to call find_package with
REQUIRED or without QUIET where needed and shortens the custom status
messages. This helps users who want to enable that functionality see
what precisely wasnt found.
2020-05-21 18:45:16 -07:00
jp9000 8d6f29ffc7 Revert "Merge pull request #2637 from kkartaltepe/cmake-variety-fixes"
This reverts commit d777000a60, reversing
changes made to c9e5f30a78.
2020-05-21 00:03:09 -07:00
Jim d777000a60
Merge pull request #2637 from kkartaltepe/cmake-variety-fixes
cmake: Fix warnings and normalize variables/errors
2020-05-20 23:45:25 -07:00
jp9000 7993179466 cmake: Add cmake folders 2020-05-13 06:52:37 -07:00
Colin Edwards 55e2985026
Merge pull request #1944 from WizardCM/windows-rc-definition
CMake: Build Windows modules with file descriptors
2020-04-18 18:27:22 -05:00
Kurt Kartaltepe 107c632220 obs-outputs: Fix warnings WITH_RTMPS=OFF
Some unused variables were not marked unused when RTMPS was disabled.
2020-04-04 11:09:12 -07:00
Kurt Kartaltepe c5b731e48f cmake: Fix warnings and normalize variables/errors
As of 3.17 using find_package_handle_standard_args checks that the name
of the FindXXX file and the first argument are the same case.

Some modules used non-standard variables or the old singular variables
instead of plurals. This normalizes variable usage to the new-style.

Some CMakeLists.txt did custom error checking instead of propagating
find_package errors. These were changes to call find_package with
REQUIRED or without QUIET where needed and shortens the custom status
messages. This helps users who want to enable that functionality see
what precisely wasnt found.
2020-04-03 21:32:10 -07:00
Richard Stanway 1dc2c6a3be obs-outputs: Fix mbed TLS build issues
Version test macro was using the wrong version, and the non-crypto
MD5 only code was accidentally moved into an #ifdef which ended up
disabling it.

Fixes https://github.com/obsproject/obs-studio/issues/2426
2020-03-23 17:32:39 +01:00
Gol-D-Ace d74fc65047 Update translations from Crowdin 2020-03-16 20:14:50 +01:00
Richard Stanway 452a4b5085 obs-outputs: Fix RTMP authentication
RTMP authentication requires the curStreamIdx and nStreams be set
between the disconnect / reconnect that occurs in PublisherAuth. Now
that there's no good place to clean them up, zero the whole rtmp->Link
before starting a new stream.
2020-03-06 22:52:50 +01:00
jp9000 1e4789f829 obs-outputs: Update FTL sdk to latest version 2020-02-27 06:45:43 -08:00
Richard Stanway ee4cbb1199 obs-outputs: Properly reset stream count on RTMP_Close
Every addStream call would increment this counter. After merging the
mbedTLS fixes, we no longer have extraneous RTMP_Init calls which were
masking the prescence of this bug. This caused every stream after the
first stream to have the wrong channel index, and eventually OBS would
crash due to an out of bounds write if the counter reached
RTMP_MAX_STREAMS.
2020-02-23 01:04:14 +01:00
Richard Stanway c465212414 obs-outputs: Remove hard-coded certificate paths on Linux
The report in https://github.com/obsproject/obs-studio/issues/2350
identified the issue as being caused by mbedtls not following symbolic
links, but it turns out the issue was the mbedtls_x509_crt_parse_path
return value which was already fixed in 4d89123c. So these changes are
no longer necessary.
2020-01-30 19:48:23 +01:00
Richard Stanway 2f4447a7a1 obs-outputs: Remove server support from librtmp
This code is very old and seems to be non-functional in its current
state. The TLS support is also complicated to maintain across multiple
deprecated mbedtls functions.
2020-01-25 19:31:48 +01:00
Richard Stanway 5f62cd153b obs-outputs: Remove unused variable 2020-01-25 19:25:43 +01:00
Richard Stanway baa559813c obs-outputs: Fix build with older mbedtls versions
Compilation with older versions of mbedtls was broken by
https://github.com/obsproject/obs-studio/pull/2304, unfortunately the
older version is still present in Ubuntu 16 LTS.
2020-01-25 18:58:05 +01:00
Richard Stanway 476b727fea obs-outputs: Show UI error if the root certs don't load
Though this should now be very rare, it's more helpful than "Failed to
connect to server". Other TLS error codes are now also stored for future
use instead of copying them on a case by case basis.
2020-01-25 17:35:07 +01:00
Richard Stanway 7a4c5e5df2 obs-outputs: Enable logging before calling RTMP_Init
Errors or warnings in RTMP_Init were not copied to the OBS log file
if they occured before the callback was set.
2020-01-25 17:01:14 +01:00
Richard Stanway d1159087f1 obs-outputs: Add additional paths for root certificates on Linux
Fixes https://github.com/obsproject/obs-studio/issues/2350. Also adds
some log file output for when the root certificates can't be loaded to
make it more obvious what the problem is.
2020-01-25 16:49:11 +01:00
Richard Stanway 2b131d212f obs-outputs: Fix librtmp mbedtls thread safety
Per mbedtls documentation, "If you share a context between threads, you
need to call these functions only from the main thread, at the beginning
and end of the context's lifetime.". OBS violated this since librtmp
uses a global context and it was allocated and freed in different
threads such as the auto config test.

This commit attaches the mbedtls context to an RTMP structure so there
is no more global state. It also fixes a rare double-free crash that
could occur if RTMP_TLS_Free was called twice (this happened in rare
situations such as the auto config running followed by a mode change
from Advanced to Simple).
2020-01-23 00:11:23 +01:00
Kurt Kartaltepe 4d89123cdc librtmp: Allow partial success for mbedtls
mbedtls_x509_crt_parse_path returns a positive number if it partially
succeeds and a negative number on complete failure. This changes the
positive result to no longer error and prevent TLS connections (OBS
verifies all endpoints so having no CA chain prevents TLS).
2020-01-12 13:31:39 -08:00
Florian Zwoch 2699bbbd77 obs-outputs: Fix mbedtls use of deprecated functions
mbedtls_md5_starts(), mbedtls_md5_update() and mbedtls_md5_finish()
have been marked deprecated since mbedtls version 2.7 and may go
away in the future.

These function have been superseded by versions with a return
value. They are suffixed with "_ret". We do not actually check
return values.

Also the header "mbedtls/net.h" has been superseded by
"mbedtls/net_sockets.h".
2020-01-08 11:45:55 +01:00
Kurt Kartaltepe 210ebcbda7 obs-outputs: Log FTL during configure 2019-11-18 20:37:33 -08:00
Matt Gajownik 51be039cf8 CMake: Build Windows modules with file descriptors 2019-10-15 21:34:12 +11:00
Clayton Groeneveld 350969a206 rtmp-stream: Fix comparison between signed and unsigned ints 2019-10-11 22:34:49 -05:00
Gol-D-Ace 03b5be75e4 Update translations from Crowdin 2019-09-17 23:21:00 +02:00
jp9000 aa4d1d0cd1 obs-outputs: Add dynamic bitrate to RTMP output
The dynamic bitrate operates based upon estimating the current bitrate
output, and then adjusting the bitrate on the fly as necessary when
congestion is detected as a replacement for dropping frames.

This may still need adjustment, as it is difficult to accurately emulate
real-world frame drop scenarios.  This does not currently drop frames at
all, and because of that, very high congestion may cause additional
stream delay to viewers (because data will be buffered), but from
limited testing, most congestion will not cause that and it can safely
recover pretty quickly without adding significant delay.
2019-08-18 03:14:38 -07:00
jp9000 91ce2349db obs-outputs: Allow changing bitrate test limit on the fly
When doing the bitrate limit test, it can be useful to have the ability
to change the current maximum bitrate limit.  This adds the ability to
press keys on windows (numpad 0-6) to change between bitrates.  Numpad 0
being no limit, 1 being 1000, 2 being 2000, etc.
2019-08-18 03:14:38 -07:00
Richard Stanway 0e77a2c75b obs-outputs: Minor pointer fixes 2019-06-29 01:28:16 +02:00