Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

R2 is an insane value proposition. We calculated the cost of moving HLS video delivery to it and unless you are delivering a huge amount of traffic, the costs are far lower. Highly recommend you consider it, assuming you are willing/able to handle appropriate transcoding yourself (if not, Cloudflare has it's Stream product)


What is 'appropriate transcoding'?


Video transcoding: Taking the raw uploaded video and re-encoding it so it is appropriate for being sent to video players over the web.

Typically this takes the form of creating "renditions" of the source video at lower resolutions, but you'll have to decode and re-encode the video to do that, hence transcoding.

Pretty much all video you watch online is delivered using an adaptive bitrate technology like HLS or DASH. That's what allows the video to automatically reduce its resolution if your network can't handle streaming the video without buffering.


Thanks. Our use case is simpler so we only have one variant that gets uploaded and served. However we do not have any associated .m3u8 files, so that was my concern.


Assumedly, implementing the logic yourself for transcoding source content into various encodings on demand.

If you're storing 1080p h265 MP4s in R2 and the client can only support 480p h264 it'll request that but you need to "appropriately transcode" for them.

The alternative is a service that does this for you, like Cloudflare Stream. Upload source video, service handles transcoding and integrates easily with standard video players with HLS or Dash.

Just in case: I am not OP


I don't think Cloudflare's free egress covers video storage and retrieval

https://community.cloudflare.com/t/can-we-serve-video-with-r...

Please correct me if I am mistaken; also R2 is not a CDN, and more like s3 in terms of delivering from the edge

No issue with your comment specifically, just wondering if you know. currently using s3+cloudfront for mp4 storage+delivery, and would like to move to something better if possible.


Their terms say https://www.cloudflare.com/service-specific-terms-applicatio...

  Unless you are an Enterprise customer, Cloudflare offers specific Paid Services (e.g., the Developer Platform, Images, and Stream) that you must use in order to serve video and other large files via the CDN
https://www.cloudflare.com/service-specific-terms-developer-...

  The Cloudflare Developer Platform consists of the following Services: (i) Cloudflare Workers, a Service that permits developers to deploy and run encapsulated versions of their proprietary software source code (each a “Workers Script”) on Cloudflare’s edge servers; (ii) Cloudflare Pages, a JAMstack platform for frontend developers to collaborate and deploy websites; (iii) Cloudflare Queues, a managed message queuing service; (iv) Workers KV, D1, Durable Objects, Vectorize, Hyperdrive, and R2, storage offerings used to serve HTML and non-HTML content; and (v) Workers AI, a Service that allows customers to use Cloudflare’s inference infrastructure to invoke select third-party machine learning models (subject to applicable open source licenses or third-party terms of use for such models).
Based on their terms, serving video in R2 should be fine.


> Please correct me if I am mistaken; also R2 is not a CDN, and more like s3 in terms of delivering from the edge

Yes, it uses Cloudflare's edge network and caching infrastructure when you use a custom domain (really the only option because usage of the default domain is very limited). So yes, it's a CDN :-)

https://community.cloudflare.com/t/cdn-support-for-r2/514573

> currently using s3+cloudfront for mp4 storage+delivery, and would like to move to something better if possible.

What I have found is that (A) the egress costs are extreme compared to R2 (remember, R2 does charge per read/write though) but (B) storage is cheaper on S3. You should do a study on your storage and egress, but unless you are storing way more than your egress TB, it's probably a good deal.

Cloudflare also has a mechanism for transparently pulling content from an upstream S3 compatible store into R2. I think it's called Super Slurper iirc


I see, thanks for sharing!

I think given the cost advantage for s3 for storage, it seems almost better to pull from R2 into s3 for long-term storage (some inverse slurper).

It's good to hear though that R2 can singlehandedly match s3+cloudfront; that being said, video delivery is a bit different I'd imagine, even s3+cloudfront is finnicky with range requests etc.


This exactly, although it's exceedingly rare to do it on demand. Typically you do it when the video is first uploaded.

That, and it's usually HLS ABR, more about that on my parent comment.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: