wesbos / R2-video-streaming

Streaming video on Cloudflare R2

Repository from Github https://github.comwesbos/R2-video-streamingRepository from Github https://github.comwesbos/R2-video-streaming

HLS Video Transcoder

A proof of concept script to transcode video.

There are three parts.

Video Chunker

A typescript script to programatically transcode video into:

  1. chunked into 4 second chunks
  2. available in multiple resolutions each with their own .m3u8 file
  3. a master .m3u8 file

Video Viewer

A sample HTML file using Media Chrome and hls-video-element to stream and adapt resolution of the above transcoded video

Cloudflare R2 Deployment

A script to sync the output video files to Cloudflare R2. Currently this script is just rclone copy ./output/dbngin/ r2demo:streaming-video/dbngin

Cloudflare Worker

TODO. A worker to:

  1. Limit access to video files
  2. Enable CDN cache for the video chunks so it will be fast around the wold

About

Streaming video on Cloudflare R2


Languages

Language:TypeScript 73.2%Language:HTML 26.8%