-
Notifications
You must be signed in to change notification settings - Fork 6
Add Cars/Fastly blog posts #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kixelated
wants to merge
4
commits into
main
Choose a base branch
from
fastly-blogs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,230 @@ | ||
| --- | ||
| layout: "@/layouts/global.astro" | ||
| title: "MoQ is for the Cars" | ||
| author: kixelated | ||
| description: MoQ is like Lightning McQueen. But it's a live networking protocol, not an animatronic sports car in a fictional movie produced by Pixar Animation Studios for Walt Disney Pictures. | ||
| cover: "/blog/cars2/queen.png" | ||
| date: 2026-06-08 | ||
| --- | ||
|
|
||
| # MoQ for the Cars | ||
| sup | ||
|
|
||
| This is an unexpected collaboration with Fastly. | ||
| They liked the MoQ blog posts and actually sponsored me to make a [hinged version](https://www.fastly.com/blog/moq-in-the-fast-lane), cross-posted to their **OFFICIAL BLOG**. | ||
| Go read that one instead if my usual cringe is too much. | ||
|
|
||
| Roses are red. 🌹 | ||
| Sports cars be too. 🚗 | ||
| MoQ be fast. 🚀 | ||
| Cars 2™ is a 2011 American animated comedy film produced by Pixar Animation Studios for Walt Disney Pictures. | ||
|
|
||
| <figure> | ||
|  | ||
| <figcaption>starring Lightning McQueen, the devilishly handsome race car</figcaption> | ||
| </figure> | ||
|
|
||
| ## Cars 2: Electric Boogaloo | ||
| Lightning McQueen is racing around the track. | ||
| The spectators in the stands are honking wild. | ||
| **HONK HONK** | ||
|
|
||
| But we don't care about the stans in the stands. | ||
| We care about the cars in their garage? | ||
| The ones willing to pay big bucks if we can transmit the **LOUD CARS DO CIRCLES** race over the internet. | ||
| Or whatever currency cars use, IDK I'm not a lore expert. | ||
|
|
||
| The answer for the last decade has been HLS/DASH. | ||
| Split the media into fragments, anywhere from 0.5s to 4s long, and serve them over HTTP. | ||
| It's boring but it works. | ||
|
|
||
| But just like the Mini Cooper, [there are a few short-comings](https://moq.dev/blog/replacing-hls-dash). | ||
| - Flushing media in batches **adds latency** (0.5s to 4s). | ||
| - Network congestion causes head-of-line blocking and **the spinny boye**. | ||
| - Every second of the spinny boye means **even more latency**. | ||
|
|
||
| This is why I created MoQ while at Twitch. | ||
| The goal was to make live streams more interactive (and less boring). | ||
| **Stream frames, and occasionally drop instead of blocking.** | ||
|
|
||
| High latency is for losers. | ||
| I always finish first, just like Lightning McQueen. | ||
|
|
||
|
|
||
|
|
||
| ## MoQ for the Fans | ||
| First, I wanted to address the SUV in the room. | ||
| My previous blog post, [You Don't Need It](https://moq.dev/blog/you-dont-need-it/), mentioned that you don't need MoQ for high-quality content. | ||
| It's true, but *as always*, there are exceptions to my shitty opinions. | ||
|
|
||
| But before we disprove one shitty opinion, we need to prove another. | ||
| **Racing is boring**. | ||
|
|
||
| The video footage is **so boring** that the only thing separating two laps is a counter. | ||
| Like yes, sometimes the car goes boom, but there's so much dead air. | ||
| I postulate that you're watching to be part of the story **LIVE**, not to see every millisecond of lap 392 in the Toilet Bowl 500. | ||
|
|
||
| And it might actually be a good use-case for MoQ. | ||
| Because instead of buffering/pausing to load boring content, we can instead skip it to keep latency low. | ||
| It keeps you in the action with **sub-second latency**. | ||
| And milliseconds might be the difference between winning and losing. | ||
|
|
||
| **FUN FACT**: Sports ~betting~ prediction markets are a thing. Degenerate users love lower latency. | ||
|
|
||
| <figure> | ||
|  | ||
| <figcaption>crank that dial</figcaption> | ||
| </figure> | ||
|
|
||
| And before you get your suspension in a twist, MoQ can still provide the same quality/latency you expect from HLS/DASH. | ||
| We just lower the latency floor for the Lightning McQueens out there who want to **WIN**. | ||
|
|
||
|
|
||
| ## MoQ for the Cars | ||
| I originally made MoQ [for the fans](/blog/distribution-at-twitch). | ||
| But people keep running my code on the cars. | ||
| [Or the boats](/blog/on-a-boat). | ||
|
|
||
| TBH, this is the better use-case for MoQ. | ||
|
|
||
| You might have pieced together that I don't watch racing (**boring**) outside of critically acclaimed movies for children. | ||
| Starring Lightning McQueen and his goofy comrades, the cars go fast vroom vroom. | ||
| But when I do see snippets of F1, the camera feeds from the cars are **awful**. | ||
|
|
||
| Me, the uninformed dumbass, has a hunch that it's due to networking. | ||
| There's going to be deadzones or interference or whatever around the track. | ||
| We are bound by the laws of physics, even in the Cars 2 Cinematic Universe. | ||
|
|
||
| > We no can send all bytes. | ||
| \- Lightning McQueen (2011) | ||
|
|
||
| **Boring protocols** like RTP drop packets/frames based on SLAs. | ||
| The publisher gives up (re)transmitting a frame after ~100 milliseconds; then it's gone forever. | ||
| This often shows up as artifacting or tearing or frozen video. | ||
|
|
||
| But **the chad protocol** doesn't give up. | ||
|
|
||
| MoQ publishers **prioritize transmitting the newer stuff** (in dependency order). | ||
| The old stuff gets **queued in RAM** (up to a TTL). | ||
| When bandwidth recovers, we can **backfill old footage** instead of losing it forever. | ||
|
|
||
| Each MoQ subscriber independently decides how long to wait for each frame: | ||
| - The **live stream** might wait for up to 1 second | ||
| - The **instant relay** might wait for up to 10 seconds | ||
| - The **VOD recording** might wait for up to 1 minute. | ||
|
|
||
| So your real-time feed might be lossy af, but the VOD is pristine. | ||
|
|
||
| <figure> | ||
|  | ||
| <figcaption>If I ever own a racing team, it's going to be called The Backfill Boyes</figcaption> | ||
| </figure> | ||
|
|
||
| The packets may have given up. But Lightning McQueen never gives up. | ||
| He always finishes first and the crowd goes **HONK HONK**. | ||
|
|
||
|
|
||
| ## MoQ for the Robots | ||
| We're closer to the Cars Cinematic Universe than we want to admit. | ||
| Humans are a dying breed. | ||
| Like a pug on a hot day. | ||
| **RIP us.** | ||
|
|
||
| Enter the robots. | ||
| They byte. | ||
| And they need networking for their bleeps and bloops. | ||
| It turns out that MoQ works for more than just media: | ||
| - The speedometer? **A live stream**. | ||
| - The steering wheel? **A live stream**. | ||
| - The G force sensor as Lightning McQueen heroically crashes into a wall to save the day? **A live stream**. | ||
|
|
||
| Seriously, there's nothing special about media. | ||
| It's just delta encoded data. | ||
| You can delta encode a lot of things, [even JSON](https://datatracker.ietf.org/doc/html/rfc7386). | ||
| Just like I delta encoded your mom last night. | ||
|
|
||
| <figure> | ||
|  | ||
| <figcaption>yes, a ur mom joke in `<current_year>`</figcaption> | ||
| </figure> | ||
|
|
||
| Networks aren't infinite. | ||
| So we split up media into tracks/groups/frames/packets so pieces can be dropped when needed. | ||
| The reality is that some bytes are just less valuable than others. | ||
| We can't all be Lightning McQueen. | ||
|
|
||
| The hard part is putting humpty back together. | ||
| That's why we use timestamps baybee, they tell us when stuff happened relative to other stuff. | ||
| So do the same thing for metadata. | ||
| Stamp that fellow, using the same clock as media, and send it over the same pipe. | ||
|
|
||
| You can, and should, take the red pill and use MoQ for **EVERYTHING**. | ||
| A single **cooperative** QUIC connection with: `controls > audio > metadata > video` | ||
|
|
||
| **FUN FACT**: MoQ is already being used remotely to pilot drones over Starlink. | ||
| One day we'll be able to remotely drive Lightning McQueen. | ||
|
|
||
| And yes, this sounds simple but it's something WebRTC completely botches. | ||
| You have to use a separate connection for metadata and timestamps aren't exposed in the browser. | ||
|
|
||
|
|
||
| ## MoQ for the Track | ||
| We're not done yet. | ||
| Sit back in your seat. | ||
| Fasten that seatbelt. | ||
| It's the law, and I'm the sheriff from the critically acclaimed movie Cars 2. | ||
|
|
||
| Yeah I know the joke is overdone. | ||
| Give me a pitty chuckle, we're almost done. | ||
|
|
||
| If more than one broadcast studio wants footage of Lightning McQueen's tailpipe, we don't want to transmit multiple copies. | ||
| Our satellite truck is expensive and has a limited bandwidth budget. | ||
|
|
||
| And what if none of the broadcast studios actually want that hot, smokey, tailpipe footage? | ||
| Do we even want to transmit it, or is it just a waste of bandwidth? | ||
| With all of this data swirling around the track, there has to be some way to organize it. | ||
|
|
||
| Enter stage right: **moq-relay** | ||
|
|
||
| It's a simple proxy that connects **1 publisher** with **N subscribers** (per broadcast/track). | ||
| When **moq-relay** instances connect to each other, they automatically form a cluster. | ||
| It handles discovery, routing, and proxying. | ||
|
|
||
| You can host it yourself [and/or pay me](https://pro.moq.dev). For example: | ||
| - **Lightning McQueen** connects to a self-hosted moq-relay at `192.168.420.69`. | ||
| - **moq-relay** is run with `--cluster-connect https://cdn.moq.dev/cars2`. | ||
| - **Studio clients** (or a relay!) connects to `https://cdn.moq.dev/cars2`. | ||
|
|
||
| Just like a tinder hookup, there's a match and now you're the sub. | ||
| Any broadcasts published by Lightning McQueen are automatically available to all relays, potentially proxied through multiple hops. | ||
|
|
||
| And only one copy is ever transmitted between each **moq-relay** instance, regardless of the number of downstream subscribers. | ||
| This is known colloquially as "big deal" when flakey venue internet and expensive satellite trucks are involved. | ||
| Run a self-hosted relay at each track, aggregate all of the feeds automatically, and publish them to a CDN. | ||
|
|
||
| <figure> | ||
|  | ||
| <figcaption>literally infinite viewers from a single, semi-reliable feed</figcaption> | ||
| </figure> | ||
|
|
||
| And there's no limit to the number of connections you can establish. | ||
| [moq-lite](https://doc.moq.dev/concept/layer/moq-lite.html) routes each subscription over the shortest path. | ||
| Go ahead, connect to `cdn.moq.dev` and `cloudflare.mediaoverquic.com` at the same time; they sit idle until someone subscribes. | ||
|
|
||
| It's like swiping right on Lightning McQueen multiple times on alt accounts. | ||
| Don't judge. | ||
|
|
||
|
|
||
| ## Disclaimer | ||
| I hope you've realized by now that I haven't seen the critically acclaimed movie Cars 2. | ||
| That poster of Lightning McQueen on my wall is just part of the gag. | ||
| I stare at it quite often to keep up the ruse. | ||
|
|
||
| Thanks again to Fastly for sponsoring this post. | ||
| They just told me to write something about MoQ, so I did. | ||
| No refunds. | ||
|
|
||
| If you're interested in more Cars 2 lore, join the [fan club](https://discord.gg/FCYF3p99mr) or email me at `me@kixel.me`. | ||
|
|
||
| Written by [@kixelated](mailto:meself@kixel.me). | ||
|  | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spelling: "flakey" should be "flaky".
Line 202 uses the non-standard spelling "flakey" when the correct spelling is "flaky."
🔤 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[grammar] ~202-~202: Ensure spelling is correct
Context: ...s known colloquially as "big deal" when flakey venue internet and expensive satellite ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents