Video

PyAV (fastest)

PyAV can be installed via Anaconda, as follows:

conda install av -c conda-forge

Non-anaconda users will have to compile PyAV themselves, which is complicated, especially on Windows. For this we refer the users to the PyAV documentation.

There are two ways PIMS provides random access to video files, which is not something that video formats natively support:

  • PyAVReaderTimed bases the indices of the video frames on the frame_rate that is reported by the video file, along with the timestamps that are imprinted on the separate video frames. The readers PyAVVideoReader and Video are different names for this reader.
  • PyAVReaderIndexed scans through the entire video to build a table of contents. This means that opening the file can take some time, but once it is open, random access is fast. In the case timestamps or frame_rate` are not available, this reader is the preferred option.

ImageIO and MoviePy

Both ImageIO and MoviePy implement interfaces with ffmpeg through a Pipe. These are implemented through ImageIOReader and MoviePyReader, respectively.