Skip to main content

Reads a video into a buffer in an extra thread with some nice syntax.

Project description

# CV2 Threaded Video Capture

Not much to say here, it enables you to read an entire video or a number of frames from a video in an extra thread with some nice syntax.

This project was initially part of my video synopsis project, wich is why the config dict() is required.

### Full video

from VideoReader import VideoReader import os

fileName = “out.mp4” dirName = os.path.join(os.path.dirname(__file__), “generate test footage”)

config = {} config[“inputPath”] = os.path.join(dirName, fileName) config[“videoBufferLength”] = 100

with VideoReader(config) as reader:
while not reader.videoEnded():

framenumber, frame = reader.pop() print(framenumber)

### Selection of Frames

from VideoReader import VideoReader import os

fileName = “out.mp4” dirName = os.path.join(os.path.dirname(__file__), “generate test footage”)

config = {} config[“inputPath”] = os.path.join(dirName, fileName) config[“videoBufferLength”] = 100

frameList = list(range(100, 500))

with VideoReader(config, frameList) as reader:
while not reader.videoEnded():

framenumber, frame = reader.pop() print(framenumber)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CV2-Threaded-Video-Capture-1.0.0.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file CV2-Threaded-Video-Capture-1.0.0.tar.gz.

File metadata

  • Download URL: CV2-Threaded-Video-Capture-1.0.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for CV2-Threaded-Video-Capture-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1a5cbe20410788a676d9e5636478ca7ce7d2668dcb6d77252c3eab3deee4d844
MD5 bc8ec8d6d6310f8a6da690e5ffc13577
BLAKE2b-256 311fa2c5b2379695d1b4667f1912f64ba361f7b858e2c4e32d5e5df9c9b54379

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page