Open tmatth opened 3 months ago
I don't know how I'm supposed to test this. I see a static endpoint, but for tokens it says Twitch Stream Key
: does this mean I should have an account or something like that?
I don't know how I'm supposed to test this. I see a static endpoint, but for tokens it says
Twitch Stream Key
: does this mean I should have an account or something like that?
Yeah you need an account (which is free), here is what I tested (after adding some args in the dockerfile):
tmatth@bellini:/big-repos/simple-whip-client$ docker run -it --rm simple-whip-client
--------------------
Simple WHIP client
------------------
WHIP endpoint: https://g.webrtc.live-video.net:4443/v2/offer
Bearer Token: <TWITCH_STREAM_KEY>
Trickle ICE: no (candidates in SDP offer)
Auto STUN/TURN: no
STUN server: stun://stun.l.google.com:19302
TURN server: (none)
Audio pipeline: audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay pt=100 ssrc=1 ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=100
Video pipeline: videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc speed-preset=ultrafast tune=zerolatency ! rtph264pay config-interval=1 pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=96
[WHIP] Initializing the GStreamer pipeline:
webrtcbin name=sendonly bundle-policy=3 stun-server=stun://stun.l.google.com:19302 videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc speed-preset=ultrafast tune=zerolatency ! rtph264pay config-interval=1 pt=96 ssrc=2 ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! sendonly. audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay pt=100 ssrc=1 ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=100 ! sendonly.
[WHIP] Configured jitter-buffer size (latency) for PeerConnection to 200ms
[WHIP] Starting the GStreamer pipeline
[WHIP] Creating offer
[WHIP] Offer created
[WHIP] Setting local description
[WHIP] ICE gathering started...
[WHIP] ICE gathering completed
[WHIP] Sending SDP offer (1291 bytes)
[ERR] [src/whip-client.c:whip_connect:729] [400] Bad Request
[WHIP] Disconnecting from server (HTTP error)
[WHIP] GStreamer pipeline stopped
Bye!
Yeah you need an account (which is free)
Created one but god the settings are so annoying. Just to create a stream I have to go through a 1000 hoops, pick a category I don't want to pick, can't make it private or unlisted who knows why. I have zero interest in giving this a go, to be honest. 400 means the server doesn't like something we send, and there's no way for me to know what just by guessing. Hopefully someone with Twitch knowledge will chime in and tell me what to fix.
Pinging @danjenkins as he may know who to nudge about that.
I enabled libsoup3 debugging, which shows this:
< HTTP/1.1 400 Bad Request
< Soup-Debug-Timestamp: 1709915007
< Soup-Debug: SoupMessage 1 (0x7f471c101c90)
< Access-Control-Allow-Headers: Content-Type, Authorization
< Access-Control-Allow-Origin: *
< Date: Fri, 08 Mar 2024 16:23:27 GMT
< Content-Length: 98
< Content-Type: text/plain; charset=utf-8
<
< failed to handle offer: failed to create broadcast session: h264 codec is missing in the SDP offer
Apparently it doesn't like the way H.264 is negotiated.
I pushed a commit to enable HTTP debugging, if you want to make more tests. Adding something like -H body
to the command line will debug requests and responses on the console.
I pushed a commit to enable HTTP debugging, if you want to make more tests. Adding something like
-H body
to the command line will debug requests and responses on the console.
My guess is something like missing profile-level-id here:
a=fmtp:96 packetization-mode=1;sprop-parameter-sets=Z0LAFdoFB+wFqDAwNSgAAAMACAAAAwHkeLF1,aM48gA==
vs. the functional version in OBS
a=fmtp:96 profile-level-id=42e01f;packetization-mode=1;level-asymmetry-allowed=1
If I can confirm this is just a gstreamer issue hopefully I can fix it in the dockerfile and close.
In my case the profile-level-id was there, just not one they'd like maybe
a=fmtp:96 packetization-mode=1;sprop-parameter-sets=Z0LAFdoFB+wFqDAwNSgAAAMACAAAAwHkeLF1,aM48gA==;profile-level-id=42c015;level-asymmetry-allowed=1
I haven't followed: has this been fixed by Twitch in the meanwhile?
I've tried vp8, vp9 and h264 with no luck, see: https://www.reddit.com/r/WebRTC/comments/12nc5md/twitchtv_now_supports_webrtc_ingestion_via_whip/
cc @Sean-Der
By contrast, https://github.com/ggarber/whip-go does work with twitch.tv.