Pupil Labs Video
A high-level wrapper of PyAV providing an easy to use interface to video data.
The goal of this library is to provide a simple interface while maintaining good computational performance. At current, only MP4 and MJPEG videos are officially compatible.
Features include:
- Performant reading of video files (optionally including audio) utilizing multi-threading.
- Ability to arbitrarily index frames by their index or timestamp.
- Ability to slice the video by frame index or time. Large slices will be loaded lazily to avoidexcessive RAM consumption.
- A frame buffer is maintained to cache frames close to the current decoding position, which avoids repetitive seeking when going back and forth between frames in the same neighborhood or iterating backwards.
- Avoids demuxing and seeking operations as much as possible.
- Reading multi-part video files (e.g. how they are generated by Neon or Pupil Invisible).
Installation
pip install pupil-labs-video
or
pip install -e git+https://github.com/pupil-labs/pl-video.git
Quick Start
You can open a video file and read frames like this:
import pupil_labs.video as plv
with plv.Reader(video_path) as video:
# Iterate through video frames
for frame in video:
# Convert video frame to BGR array
img = frame.bgr
# Index individual frames or slices
first_frame = video[0]
last_frame = video[-1]
frames = video[10:20]
# Index frames by time
ts = video[10].time
frame = video.by_container_timestamps[ts]
frames = video.by_container_timestamps[ts : ts + 10]
You can write video files like this:
import pupil_labs.video as plv
with (plv.Writer(out_path) as writer):
for img in images:
writer.write_image(img)
Release files for pupil-labs-video 1.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pupil_labs_video-1.0.14.tar.gz | 323.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pupil_labs_video-1.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 345.6 kB
Release files / pupil_labs_video-1.0.14.tar.gz
| Download URL | pupil_labs_video-1.0.14.tar.gz |
|---|---|
| Size | 323.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2de2b9d0ef8adfe7275fdd76280d6687d685b005ab666036f173b4209adab352
|
|
BLAKE2b-256 checksum How to use checksums |
57e8fc7bb4ff5a56eb10b341648b1fa32d411560248639d03bfb2a597ab0492b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency logRelease files / pupil_labs_video-1.0.14-py3-none-any.whl
| Download URL | pupil_labs_video-1.0.14-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b19924267d10b80187af8c74806ee6689357b78654aeabdb76acdda09e3d6409
|
|
BLAKE2b-256 checksum How to use checksums |
a38aaf0420f6e4d8e01e183784a6b39f8a83c7e136150e5208626e592e13a99f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency log