Remix.run Logo
bob1029 3 days ago

I've been working on a custom media server that does streaming, block-based storage on top of S3, with the local disk being used as a cache.

I implemented an override of Stream in C# that can be passed directly to an HttpContext file response. This gives me range-based response support on top of cached S3 media blocks for free. The front-end uses ffmpeg to do a quick transcode on uploads to guarantee fast start of mp4 content in my html video elements.

The cool thing with having a reasonable sized cache is that you can switch to glacier infrequent access tier (i.e., the one intended for quarterly reporting) and save a lot of money on storage. The other fun bit is that it is shared across all clients on the LAN, so if someone watches a show before you, you'll just read it from local during your run through.

For me, I don't need a lot of fancy bullshit in a media solution. An un-styled web player that just works on my MacBook is pretty much the only client support I care about. My media library currently shows up as a monolithic <table> without any pagination. Time to first frame on an uncached video click is well under a second on a 1gbps fiber connection using 32 megabyte block size to US-EAST-1 from Texas.

kaynyn1 3 days ago | parent | next [-]

What are egress expenses though. I really want to go this way, but worried about the costs during egress data transfer

bob1029 3 days ago | parent [-]

Egress isn't that bad. It would be like paying for 1~2 streaming subscriptions if you watched several gigabytes of fresh content per day every day (i.e., zero cache hits).

dardeaup 3 days ago | parent | prev [-]

"block-based storage on top of S3"

What does this buy you? It seems like an object storage system would provide everything you need on its own.

bob1029 3 days ago | parent [-]

Encryption is the reason I don't use the provider's range based support. The server encrypts each block using a local key before it is stored in S3.