Skip to content

Prioritize media loading #10

@egnor

Description

@egnor

Right now, all media loading is done in parallel, which isn't ideal and can result in unnecessary dropped frames (observed by @aubilenon).

In an ideal world:

  • high priority: media frames that will definitely be displayed soon
  • medium priority: media frames that will be displayed later
  • lower priority: media frames that are being loaded speculatively?
  • lower priority: media frames that will be "displayed" but with zero opacity?

But, speculative loads (pins) should probably be able to specify their relative priority (based on likelihood of being used)?

This is all a little tricky:

  • it's not clear how to balance priority based on time-to-display and likelihood-of-display
  • it's not clear what the best mix of parallel and sequential loading is to use hardware most efficiently
  • right now, each frame loader runs in its own thread, they would need to coordinate (or maybe change threading model)
  • under the covers, libav (ffmpeg) and the kernel do their own scheduling of loading & decoding activity
  • right now, all load requests are collapsed into a set of media-segments-of-interest; priority will need to be added in

For reference, this is my understanding of thread usage in libav: http://ffmpeg.org/pipermail/libav-user/2022-February/012969.html
(Note that nobody replied, so I have no idea how accurate this is.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions