Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Implement multitrack output restart if stream key has become invalid #11452

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dsaedtler
Copy link
Contributor

Description

Adds a special handling for the invalid key case where a previously successful connection with the multitrack output will restart the stream from scratch in order to re-run to multitrack configuration and fetch a new signed stream key.

Motivation and Context

Twitch EB uses a signed stream key that is valid for 48 hours. Since the time limit for a stream on Twitch is also 48 hours that means that when a user will get disconnected upon hitting the hour limit they will no longer be able to reconnect.
In order to allow users to run 24/7 streams with EB we therefore need to manually restart the stream once it has stopped due to an invalid stream key.

This PR accomplishes that by invoking StartStreaming() again once the previous output session has been stopped with an "invalid key" error code (provided the previous output session was successful, and the user has not manually stopped the stream).

This change also removes the now-unnecessary deactivate handlers, they previously existed to work around encoder reference counting issues which have now been fixed upstream.

The submission of this PR was delayed as Twitch had a server-side issue that needed to be fixed first, that fix should now be live on all production servers.

How Has This Been Tested?

  • Tested locally by manually interrupting the connection manipulating the stream key during the reconnt so it became invalid
  • Tested with OBS on an EC2 instance running a stream on Twitch prod for 48 hours*

*Tested with an earlier revision of the PR based on Twitch fork.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added Bug Fix Non-breaking change which fixes an issue Code Cleanup Non-breaking change which makes code smaller or more readable labels Oct 27, 2024
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit.

UI/multitrack-video-output.cpp Outdated Show resolved Hide resolved
@dsaedtler
Copy link
Contributor Author

Full 48 hour test with this PR was successful. Also rebased on latest master and addressed feedback now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Code Cleanup Non-breaking change which makes code smaller or more readable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants