# 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](https://ffmpeg.org)
```shell
pip install match-video
```
## Usage
Before the video can be used, the start time of each half needs to be set.
```shell
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!
```python
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](https://gitlab.com/grantwenzinger/match-video/-/tree/main/examples) to see how to save or display video clips.
## Support
<grantwenzinger@gmail.com>
## License
[MIT](https://choosealicense.com/licenses/mit/)
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/grantwenzinger/match-video",
"name": "match-video",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.9.0",
"maintainer_email": null,
"keywords": "soccer, football, match, video",
"author": "Grant Wenzinger",
"author_email": "grantwenzinger@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c9/7d/d791b422fbadb4c03af258ea550176af797d545855a41be088b5efde2c91/match_video-0.1.3.tar.gz",
"platform": null,
"description": "# Match Video\n\nThis 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.\n\nTo 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.\n\n## Installation\n\n### Requirements\n- Python 3.9 or newer\n- [ffmpeg](https://ffmpeg.org)\n\n```shell\npip install match-video\n```\n\n## Usage\n\nBefore the video can be used, the start time of each half needs to be set.\n\n```shell\nmatch-video set-half-starts path/to/video.mp4 0:04 63:20\n```\n\nThen it is easy to select match video by period and clock!\n\n```python\nimport match_video as mv\n\n# get the third minute of the match\nclip = mv.get_clip(\"path/to/video.mp4\", period=1, start_clock=180, end_clock=240)\n\n# get the start of each half and concatenate them\nclip_clocks = [\n {\"period\": 1, \"start_clock\": 0, \"end_clock\": 30},\n {\"period\": 2, \"start_clock\": 0, \"end_clock\": 30},\n]\nclips = mv.get_clips(\"path/to/video.mp4\", clip_clocks)\n```\n\nSee the [examples](https://gitlab.com/grantwenzinger/match-video/-/tree/main/examples) to see how to save or display video clips.\n\n## Support\n\n<grantwenzinger@gmail.com>\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library that simplifies working with video from soccer matches.",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://gitlab.com/grantwenzinger/match-video",
"Repository": "https://gitlab.com/grantwenzinger/match-video"
},
"split_keywords": [
"soccer",
" football",
" match",
" video"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8c0312311770e9fe227c6833f600c107c0ae6f604a016d0d4908866f84aff0a7",
"md5": "bf1919f1904fd9ce0562f4d37fb5f0b8",
"sha256": "233cf410403d506f8341fd6abe3812253210ffe69f6d96ee36a0322ddc224a0a"
},
"downloads": -1,
"filename": "match_video-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bf1919f1904fd9ce0562f4d37fb5f0b8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.9.0",
"size": 7004,
"upload_time": "2024-07-27T21:44:55",
"upload_time_iso_8601": "2024-07-27T21:44:55.655678Z",
"url": "https://files.pythonhosted.org/packages/8c/03/12311770e9fe227c6833f600c107c0ae6f604a016d0d4908866f84aff0a7/match_video-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c97dd791b422fbadb4c03af258ea550176af797d545855a41be088b5efde2c91",
"md5": "abc943d4e98e785a9e3739c043a9f4ec",
"sha256": "bbd47813d6f1bfcb53118f37df6229a8cf3683888b2afff0efbbcff486b1a337"
},
"downloads": -1,
"filename": "match_video-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "abc943d4e98e785a9e3739c043a9f4ec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.9.0",
"size": 6016,
"upload_time": "2024-07-27T21:44:57",
"upload_time_iso_8601": "2024-07-27T21:44:57.028371Z",
"url": "https://files.pythonhosted.org/packages/c9/7d/d791b422fbadb4c03af258ea550176af797d545855a41be088b5efde2c91/match_video-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-27 21:44:57",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "grantwenzinger",
"gitlab_project": "match-video",
"lcname": "match-video"
}