obs-outputs: Surface RTMP publish error to user#13618
Conversation
|
Please fill in the PR template. |
Sorry Matt, my bad! Should be good now 😁 |
On a failed publish the server can send an onStatus description with the reason (e.g. quota or insufficient credits). Match NetStream.Publish.Failed, store the description, and report it via obs_output_set_last_error on both the connect and publish-denied paths.
Include the output's last error in the failure message shown for OBS_OUTPUT_INVALID_STREAM, so a server-provided reason for rejecting a publish reaches the user.
e8da0a0 to
d0df180
Compare
|
It's a security risk to allow the server to set a message that's displayed directly in the UI like this. A malicious server could send a "Your OBS Studio needs to be updated, please visit https://definitely-not-malware.invalid/update.exe" error and create a convincing malware / phishing prompt for the user, even more so if Qt renders HTML entities (I think the autodetection should stop at the newline though - but that makes the format string a security barrier which is not obvious at all). I think we need to be very clear that this is a message from server.example.com, its contents are untrusted and its informational only. A QMessageBox might be insufficient to convey this. Perhaps only servers in See also spesmilo/electrum#4968 for similar discussions on this topic. |
|
@notr1ch Great point Richard, thanks for raising it! I'll get to it whenever I find the time 🤝 🙏🏻 |
Description
When an RTMP server denies a publish, OBS showed a generic error even when the server provided a human-readable reason in the
onStatusdescription. Three things were in the way:NetStream.Publish.Failedwas not among the recognized failure codes (it fell through to the "Unhandled" branch), thedescriptionwas only logged and never stored for the output, and theOBS_OUTPUT_INVALID_STREAMfailure message did not include the output's last error.This captures the server's
onStatusdescriptionon a failed publish (addingNetStream.Publish.Failed), reports it viaobs_output_set_last_erroron the publish-denied path, and lets the invalid-stream failure message include it. The reason is then shown to the user instead of only a generic message.Motivation and Context
Servers frequently reject a publish for actionable reasons (quota/credit limits, expired or disabled keys, etc.). OBS currently discards that message, leaving the user with no explanation. Surfacing it addresses https://obsproject.com/forum/threads/feature-request-alert-with-netstream-publish-failed-commands-description.66266/
How Has This Been Tested?
Built OBS locally and streamed to an RTMP server that rejects the publish with an
onStatusdescription(an ingest that denies the stream with a reason).Verified on the
32.1.2tag;mastercurrently requires a newer macOS SDK than the test machine has, and the changed code is identical on both.Types of changes
Checklist: