HNHacker News
TopNewBestAskShowJobs

kixelated

392 karma · joined February 15, 2023

submissionscomments
kixelated··on The first Media over QUIC CDN: Cloudflare
That is all sorts of miserable. I had an initial prototype that emulated UDP over SCTP, running QUIC (without encryption) on top. The problem is that SCTP becomes the bottleneck, plus it's super complicated.

I immediately jumped ship to WebTransport when Chrome added support. But I suppose there's no other option if you need P2P support in the browser.

kixelated··on The first Media over QUIC CDN: Cloudflare
Each track is further segmented into streams. So you can prioritize new > old, in addition to audio > video.
kixelated··on Media over QUIC (MoQ): Refactoring the Internet's real-time media stack
Thank you so much dang.
kixelated··on The first Media over QUIC CDN: Cloudflare
Chrome and Firefox support WebTransport. Safari has announced intent to support it and they already use QUIC under the hood for HTTP/3.

Cloud services are pretty TCP/HTTP centric which can be annoying. Any provider that gives you UDP support can be used with QUIC, but you're in charge of certificates and load balancing.

QUIC is client->server so NATs are not a problem; 1 RTT to establish a connection. Iroh is an attempt at P2P QUIC using similar techniques to WebRTC but I don't think browser support will be a thing.

kixelated··on The first Media over QUIC CDN: Cloudflare
Hi I originally wrote WARP and used something similar at Twitch. It supports CMAF segments, so the media encoding is backwards compatible with HLS/DASH and can share a cache, which is a big deal for a gradual production rollout.
kixelated··on The first Media over QUIC CDN: Cloudflare
Yeah I will soon, but I could also use the time to fix up some more stuff.
kixelated··on The first Media over QUIC CDN: Cloudflare
QUIC/WebTransport gives you the ability to drop media, either via stream or datagrams, so you can get the same sort of response to congestion as WebRTC. However, one flaw with MoQ right now is that Google's GCC congestion controller prioritizes latency over throughput, while QUIC's TCP-based congestion controllers prioritize throughput over latency. We can improve that on the server side, but will need browser support on the client side.

As for the media pipeline, there's no latency on the transmission side and the receiver can choose the latency. You literally have to build your own jitter buffer and choose when to render individual frames.

kixelated··on The first Media over QUIC CDN: Cloudflare
I linked the URL to their relay but otherwise all of the libraries, demos, rants, jokes are my own. I can remove the link to their post if that would help, or I could get Cloudflare's blessing. It's just a bit frustrating.
kixelated··on Media over QUIC (MoQ): Refactoring the Internet's real-time media stack
Hey folks, it seems like an admin merged my post with the Cloudflare post :(. Here's the original (and much funnier) post: https://moq.dev/blog/first-cdn/

And for context, Cloudflare is using a fork of my open source library (kixelated/moq) that I've been working on for a few years, plus I authored the original MoQ drafts. I know my post might look derivative at first glance... but it's the other way around.

kixelated··on The first Media over QUIC CDN: Cloudflare
Hey dang, I don't think my blog is a repost. It links the Cloudflare announcement but the content is completely different (and actually funny). Is there any way you could restore it?
kixelated··on The first Media over QUIC CDN: Cloudflare
Firefox should work, I just don't test it often. Lemme fix.
kixelated··on The First Media over QUIC App: Hang.live
Hey HN, I've spent the last few years working on an open source WebRTC replacement using new web technologies. It's being standardized by the IETF, but progress is slow, so I finally decided to get serious and go full-time making an application out of it. Let me know what you think!
kixelated··on Log by time, not by count
Absolutely.

Logs should be bursty, because they're most useful when debugging rare issues. If you have identical log lines, then that should have been a metric instead.

Metrics should be sampled based on frequency, because they deduplicate. I'm a huge fan of logarithmically sampling metrics.

kixelated··on Timeliness without datagrams using QUIC
I tried using SCTP before QUIC. Unfortunately, while the API looks like you can mix reliable/unreliable messages, in reality the transport doesn't support it because of how FORWARD-TSN works. There were some other pretty fundamental blockers too.
kixelated··on Replacing HLS/Dash – Live Mass Fanout with Media over QUIC
Fun fact, at one point it was better (and cheaper) to serve Telstra viewers out of LA instead of our Sydney datacenter because of the mess that is Australia internet infrastructure.
kixelated··on Replacing HLS/Dash – Live Mass Fanout with Media over QUIC
AT&T customers will complain if AT&T throttles a RTMP stream, as it will cause indefinitely buffering.

AT&T customers are less likely to complain if AT&T throttles a HLS broadcast, as the quality will just be lower.

kixelated··on Replacing HLS/Dash – Live Mass Fanout with Media over QUIC
I am bad at web design.
kixelated··on Replacing HLS/Dash – Live Mass Fanout with Media over QUIC
QUIC supports self-signed certs if LetsEncrypt is too corporate for you. WebTransport lets you specify the certificate fingerprint (sha256) much like WebRTC, although it does enforce that the certificate is valid for <14 days so it will need to be ephemeral.
kixelated··on Replacing HLS/Dash – Live Mass Fanout with Media over QUIC
I'm glad you liked it.

> A client can theoretically detect a bandwidth fall (or even guess it) while loading a segment, abort its request (which may close the TCP socket, event that then may be processed server-side, or not), and directly switch to a 360p segment instead (or even a lower quality). In any case, you don't "need to" wait for a request to finish before starting another.

HESP works like that as far as I understand. The problem is that dialing a new TCP/TLS connection is expensive and has an initial congestion control window (slow-start). You would need to have a second connection warmed and ready to go, which is something you can do in the browser as HTTP abstracts away connections.

HTTP/3 gives you the ability to cancel requests without this penalty though, so you could utilize it if you can detect the HTTP version. Canceling HTTP/1 requests especially during congestion will never work through.

Oh and predicting congestion is virtually impossible, ESPECIALLY on the receiver and in application space. The server also has incentive to keep the TCP socket full to maximize throughput and minimize context switching.

> From this, I'm under the impression that this article only represents the point of view of applications where latency is the most important aspect by far, like twitch I suppose, but I found that this is not a generality for companies relying on live media.

Yeah, I probably should have went into more detail but MoQ also uses a configurable buffer size. Basically media is delivered based on importance, and if a frame is not delivered in X seconds then the player skips over it. You can make X quite large or quite small depending on your preferences, without altering the server behavior.

> But perhaps another solution here may be to update DASH/HLS or exploit some of its features in some ways to reduce that issue. As you wrote about giving more control to the server, both standards do not seem totally against making the server-side more in-control in some specific cases, especially lately with features like content-steering.

A server side bandwidth estimate absolutely helps. My implementation at Twitch went a step further and used server-side ABR to great effect.

Ultimately, the sender sets the maximum number of bytes allowed in flight (ex. BBR). By also making the receiver independently determine that limit, you can only end up with a sub-optimal split brain decision. The tricky part is finding the right balance between smart client and smart server.

kixelated··on Replacing HLS/Dash – Live Mass Fanout with Media over QUIC
QUIC is a major functionality improvement, while IPv6 is a capacity improvement. You can do some extremely cool things with QUIC that definitely deserves a post of its own.
kixelated··on Replacing HLS/Dash – Live Mass Fanout with Media over QUIC
ABR is absolutely required for distribution. MoQ also supports ABR, but additionally gives you the ability to also drop the tail of a GoP if a rendition switch is too slow, or no lower rendition exists.

As for maintaining existing standards, it depends on your goals. If you're not trying to push boundaries then absolutely, HLS/DASH is great for quickly getting off the ground. But if you're looking for something in-between HLS and WebRTC then MoQ is compelling.

kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
Yeah, if you're using WebRTC only for data channels, then 100% you should switch to WebTransport with all due haste. Once Safari adds support of course.
kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
Glad you liked it!

It's really difficult to compare the latency of different protocols because it depends on the network conditions.

If you assume flawless connectivity, then real-time latency is trivial to achieve. Pipe frames over TCP like RTMP and bam, you've done it. It's almost meaningless to compare the best-case latency.

The important part is determining how a protocol behaves during congestion. LL-HLS doesn't do great in that regard; frankly it will perform worse than RTMP if that's our yardstick because of head-of-line blocking, large fragments, and the playlist in the hot path. Twitch uses a fork of HLS called LHLS which should have lower latency, but we were still seeing 3-5s in some parts of the world.

But yeah, P90 matters more than P10 when it comes to latency. One late frame ruins the broth. A real-time protocol needs a plan to avoid queues at all costs and that's just difficult with TCP.

kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
Absolutely!

I'm doing that in my implementation: the main thread immediately transfers each incoming QUIC stream to a WebWorker, which then reads/decodes the container/codec and renders via OffscreenCanvas.

I didn't realize that DataChannels were main thread only. That's good to know!

kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
Eric Kinnear (linked post; Apple) is the author of the HTTP/2 fallback for WebTransport, so it's safe to say that WebTransport will be available in WebKit at some point.
kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
I'm using AudioWorklet and SharedArrayBuffer. Here's my code: https://github.com/kixelated/moq-js/tree/main/lib/playback/w...

It's just a lot of work to get everything right. It's kind of working, but I removed synchronization because the signaling between the WebWorker and AudioWorklet got too convoluted. It all makes sense; I just wish there was an easier way to emit audio.

While you're here, how difficult would it be to implement echo cancellation? The current demo is uni-directional but we'll need to make it bi-directional for conferencing.

kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
I maintained the Flash video player at Twitch until I couldn't take it any longer and created an HTML5 player. Flash was a mess. :)
kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
Thanks for WebCodecs!

I'm still just trying to get A/V sync working properly because WebAudio makes things annoying. WebCodecs itself is great; I love the simplicity.

kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
The protocol can do it, but libsctp (used by browsers) was not coalescing ACKs. I'm not sure if it has been fixed yet.
kixelated··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
Are you referencing this line? > 2x the packets, because libsctp immediately ACKs every “datagram”.

The section is about data channels, which uses SCTP and is ACK-based. Yes, you can use RTP with NACK and/or FEC with the media stack, but not with the data stack.

← PreviousPage 2 of 3Next →