A Python library that simplifies working with video from soccer matches.
Project description
Match Video
This is a Python library that simplifies working with video from soccer matches. It allows match video to be selected intuitively by period number and clock, instead of absolute video time.
To accomplish this the start of each period is set as a chapter in the match video's metadata. Clips from the video can then be selected by period number and clock. ffmpeg handles both reading and writing the video chapter metadata and clip selection.
Installation
Requirements
- Python 3.9 or newer
- ffmpeg
pip install match-video
Usage
Before the video can be used, the start time of each half needs to be set.
match-video set-half-starts path/to/video.mp4 0:04 63:20
Then it is easy to select match video by period and clock!
import match_video as mv
# get the third minute of the match
clip = mv.get_clip("path/to/video.mp4", period=1, start_clock=180, end_clock=240)
# get the start of each half and concatenate them
clip_clocks = [
{"period": 1, "start_clock": 0, "end_clock": 30},
{"period": 2, "start_clock": 0, "end_clock": 30},
]
clips = mv.get_clips("path/to/video.mp4", clip_clocks)
See the examples to see how to save or display video clips.
Support
License
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
Built Distribution
File details
Details for the file match-video-0.1.2.tar.gz
.
File metadata
- Download URL: match-video-0.1.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.10 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ee9e1f624fc1418574251c99427021ce0f99bafe57b435580dfd67afccdfbdb |
|
MD5 | 76262a085447d7691a9f665af5d3eee5 |
|
BLAKE2b-256 | 889c957b65f5be7182bd83aa6a3157de87408f0912c8c82fe27b6da05c0af9f3 |
File details
Details for the file match_video-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: match_video-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.10 Darwin/21.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3b3f6fa9f333a104a2c732b5564c4e7dff3190f5dc8f685b9aacc6f17f1f675 |
|
MD5 | 9bcc4019137e5472bcb3477ea2e4100e |
|
BLAKE2b-256 | 4c6a04c712990f3e9a0e2d405c5ec79abf9166ce22dd21231f2f7e03752815bd |