Description
🚀 The feature
We have had several request for the ability for VideoDecoder
to accept an external frame index upon startup. That is, in exact mode, we build up a frame index which tells us the mapping between frame indices and pts. If users could provide that index to us, we could be in exact mode but not have to scan the entire file at startup. (We would, however, be the the mercy of the accuracy of the external index.)
Motivation, pitch
The main motivation is performance. There is potentially less need for this feature now that we have approximate mode (#427), which also avoids scanning the entire file. But the combination of receiving an external index and exact mode could perhaps yield the best of both worlds: exact seeks and fast startup.
The reason this comes up is that in many environments, videos are pre-processed before being used for training and inference. Creating and storing the external index for a particular video would be relatively low-cost, and it would be paid once.