Skip to main content

Video Representations Extractor (VRE) Video reader

Project description

VRE Video

A python video reader that can read video frames using ffmpeg behind the scenes. Support for PIL/Numpy based directory of frames as well + in memory numpy frames for testing. This repository is used to drive advancements/optimizations and supporting more video formats (thanks to ffmpeg). We have a dummy video player as well in the examples.

Dependencies:

  • ffmpeg If you want to use the standard video reader/writer, you need ffmpeg installed in your path.

Install (pip):

pip install vre-video

Install (dev):

git clone https://gitlab.com/meehai/ffmpeg-video/
echo "$(pwd)/ffmpeg-video" >> ~/.bashrc
source ~/.bashrc
pip install -r ffmpeg-video/requirements.txt

Handle venv/conda/uv stuff on your own!

Usage:

from vre_video import VREVideo
video = VREVideo("video.mp4")
frame = video[ix] # returns a numpy array

Supports 3 backends for both reading and writing: numpy, Pillow and ffmpeg. It will auto-detect based on input: if a directory is provided it'll try to guess (png/jpg/npz/npy etc.) assuming it's a dir of frames (1.npz, ..., N.npz). If it's a path with suffix (i.e. .mp4, .mkv etc.) it will use the ffmpeg-based variant. Same for writing.

Support for youtube videos

Requires youtube-dl python package.

Usage:

from vre_video import VREVideo
video = VREVideo("https://www.youtube.com/...")
frame = video[ix] # returns a numpy array

Support for stdin (like ffplay)

Usage:

from vre_video import VREVideo
video = VREVideo("-")
frame = video[ix] # returns a numpy array

Used in combination with vre_video_player (i.e. reading from /dev/videoXX webcam).

Projects using VRE Video

Video Representations Extractor (VRE)

Used in Video Representations Extractor (VRE) library to extract multiple modalities for multi-task learning (MTL) in machine learning from videos

Drones I/O & Actions (drone-ioact)

Used in drone-ioact as a base layer for the video player which acts as a testing ground for the simplest possible drone simulator environment: video continuously playing with basic actions like pause/play or take screenshot.

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

vre_video-0.5.2.tar.gz (15.9 kB view details)

Uploaded Source

File details

Details for the file vre_video-0.5.2.tar.gz.

File metadata

  • Download URL: vre_video-0.5.2.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for vre_video-0.5.2.tar.gz
Algorithm Hash digest
SHA256 3b2b57bcb5c3527859b54d7996fcb58f7b0107124a130c93f06bb7f4bf670d89
MD5 7aefebfbe43d88f84091953fa5265897
BLAKE2b-256 a3e305ccbf1842d4cb8bebd9ddaad30002f40ca89ea620b17a6357a8c08f647c

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