Overview
Utilities to handle video from camera. Contains various utilites that crop and split the video files.
Installation
In your virtual env do
$ pip install spvideoutils
Scripts
The following scripts are provided by the package.
- video_capture.py
- Captures a video from a camera to mp4 file on disk.
- video_split.py
- Splits a mp4 file into frames stored as png file on output dir.
- video_merge.py
- Merges the frames in png file from dir to a video file.
- video_crop.py
- Crops a video file from frame number i to j.
Developing VideoUtils
This involves
- Creating a python virtual env.
- Downloading the source code from GitHub
- Installing all the dependencies
- Installing the package in dev mode.
For example these are steps I typically do on my windows machine.
python -m venv venv_dev_spvideoutils
env_spvideoutils\Scripts\activate
git clone https://github.com/sanjeevs/spvideoutils.git
cd spvideoutils
pip install -r requirements.txt
pip install -e .
I can check that the env is correctly setup by invoking any of the scripts above from the same window.
>video_capture
usage: video_capture [-h] [--index INDEX] [--time TIME] outfile
video_capture: error: the following arguments are required: outfile
Creating a distribution package
Check the resource packaging.python.org on how to buiild the
distribution.
- Bump the version of the software in setup.py
- Run the script to create the distribution in a new folder called dist.
python setup.py bist_wheel
This is done by publishing the changes to pypi. It involves the following steps.
- This is a pure python project and so a wheel distribution is required. Source distribtution
(sdist) is for packages with C extensions.
- Use twine to upload the source distribution.
twine upload dist/*