Skip to content

Conversation

@Queuecumber
Copy link
Contributor

This PR exposes the AVIndexEntry structure and adds a pythonic container for it

The AVIndexEntry structure indexes (some or all) frames in a file, the exact behavior is demuxer dependent.

The primary use case for this is fast multi-seek loops where a video is decoded at a lower framerate than it should be displayed at.

For example if you want to decode every Nth frame, you can use search_timestamp to figure out if there is a keyframe between the frame you are currently at and the frame you want to decode and seek appropriately. If you always seek you risk seeking backwards and if you never seek you will decode a bunch of frames you didn't need.

Some relevant docs from ffmpeg:

Questions:

  1. Do the unit tests look sufficient? I tried to test some "semantics" of different containers as well as the raw functionality we're adding
  2. Should there be more documentation?

Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
Signed-off-by: Max Ehrlich <queuecumber@protonmail.com>
@WyattBlue WyattBlue merged commit f462b75 into PyAV-Org:main Jan 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants