After bug 876148 landed, we load clips one after the other, each with their own timeout. Now we can control the order in which we load them. We can load them sequentialy and the next clip to load can be the clip closest to the video's current time.
Whiteboard: s=20130729 p=1 → s=20130729 p=1 popbetter
From irc, https://sharediego.makes.org/popcorn/18o0_ is a good example of the kind of thing we need to do a better job on. In this case we have 10 separate YouTube clips being loaded, all of which are needed in the first 2mins of the video playback. We actually do load them all, but it can take a long, long time, depending on your connection speed (Rebeccah is reporting times in the minutes). This mostly boils down to how we want to do our ready state logic. Our options include: 1) Fast start, choppy/out-of-sync playback: do no buffering before we begin playing, allow the user to press Play as soon as possible, knowing they'll have to buffer videos during playback. 2) Slow start, smooth playback (what we do now): don't allow the user to press Play until all the clips in the video are playable. 3) Medium start, optimistic preloading for future clips: load only those clips needed in the first N seconds of playback to a playable state. Anything outside N seconds can load in the background as the video progresses. I think we should experiment with 3) and see how it feels with various videos. Depending on the order, number, and proximity of clips, the result will be good or bad. There's no single ready state algorithm that's going to be perfect here, but I think we need to not block so long on startup. Another thing we talked about on irc...it might be a good idea to warn or educate our makers when they create videos like the one above. After you start mixing a lot of clips, you need to know that the limitations of bandwidth, etc. are going to mean that people might have lag or trouble loading it. Kate might have ideas for this (cc'ed).
Created attachment 782741 [details] [review] https://github.com/mozilla/popcorn.webmaker.org/pull/141
Attachment #782741 - Flags: review?(schranz.m)
This actually went pretty well. I ended up doing most of #3 above. I do not do "load only those clips needed in the first N seconds". I kinda want to do that in another ticket. We currently don't even do that given an project with an optimal load, and the above patch is still a pretty huge win without it. Doing it later would just make for another win later :) It is also more involved given the current structure and want some time to think on it. Clips don't really have the best concept of each other right now, only where it needs it. To do this we would have to give them a concept where they currently don't have one, might be easier than I can currently see, but I'm just not there yet. Need to think and play. Let's not hold what I have back from being used. The above patch definitly experiments with #3 no doubt about that. I was getting a fairly huge boost. I'm feeling good about this right now. It also considers where you currently are in playback. I was able to seek to the end, and it would jump to loading the end, and when done that, continue with the sequence until another seek is hit. I was able to do this because it ended up being fairly easy.
Comment on attachment 782741 [details] [review] https://github.com/mozilla/popcorn.webmaker.org/pull/141 I like.
Attachment #782741 - Flags: review?(schranz.m) → review+
Staged: https://github.com/mozilla/popcorn.webmaker.org/commit/526434adbd9b234bf0d5fcd020030ca3ed47faf7 Needs verification.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
With this on staging now, I made fairly similar projects, one on prod and one on staging. prod: https://popcorn.webmaker.org/editor/59863/remix staging: https://popcorn.mofostaging.net/editor/52401/remix The more clips you add to prod, the more chances you increase total load time. With staging, it can play much sooner. Adding more does not change that. Keep in mind this is still a fairly heavy project, and doesn't have bug 893777 yet. Also, there is a possibility a prod project happens to have clips load in an optimized order. Example: if a project is made in a certain way, clips can be saved in the order they are needed for playback. In the above prod project, I have ensured there is a clip at the end saved at the start of the loading order, to ensure we have a delay. Also, try other projects you have already saved on staging, or try other experiments on prod and compare to staging. Let me know what kind of improvements you see.
On prod now. The two projects I have in the previous comment load at the same speed now.
Status: RESOLVED → VERIFIED
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.