scikit-video / scikit-video

Video Processing in Python
http://www.scikit-video.org
BSD 3-Clause "New" or "Revised" License
672 stars 145 forks source link

Load specific index (frame number) range #166

Open horsto opened 2 years ago

horsto commented 2 years ago

What is the most efficient way to, for example, load a snippet of adjacent frames from an .mp4 file (.h264 encoded), defined by frame number from start of the video? I would like to extract frames 1000-1200 for example as numpy array, but not load the whole video into memory or start looping through it from the start.

bjarthur commented 2 years ago

i'd find this feature useful too!

bjarthur commented 2 years ago

pims has a nice interface in this regard: http://soft-matter.github.io/pims/v0.6.1/slicing.html

horsto commented 1 year ago

@bjarthur - indeed, I started working with PIMS, but I find it prohibitively slow when dealing with larg(er) video files. The index building takes forever. Do you know about anything that would help here?

bjarthur commented 1 year ago

@horsto there recently was a regression in performance for pims. see https://github.com/soft-matter/pims/issues/425. you might try checking out an older version.

horsto commented 1 year ago

Interesting. Thank you for pointing me there. Seems unsolved still. Which version of PIMS and PyAV are you using nowadays? (pyAV 8?)