A high-level wrapper of PyAV providing an easy to use interface to video data.
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pupil_labs_video-1.0.8.tar.gz.
File metadata
- Download URL: pupil_labs_video-1.0.8.tar.gz
- Upload date:
- Size: 323.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3fa6f41a7b61c4335e1189cc9b7e2bc41846c3c26e665ed5eb262c3e8a88eac
|
|
| MD5 |
62001cb24b66af6a47020511991106f9
|
|
| BLAKE2b-256 |
3a9c588d39f7b1dad0e60e6e15680fccaa5fa296c7fa2863c395e0e5e4abc512
|
Provenance
The following attestation bundles were made for pupil_labs_video-1.0.8.tar.gz:
Publisher:
on-release-main.yml on pupil-labs/pl-video
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pupil_labs_video-1.0.8.tar.gz -
Subject digest:
e3fa6f41a7b61c4335e1189cc9b7e2bc41846c3c26e665ed5eb262c3e8a88eac - Sigstore transparency entry: 910697048
- Sigstore integration time:
-
Permalink:
pupil-labs/pl-video@8bd861481bf60afa383dd5a17d27451a9cf3e681 -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/pupil-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-main.yml@8bd861481bf60afa383dd5a17d27451a9cf3e681 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pupil_labs_video-1.0.8-py3-none-any.whl.
File metadata
- Download URL: pupil_labs_video-1.0.8-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a55155e79115ee8a378e6dd9303fa206a8ea79e22da2a0d3bc8cbd106e9722ee
|
|
| MD5 |
7978e14dc8a07ff7429cb746e7582207
|
|
| BLAKE2b-256 |
b3a260d8d5c8ea8ac245708e5b42924b97637e09660fd71d793f6d6483e5a7c6
|
Provenance
The following attestation bundles were made for pupil_labs_video-1.0.8-py3-none-any.whl:
Publisher:
on-release-main.yml on pupil-labs/pl-video
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pupil_labs_video-1.0.8-py3-none-any.whl -
Subject digest:
a55155e79115ee8a378e6dd9303fa206a8ea79e22da2a0d3bc8cbd106e9722ee - Sigstore transparency entry: 910697059
- Sigstore integration time:
-
Permalink:
pupil-labs/pl-video@8bd861481bf60afa383dd5a17d27451a9cf3e681 -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/pupil-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-main.yml@8bd861481bf60afa383dd5a17d27451a9cf3e681 -
Trigger Event:
release
-
Statement type: