Cannot SRT stream to youtube #1834
Replies: 5 comments 4 replies
-
|
Did YouTube add support for SRT? It seems that my implementation didn’t support IPv6. It’s probably related to IPv6, judging from this error:
Does YouTube’s SRT only support IPv6? |
Beta Was this translation helpful? Give feedback.
-
|
Youtube has support for SRT, but it is by invitation only. We know a guy... and are trying to get hooked up. They need to evaluate our stream before giving our channel(s) permission to use SRT. I don't know if Youtube's SRT requires IPv6, but I can ask the technical contact we're in contact with. I can stream to their SRT ingest point using a completely black-box application that I got from the app store (something called Larix). So I am reluctantly concluding that HaishinKit + SRT + IPv6 may well be the problem if you have to have IPv6 to connect to their ingest point. I will ask. Thank you for your prompt reply. I really like using HaishinKit, so I'd be happy to do whatever might be helpful in this regard. How much work is it to get IPv6 working? |
Beta Was this translation helpful? Give feedback.
-
|
Actually, I am no longer convinced this is an ipv6 problem. I think the message is a red herring. (Though ipv6 would still be a good to think to support clearly.)I will tell you what I do know:Using SRTHaishinKit, I can stream to cloudflare, and a private company called Kiswe with no problems.I cannot however stream to castr, nor to this youtube site. In the youtube case I get the error message you saw. Maybe that’s the issue. Maybe not.In the castr case, I get a message from libsrt abouting being “CONFUSED” because it was expecting a handshake but got something else.In both cases I verified that the Larix app on my iPhone was able to stream to both sites. I have just downloaded HaishinKit (as opposed to using SPM) and am bringing up the sample app.I will use it to stream to both castr and youtube, and report my findings.Unfortunately, I think youtube has terminated my test SRT ingest; I haven’t heard back from my contact for 24 hours now, hopefully he’s just busy, but I may not be able to test it any more. I’ll try a few more things this evening and then get back to you.But more than happy to do what I can to help. It’s super annoying that I can’t SRT stream to castr, that’s supposed to be their raison d’etre.While I’ve got you: I just downloaded and built libsrt completely locally so I can stick some print statements in it/set breakpoints.Is it obvious how to change the HaishinKit SPM Package.swift file to pick up a local build of libsrt, rather than using the prebuilt binary?Sent from my iPadOn Nov 20, 2025, at 5:21 PM, shogo4405 ***@***.***> wrote:
I usually charge 100 USD per hour, but this time I’d like to take on the challenge myself, so there’s no fee.
Instead, please help me with testing, and consider becoming a sponsor: https://github.com/sponsors/shogo4405
I’ll be working on it over the weekend, so please wait until then.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
That’s great you got castr to work. I’ll get you the region info later and try that script.That’s a huge relief, because if we cannot get SRT to work with youtube (either because it just doesn’t or because they don’t give us access) our fallback would be to stream SRT to castr and have them repeat as RTMP to youtube.Just to fill you in on some details, although I’m not officially company affiliated (I’m a private individual) the project I’m working on is for USA Fencing (i’m a national referee). The hope is for us to run 50-60 live streams, all at the same time, from a convention center.We were going to send camera streams to hardware encoders, but we’re using iOS devices to do some process/compositing/AI tracking and we realized it would be cheaper/less equipment for the iOS devices to do the streaming. Until recently it was iPhones, but it may turn out to be iPads (but same software, HaishinKit).So HaishinKit is now an utterly critical component. If it becomes necessary, and given how critical this is, I’ll lean on USA Fencing to push some $$ your way if we end up needing a bit of help.For example, I found that SRT streaming to Kiswe (a sports streaming company) over SRT was fine, but doing it to cloudflare worked —- but heated up my phone really really badly. That sort of thing.Sent from my iPadOn Nov 21, 2025, at 5:37 AM, shogo4405 ***@***.***> wrote:
It’s castr.io(http://castr.io/), and I was able to connect successfully in my environment.
Could you tell me which region you are using?
environment
iPhone16 Pro max + iOS26
Xcode26
WiFi
main branch
castr.io
Tokyo Region
srt://tokyo.castr.io:9998?pkt_size=1316&streamid=#!::r=live_xxxxxxxxxxx,password=xxxxxx,m=publish
Mask the streamid part.
It is specified as follows.
struct Preference: Sendable {
// Temp
static nonisolated(unsafe) var `default` = Preference()
// var uri = "http://192.168.1.14:1985/rtc/v1/whip/?app=live&stream=livestream"
var uri = "srt://tokyo.castr.io:9998?pkt_size=1316&streamid=#!::r=live_xxxxxxxxxxx,password=xxxxxx,m=publish"
// Not needed for SRT. Ignore it. Please include everything in the URI.
var streamName = "live"
func makeURL() -> URL? {
if uri.contains("rtmp://") {
return URL(string: uri + "/" + streamName)
}
return URL(string: uri)
}
}
***@***.*** HaishinKit.swift % traceroute tokyo.castr.io
traceroute to tokyo.castr.io (109.61.83.193), 64 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 5.252 ms 2.860 ms 3.799 ms
2 fpb6aaac01.tkyc406.ap.nuro.jp (my ip address) 9.894 ms 10.590 ms 9.095 ms
3 92.203.136.138 (92.203.136.138) 5.722 ms 5.829 ms 6.136 ms
4 * * *
5 202.213.193.92 (202.213.193.92) 93.696 ms
202.213.193.60 (202.213.193.60) 5.151 ms
202.213.193.92 (202.213.193.92) 6.350 ms
6 sony-tyo.cdn77.com (84.17.32.114) 3.653 ms 3.969 ms 3.594 ms
7 vl211.tyo-eq8-core-1.cdn77.com (138.199.0.32) 3.674 ms
vl212.tyo-eq8-core-2.cdn77.com (138.199.0.36) 4.749 ms 3.609 ms
8 * * vl221.tyo-eq8-dist-2.cdn77.com (79.127.194.100) 4.351 ms
9 unn-109-61-83-193.datapacket.com (109.61.83.193) 6.308 ms 4.889 ms 4.080 ms
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I ran your Examples app on iOS on my phone, and yes, I can stream to castr. If youtube ever restarts my feed, I'll try your app to stream there. I'm going to see if I can get my app to stream to castr, but now that I have a working example, hopefully I can figure out the problem. I'v update my macOS to Tahoe version 26.1 so I should now be able to run the most recent version of your code, to make sure it's not a recently fixed bug. Thanks again for the help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I was given specific streamid and passphrase for youtube to evaluate if my SRT streaming from my app is good enough for them to allow my channel to become SRT enabled. When I use an app from the app store to stream to SRT using the data youtube gave me, it works.
When I try to use HaishinKit to stream, it does not. I have previously used HaishinKit to stream RTMP to youtube with no problems, and I was able to stream SRT to both cloudflare and another provider.
It is only with youtube that I am hitting problems. I see this in the logs:
20:17:49.849877/.N:SRT.cn: processSrtMsg_KMRSP: cmd=4(KMRSP) len=224 KmState: SND=SECURED RCV=SECURED
20:17:49.850397/*E:SRT.in: pton: IPE or net error: can't determine IPv4 carryover format: 220:50a:186a:ac69:0:0:0:0
20:17:49.850505/.N:SRT.cn: @175157562: Connection established from (unknown:0) to peer @292323157 (142.250.99.150:2010)
I note that I only get the "IPE or net error: can't determine IPv4 carryover format" message when my streamid parameter starts with "#!::u=xxxxxx" which is how youtube specifies a streamid parameter. (This is tricky since # needs to be escaped, in URLs, except, I guess it doesn't?)
It is very confusing. If anyone has insight for me, I would be really super appreciative...
Background / Tried Steps
No response
Environment
No response
Beta Was this translation helpful? Give feedback.
All reactions