A question about Cloudflare Stream
Hello, community, this is my first post here and I have a question about Cloudflare Stream, more precisely preloading options I can or can't control.
I have a video news site using Sanity CMS + MUX integration and 11ty SSG website on Cloudflare Pages. I like MUX but I'm not sure I could keep up with their billing policies, and this is where my headaches are coming from - MUX preloads the whole video while playing, which means that if I look first 30 seconds of a 5-minute long video and go away from that webpage, I will be charged for the whole video since 30 seconds is about enough for 5-minute long video to completely preloads.
That completely messes up my monetization with Pre-roll, Mid-Roll, and Post-Roll Video Ads since Mid-Roll and Post-Roll Ads are not even triggered.
Finally my question - can I control how Cloudflare Stream preloads videos? On a majority of streaming services, the video is preloaded only about 20-30 seconds in advance. I never saw that the whole movie gets preloaded while I'm watching it. Is that possible to get with Cloudflare Stream? If yes I'm immediately migrating from MUX.
Cheers.
10 Replies
You cant customise it but, Stream doesn't preload the whole video, only a few segments in advance which is probably 30ish seconds maybe more, and if you pause or leave you only are charged up to the part that was preloaded rather than the whole length. It's kinda crazy that MUX does that...
Actually I say you can't customise it but what I meant is, you cant customise it with Streams default player, if you use the manifest in a custom player you can probably do whatever you want
Thank you so much @Erisa for your time and effort, I appreciate it.
i did a little test by pausing a 2 hour video 1 second in to it and it loaded 11 segments total before stopping, not 100% sure how big a segment is though. when i hit play it starts loading more segments as they become needed so the playback has a buffer of ~10 segments at all times
for some perspective the full 2h video has thousands of segments
2,464 segments for 2:02:10
and even if i skip to the end of the video it only loads those segments at that point at the end, not any in the middle
that video length is 7,330 seconds so that means a segment is 3 seconds. so since the buffer is 10 segments you'd have only 30 seconds of extra play time loaded in advance
which seems to meet your expectations/needs
i will note again though that this behaviour may change if you use a custom player, so if youre having issues with a custom player i'd look into changing that behaviour on the player side if you can
Thank you again @Erisa for going beyond and above.
MUX preloads 50 segments from the start of the video that has 68 segments, so not the whole video but very near.
if theyre also using 3 seconds for segment length then thats 3 minutes buffer which seems a bit unnecessary
Video is cca 300 sec and with 68 segments it cca 4.5 seconds per segment
Still seems like an unnecessarily large buffer
Not if you're at the charging end of the stick 🙂
😆
Thanx again @Erisa