Skip to content

fix: point X channel at the real pscp.tv RTMPS ingest (+ saner connect window) - #14

Merged
Dexploarer merged 1 commit into
mainfrom
fix/x-rtmp-real-endpoint
May 15, 2026
Merged

fix: point X channel at the real pscp.tv RTMPS ingest (+ saner connect window)#14
Dexploarer merged 1 commit into
mainfrom
fix/x-rtmp-real-endpoint

Conversation

@Dexploarer

Copy link
Copy Markdown
Member

Summary

  • The hardcoded X prefix (rtmp://global-live.twitter.com:443/app) is the X dev-portal placeholder — nothing ever accepted a stream there. The actual X Live Producer ingest is on pscp.tv (Periscope's CDN, still used for X Live): rtmps://va.pscp.tv:443/x.
  • Updated the prefill + hint so users with Producer access get a working URL out of the box. Producer assigns a region (va / eu / sg / au …); hint tells the user to override if theirs isn't va.
  • Bumps connectTimeoutMs 8s → 20s. The 8s default SIGKILL'd ffmpeg during the libx264-software-fallback + MediaRecorder-first-chunk + RTMPS-handshake worst case, which is exactly what the bug report showed (exit code=137 looping).
  • Preserves the stderr classifier message in the toast on reconnecting / failed. Old code overwrote "Connection refused" / "Stream key invalid" with the useless "ffmpeg exited code=137" (our own SIGKILL). Now: keep the classifier text; only synthesize a fallback when there's no classifier match.

Test plan

  • bun run check clean (539 pass)
  • CI green
  • After merge, picking "X" in the link dialog prefills rtmps://va.pscp.tv:443/x (still flagged restricted because Producer access is verified-only)
  • Going live with valid X Producer creds connects within the 20s window
  • An intentionally-bad stream key surfaces "Stream key invalid" (or whatever the classifier saw) in the toast instead of "ffmpeg exited code=137"

🤖 Generated with Claude Code

The hardcoded X prefix (`rtmp://global-live.twitter.com:443/app`) is
the X dev-portal placeholder — nothing ever streamed there. The
actual X Live Producer ingest is on pscp.tv (Periscope's legacy CDN
that X still uses for live):

    rtmps://va.pscp.tv:443/x

Updated the prefill and hint copy so users with Producer access don't
have to discover the right URL by trial and error. Producer assigns a
region (va / eu / sg / au …); the hint now tells the user to edit
the URL if their region isn't `va`.

Two follow-on fixes for the connect path that this exposed:

- Bump `connectTimeoutMs` 8 → 20s. Worst-case path is libx264
  software fallback at 1080p30 (VideoToolbox probe failed) plus the
  first MediaRecorder chunk at +1s plus the RTMPS handshake. 8s
  SIGKILL'd ffmpeg before it could finish.
- Preserve the stderr classifier message in the lifecycle toast. The
  old code overwrote "Connection refused" / "Stream key invalid"
  with "Stream dropped — reconnecting (attempt 1). ffmpeg exited
  code=137" — where the 137 is our own SIGKILL, telling the user
  nothing useful. Now: keep the classifier line and just append
  "(reconnect attempt N)". When the only cause is our SIGKILL (no
  classifier match), say "Stream stalled — check your RTMP URL +
  stream key" instead of leaking the exit code.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@blacksmith-sh

blacksmith-sh Bot commented May 15, 2026

Copy link
Copy Markdown

Blacksmith Account Suspended

This Blacksmith account requires additional verification. Jobs targeting Blacksmith runners will not be picked up and will remain queued until they timeout.

Please contact Blacksmith Support for assistance.

@Dexploarer
Dexploarer merged commit cbe3e1a into main May 15, 2026
1 check passed
@Dexploarer
Dexploarer deleted the fix/x-rtmp-real-endpoint branch May 15, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant