Hi all,
First of all, please remove this post if it’s no appropriate for the forum. I am using Elixir / Phoenix to power my app and some libraries might be available in Elixir to help me with what I’m doing, but the similarities stop there.
I run an e-sports coaching app. It allows coaches to create their own website and have users upload videos to it for feedback. Coaches can comment at various points in the video with what you’re doing wrong / right. If this is a bit hard to conceptualize (I don’t blame you!) a good example of once of the coaches using the system is https://kilk.vodon.gg/
I’m at the tail end of a fairly reasonable rewrite that was required to enable a few features that weren’t possible in V1 and that rewrite required me to shift the video hosting from YouTube to Cloudflare Stream. Cloudflare Stream is performing well but I’m a little nervous with the pricing around it. I’m also not quite sure if it’s a 100% fit with what I want to do.
I already use Digital Ocean’s Spaces feature for hosting avatars and other images uploaded from the site and I’m thinking about using it for video delivery. However, I’m not quite up to speed on what’s required for modern video hosting and I want to make sure that I’m fully understanding things before I start to write any code.
-
Hosting the video on Spaces would mean I give up things like Stream’s automatic transcoding for different formats and HLS/DASH delivery. I think that’s actually ok, I’m happy to deliver just one resolution for all users (ideally 1080 or 4k, 30 or 60fps). This would mean giving up adaptive bitrates too. However, I’m happy with the video not downgrading for slow connections even if it means additional buffering. Visual fidelity is key in my content and delivering a blurry video is worse than no video.
-
As I understand the modern HTML video tag, I need to generate a couple of different formats to support the majority of browsers, WebM/VP8 and MP4/H.264 (although it appears that Safari now has support for WebM so I might be able to get away with just one encoding?)
-
I want to understand how I would model the flow of uploads from a user. Currently with Cloudflare Stream I can perform a client upload where the users browser sends the data directly to Cloudflare and I simply wait on a webhook to tell me that the video is ready to be served. With a Spaces approach am I right in thinking it’s going to go something like:
a. Client fetches a presigned URL from the app to perform the upload
b. Client performs the upload directly to spaces
c. Client tells me that the upload is complete
d. I perform some kind of transcoding job on the uploaded video.
e. Once transcoding is complete, I update the DB record to indicate the video is ready to be served.
- Step D is a bit unknown for me as well. I assume I have to have a tool that would download the video from spaces, transcode to the required format(s) and upload again to spaces. Once this is complete I’d then inform that main service that the video is ready for streaming.
This step sounds hard. If I’m thinking about it correctly, can any recommend a library, service, application that is designed for doing this.
- Aside from losing the adaptive bitstream of the video by hosting on Spaces, what else might I be giving up that I don’t expect? Does “seeking” in the video still work for example?