Mydia
Reading videos as NumPy arrays was never more simple. This library provides an entire range of additional functionalities such as custom frame selection, frame resizing, pixel normalization, grayscale conversion and much more.
Getting started
1. Read a video, given its path
# Import
from mydia import Videos
# Initialize video path
video_path = r".docs/examples/sample_video/bigbuckbunny.mp4"
# Create a reader object
reader = Videos()
# Call the 'read()' function to get the video tensor
# which will be of shape (1, 132, 720, 1280, 3)
video = reader.read(video_path)
The tensor can be interpreted as:
- 1 video
- Having 132 frames,
- Dimension (width x height) of each frame: 1280x720 pixels
3denotes that the video is in RGB format
2. You can even use multiple workers for reading the videos in parallel
from mydia import Videos
video_paths = [
"path/to/video_1",
"path/to/video_2",
"path/to/video_3",
...,
]
reader = Videos()
video = reader.read(video_path, workers=4)
3. View detailed examples here
Requirements
-
Python 3.x(preferably from the Anaconda Distribution) -
FFmpeg: The backend for reading and processing the videos.The recommended (and probably the easiest) way of installing
FFmpegis via the conda package manager.conda install -c mrinaljain17 ffmpeg
However, if you are not using conda, then
For Linux users -
$ sudo apt-get update $ sudo apt-get install ffmpeg
For Windows or MAC/OSX users -
Download the required binaries from here. Extract the zip file and add the location of binaries to the
PATHvariable.
Installation
-
Using the conda package manager (recommended):
conda install -c mrinaljain17 mydia
-
Using pip:
pip install mydia
The following python packages that mydia depends on, will also be
installed, along with their dependencies.
- ffmpeg-python
- Numpy
- tqdm - Required for displaying the progress bar.
License
Copyright 2018 Mrinal Jain.
Released under the MIT License.
Metadata
Release files for Mydia 2.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mydia-2.2.1.tar.gz | 9.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mydia-2.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / mydia-2.2.1.tar.gz
| Download URL | mydia-2.2.1.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0a29b43a23af9e5746098320e0ced84a9f8e31654266af8699d2af1ef6b74fd
|
|
BLAKE2b-256 checksum How to use checksums |
54e0bd16ef54fd3de86cf1db60d085d8f927a9126090989ff863ccd33d98e471
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
|
Release files / mydia-2.2.1-py3-none-any.whl
| Download URL | mydia-2.2.1-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ffd175cd9021681fa2c5ed4f9f9d503ea938393fe1e0bdc0cf192d75621bbba
|
|
BLAKE2b-256 checksum How to use checksums |
5e5094801b5d30274bd985feb62c5df0bd369e9cd73a5e071b0f430e432dcfae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
|