MpegFlowBlogBack to home
← Stack integrations·storage

MpegFlow with Cloudflare R2: zero-egress video storage

How MpegFlow integrates with Cloudflare R2 — the S3-compatible API, zero-egress economics for CDN delivery, and the multi-cloud benefits over AWS S3 lock-in.

Stack integration · Cloudflare R2·Cloudflare R2 ↗

Cloudflare R2 is the S3-compatible object store with zero egress fees — a meaningful cost lever for video workloads where egress to CDN typically dominates the storage bill. R2 pairs naturally with Cloudflare's CDN (no egress between R2 and Cloudflare), and works as a multi-cloud play to reduce AWS lock-in. MpegFlow integrates with R2 via the standard S3 protocol; the strict-broker security pattern is identical.

How the integration works

R2 implements the S3 API, so MpegFlow's coordinator uses the same presigned URL generation logic as AWS S3 — pointed at R2 endpoints (e.g., https://<account-id>.r2.cloudflarestorage.com). Workers download mezzanine and upload outputs via R2 presigned URLs; they hold zero credentials. The integration is byte-for-byte identical to S3 from the worker's perspective.

Common patterns

  • CDN-resident workflows for zero egress

    Encode → R2 → Cloudflare CDN delivery → end users. No egress from R2 to Cloudflare's CDN, no egress from Cloudflare to end users (covered by your bandwidth plan). The whole pipeline post-encode is essentially zero variable cost on bandwidth.

  • Multi-cloud with R2 + S3

    For multi-cloud architectures, pair R2 (zero-egress CDN delivery) with S3 (mezzanine storage in AWS for proximity to existing pipelines). Replication via the Cloudflare Workers SuperSlurper or rclone keeps the two in sync.

  • Sovereign-cloud requirements

    For workloads where AWS data-residency is a problem (specific EU regulators, sovereign-cloud requirements), R2's data-residency model (Jurisdiction option) can satisfy compliance where S3 cannot. Talk to legal before committing.

  • Cost calibration for high-egress workflows

    Egress is where R2 pays back the migration cost. A workflow encoding 1M minutes/month and serving 10M hours/month of video has ~5 PB of egress. R2 → Cloudflare CDN is $0/GB; S3 → CloudFront is ~$0.085/GB after free tier. The arithmetic for high-egress is dramatic.

Pitfalls

  1. R2 is S3-compatible but not byte-for-byte: certain S3 features (Object Lock, requester-pays) don't exist in R2. Test your specific workflow before assuming full compatibility.
  2. R2 egress to non-Cloudflare destinations is metered: only egress to Cloudflare's edge is free. Don't assume zero egress for cross-cloud workflows.
  3. R2 region selection is automatic (no explicit region); for sovereign-cloud requirements use the Jurisdiction option (EU, FedRAMP) instead.
  4. R2 throughput limits are different from S3: per-bucket request rates and parallel-upload limits don't map exactly. Profile for your workload.
  5. Cloudflare account billing for R2 is separate from your AWS account billing — operationally meaningful for finance + procurement teams.

At production scale

R2 is well-suited for high-egress video workflows because the egress is the dominant cost in production. Storage pricing is comparable to S3 (~$0.015/GB/month vs S3's ~$0.023/GB/month). Request pricing is also competitive ($0.36/M Class A operations, $0.36/M Class B operations after free tier — typically lower than S3 for video workloads). The migration cost from S3 to R2 is non-trivial for petabyte-scale archives, but the egress savings typically pay back within 6-12 months for high-traffic services.

Topics
  • cloudflare
  • r2
  • storage
  • integration
  • multi-cloud
Building this stack?

Talk to us about your specific shape.

The integration patterns above cover most production deployments. If your shape is different — sovereign-cloud, regulated workloads, or scale that needs custom routing — beta cohort design partners get founder-direct help with the integration.

Apply Other integrations
© 2026 MpegFlow, Inc. · Trust & complianceAll systems nominal·StatusPrivacy