Skip to main content

Video Sampler -- sample frames from a video file

Project description

video-sampler

Python Version Dependencies Status

Code style: black Pre-commit

License

Video sampler allows you to efficiently sample video frames. Currently it uses keyframe decoding, frame interval gating and perceptual hashing to reduce duplicated samples.

Use case: for sampling videos for later annotations used in machine learning.

Installation and Usage

pip install -U video-sampler

then you can run

python3 -m video-sampler --help

Basic usage

python3 -m  video-sampler FatCat.mp4 ./dataset-frames/ --hash-size 3 --buffer-size 20

Benchmarks

Configuration for this benchmark:

SamplerConfig(min_frame_interval_sec=1.0, keyframes_only=True, buffer_size=10, hash_size=X, queue_wait=0.1, debug=True)
Video Hash size Decoded Saved
Fat Cat Video 8 297 278
Fat Cat Video 4 297 173
SmolCat 8 118 106
SmolCat 4 118 62
HighLemurs 8 458 441
HighLemurs 4 458 309

Flit commands

Build

flit build

Install

flit install

Publish

flit publish

🛡 License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

📃 Citation

@misc{video-sampler,
  author = {video-sampler},
  title = {Video sampler allows you to efficiently sample video frames},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/LemurPwned/video-sampler}}
}

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

video_sampler-0.4.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

video_sampler-0.4.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file video_sampler-0.4.0.tar.gz.

File metadata

  • Download URL: video_sampler-0.4.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for video_sampler-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e74409ce61d1a4efdddf39162cb12d8aef81aaeed22c0abdde9ab9490decf1bf
MD5 98f802d23cd6223df428e86e0b49e2cb
BLAKE2b-256 ca5860037645cae6abaf5d0ece56ad1ed26a42b606e98ad4de2b3efac447923b

See more details on using hashes here.

File details

Details for the file video_sampler-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for video_sampler-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc637a24a5ddf93e6a136cf53525d570ca4078b90db91138f765117350e4b47
MD5 ff54da824d8d80134ae332a9250fa8dd
BLAKE2b-256 b29fa97a635254d14e930c5bf10a55fffbba9ed142d86d65eae4ead5717cd37a

See more details on using hashes here.

Supported by

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