ENOT video processor package for iterating over video frames easily.
Project description
ENOT Video Processor
Package for processing video with pyav package.
Provides methods for reading from video and writing modified video frames.
Examples
Reading Only
from enot_vp import VideoProcessor
import numpy as np
with VideoProcessor(input_video=VIDEO_PATH) as vp:
for frame in vp:
print(np.mean(frame))
Reading and Writing
# TODO: does it work?
from enot_vp import VideoProcessor
from ultralytics import YOLO
model = YOLO(MODEL_PATH)
with VideoProcessor(input_video=VIDEO_PATH, output_video=OUTPUT_VIDEO_PATH) as vp:
for frame in vp:
ndarray = model(frame, imgsz=1600, verbose=False)[0].plot()[..., ::-1]
vp.put(ndarray)
Writing Only
from enot_vp import VideoProcessor
import cv2, random, numpy as np
# `width`, `height` and `rate` are required arguments here
with VideoProcessor(output_video=OUTPUT_VIDEO_PATH, width=128, height=128, rate=30) as vp:
for i in range(200):
vp.put(cv2.circle(
np.zeros((128,128,3), dtype=np.uint8),
(random.randint(20,108), random.randint(20,108)),
random.randint(5,20),
(255,255,255),
-1,
))
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 enot_vp-1.0.1-py3-none-any.whl.
File metadata
- Download URL: enot_vp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4afd322cffe4ca1ff5191ff206348b5a0b0d5af9259883992fa7fc8b77bb6e03
|
|
| MD5 |
a6117ffb3fbf86a00d865e7fc698e9e0
|
|
| BLAKE2b-256 |
eb78a81dd7162c45daedc3b8e9019d82cd2d35efd43e69f26ac2d98aba4c1869
|