News for hackers. Stuff that matters.
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by foota on Sunday May 19, 2024 @04:14PM (#40409451)
I'm guessing live video looks a lot different from a more static video site. I think encoding and storage are both quite expensive. You want to encode videos that are likely to be watched in the most efficient ways possible to reduce network bandwidth usage, and every video needs at least some encoding.

Based on some power laws etc., I would guess most videos have only a handful of views, so storing them forever and the cost to encode them initially is probably significant.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by timr on Sunday May 19, 2024 @07:15PM (#40410469)
Encoding and storage aren't significant, relative to the bandwidth costs. Bandwidth is the high order bit.

The primary difference between live and static video is the bursts -- get to a certain scale as a static video provider, and you can roughly estimate your bandwidth 95th percentiles. But one big live event can blow you out of the water, and push you over into very expensive tiers that will kill your economics.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by foota on Sunday May 19, 2024 @08:01PM (#40410696)
If they're not significant, then why does youtube build ASICs for doing video encoding? See e.g., https://arstechnica.com/gadgets/2021/04/youtube-is-now-build...
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by oneplane on Sunday May 19, 2024 @08:08PM (#40410739)
Because significance varies, as does optimisation. At YouTube scale it might matter more, or the benefits might be bigger, even if just to save some energy or carbon footprint (and even that might be just for a compliance or marketing line).
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by jupp0r on Sunday May 19, 2024 @08:08PM (#40410735)
Because when you are Youtube, even relatively marginal cost improvements can be huge in absolute. There is also the UX of having to wait X minutes for an uploaded video to be ready that is improved by this.
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by cebert on Sunday May 19, 2024 @08:08PM (#40410737)
Doing so wouldn’t hurt and would make a sizable impact at the scale of Google?
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by danielheath on Sunday May 19, 2024 @08:45PM (#40410960)
AFAICT, the answer to "why does Google do X" is basically always "because someone needed a launch to point at when they're up for promotion".
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by westurner on Sunday May 19, 2024 @09:25PM (#40411157)
VA-API, NVENC,

nvenc > See also: https://en.wikipedia.org/wiki/Nvidia_NVENC#See_also

NVIDIA Video Codec SDK v12.1 > NVENC Application Note: https://docs.nvidia.com/video-technologies/video-codec-sdk/1... :

> NVENC Capabilities: encoding for H.264, HEVC 8-bit, HEVC 10-bit, AV1 8-bit and AV1 10-bit. This includes motion estimation and mode decision, motion compensation and residual coding, and entropy coding. It can also be used to generate motion vectors between two frames, which are useful for applications such as depth estimation, frame interpolation, encoding using other codecs not supported by NVENC, or hybrid encoding wherein motion estimation is performed by NVENC and the rest of the encoding is handled elsewhere in the system. These operations are hardware accelerated by a dedicated block on GPU silicon die. NVENCODE APIs provide the necessary knobs to utilize the hardware encoding capabilities.

FFMPEG > Platform [hw video encoder] API Availability table: https://trac.ffmpeg.org/wiki/HWAccelIntro#PlatformAPIAvailab... :

> AMF, NVENC/NVDEC/CUVID (CUDA, cuda-nvcc and libnpp) (NVIDIA), VCE (AMD), libmfx (Intel), MediaCodec, Media Foundation, MMAL, OpenMAX, RockChip MPP, V4L2 M2M, VA-API (Intel), Video Toolbox, Vulkan

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by djtango on Sunday May 19, 2024 @11:31PM (#40411992)
If you make a billion, a 1% saving is 10 million. You can hire and fund a lot of activity with 10 million.

If you make 1 million, 10k isn't going to go very far towards paying devs to save you 1%

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by thaumasiotes on Monday May 20, 2024 @01:55AM (#40412676)
> But one big live event can blow you out of the water, and push you over into very expensive tiers that will kill your economics.

But if you're broadcasting something live and what's killing you is that everyone wants to watch it at the same time... wouldn't you serve it P2P so that everyone is downloading it from each other rather than you?

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by vaylian on Monday May 20, 2024 @03:00AM (#40413024)
I doubt that live(!) P2P video sharing would work. You will have some users who get the video stream directly from you. These primary peers will then need to relay the same data through their tiny consumer DSL line (slow upload!) to secondary peers. These secondary peers will have a noticeable lag. It will get even worse when you have tertiary peers.
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by oliwarner on Monday May 20, 2024 @03:36AM (#40413189)
One great thing about P2P is you can provide more peers. You can surge inexpensive machines near your market and drastically reduce the load on your main servers.

And home connections —while still largely asymmetric— are much faster than they used to be. Having 10mbps up means one client can serve two more. And there's a lot more FTTP with 100-1000mbps up too. These really make a difference when you have a large swarm.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by IanCal on Monday May 20, 2024 @04:13AM (#40413387)
A problem with live is that everyone wants the content at the same time. One client can only serve two more after it has the content. Any drop in connection is also very disruptive because you don't have a big buffer and everyone wants the content now.

A place this could work is streaming a conference, live-ish is the goal and the producers aren't rich. Sports would be the worst case.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by thaumasiotes on Monday May 20, 2024 @05:16AM (#40413661)
> A problem with live is that everyone wants the content at the same time.

Isn't the point of the P2P approach that it gets better the more this is true?

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by IanCal on Monday May 20, 2024 @06:13AM (#40413943)
No, not really on those timescales. If it's about a popular show that's released the whole season today, yeah absolutely. Pulling ep1 from my neighbour while they watch ep2 makes sense.

It doesn't really work for something you want to watch simultaneously and reliably. I have to wait for my neighbour to get the chunk I want, then I get it. If they got it from someone else, we form a bigger chain, and then you have all the broadcasting etc to figure out who to actually get a chunk of video from.

Hearing the street cheer while I watch my national team captain take a runup for a penalty is really quite bad.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by thaumasiotes on Monday May 20, 2024 @04:43AM (#40413527)
But the problem is that you have a gigantic audience. Many of them will make effective primary peers. If that weren't true, you wouldn't have a problem in the first place.
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by toast0 on Monday May 20, 2024 @04:35AM (#40413496)
P2P is going to be a big challenge for tons of reasons. Set top boxes aren't going to play. Lots of people are behind NATs that make it hard to connect. Mobile is battery sensitive and sending to peers is going to eat more battery. Some users pay for every byte they send, and they won't want to pay for you to save operating costs. Plus all the other stuff everyone said about latency.
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by ValdikSS on Monday May 20, 2024 @07:35PM (#40421963)
FYI, apparently doing that (making a P2P system to offload your links to the users) is illegal in China.

>Due to the proliferation of P2P CDN (or PCDN for short), which includes a large amount of home broadband uplink bandwidth at the central office, increasing operational pressure, and cannibalizing the traditional CDN business revenue share of telecom operators […] access is technically detected If the user's traffic volume exceeds a certain threshold, the speed will be limited or even the user's Internet access service will be interrupted. If the user finds a complaint, the user will be required to ensure that he or she has not used or removed the PCDN corresponding access device in exchange for restoring normal access. access services; thereby preventing access users from overusing home broadband and infringing on the interests of telecom operators.

https://zh.wikipedia.org/wiki/內容傳遞網路#P2P_CDN

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by donavanm on Sunday May 19, 2024 @09:35PM (#40411216)
Live has a _huge_ advantage in the storage side. In a purely "live" sense all of the content is temporally synchronised; every viewer is requesting approximately the same segments at the same time. Store the current chunks, and the last few minutes of seek time, in memory and put out on the wire to all of the viewers. Twitch talked about this a bit just before/after the AMZN acquisition.

In a prerecorded video CDN managing that catalog is a PITA and does drive meaningful infrastructure cost. You need the "right" content to be in the correct location for low cost peering/transit/distribution, on the correct media for the total throughput:size, in the optimal number of encodings for efficient/quality playback, etc. This job is a lot easier when the provider controls the catalog, and has a limited catalog size. See some of the OpenConnect talks where they're "preloading" content offpeak to optimize IO allocation on the appliances. It was an absolute nightmare to try and manage with a many PB catalog with 3P content that service didnt control the release/popularity of.

Edit: source, principal at AWS and was responsible for a lot of the prime video delivery once upon a time.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by andsoitis on Sunday May 19, 2024 @11:12PM (#40411859)
> Live has a _huge_ advantage in the storage side. In a purely "live" sense all of the content is temporally synchronised; every viewer is requesting approximately the same segments at the same time. Store the current chunks, and the last few minutes of seek time, in memory and put out on the wire to all of the viewers. Twitch talked about this a bit just before/after the AMZN acquisition.

With Netflix's Live events, you can seek anywhere up to time zero, not just the last few minutes.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by adamomada on Sunday May 19, 2024 @11:28PM (#40411977)
Apple does the same with the MLS soccer matches. I think you’re conflating “live” with “live and available on-demand anytime thereafter”

Interestingly enough the Apple and I assume Netflix live streams come from the colo equipment in your ISP. So each box has their own recording as it happens.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by gbalduzzi on Monday May 20, 2024 @10:46AM (#40416097)
Netflix already solved the on demand streaming at scale though, for them it is harder to do live events given the fact they are new to it
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by flutas on Monday May 20, 2024 @01:04AM (#40412421)
> Live has a _huge_ advantage in the storage side. In a purely "live" sense all of the content is temporally synchronised; every viewer is requesting approximately the same segments at the same time.

Used to work at a live-streaming company on our stream infra.

I mostly disagree, unless it's pure live no replay at all and no closely timed events required. Usually live platforms will offer some sort of a VOD (VODs, Replays, Rebroadcasts), all of which will require a storage solution. Couple that in with the fact that anything requiring more complex timing than "show video live~ish" can get messy fast with sync and latency issues.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by donavanm on Monday May 20, 2024 @05:47AM (#40413815)
Yes, i was referring to “live only” and not VOD/“low latency hls” cases. This is a decade ago but my examples off hand are things like video game, game shows, and contests. Was definitely a category, infrastructure looked a lot closer to multicastish RTMP than todays dynamic manifest mpeg segment CDNs.

Edit: the above notwithstanding live sports etc is _still_ better on the storage side as viewers are so heavily synchronized. Lots of nice cache efficiencies when everyone is watching the same content at the same time.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by amadeuspagel on Monday May 20, 2024 @06:57AM (#40414168)
Does the recommendation algorithm account for this? If I'm in a specific place, am I more likely to see content that's already in the right data center?
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by donavanm on Monday May 20, 2024 @08:30AM (#40414750)
I cant speak to content recommendations; I worked on the “backend” infrastructure storing bytes and delivering bits. But in that realm yes absolutely. Any CDNs #1 job is to route an end user request to a nearby (or otherwise optimal) datacenter, usually via DNS response. For streaming content I believe “everyone” is doing (part of) this at the streaming client/API layer these days. When you request to start playing the returned url will include/encode hints that help the CDN to send your request to the correct part of the CDN that holds your requested catalog title. ie CDNs arent homogenous and not all content will be stored in every edge location. The service API servers may/will even allocate different requests to different CDNs. eg the streaming service might use any combination of 1P (OpenConnect, CloudFront) and 3P (limelight, akamai, level 3) CDNs.
Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by thaumasiotes on Monday May 20, 2024 @01:51AM (#40412656)
> I think encoding and storage are both quite expensive. You want to encode videos that are likely to be watched in the most efficient ways possible to reduce network bandwidth usage, and every video needs at least some encoding.

The minimum possible expenditure on encoding is "we require videos to be encoded like so; here's our help page on how you can do that".

It's not even slightly expensive.

Re:Ask HN: Video streaming is expensive yet YouTube "seems" ... by raydev on Monday May 20, 2024 @02:55PM (#40418820)
There's still a "live" aspect to any YouTube video, though, since you can change the quality that's sent to you at any time.