Skip to main content

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

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

grantwenzinger@gmail.com

License

MIT

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

match-video-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

match_video-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file match-video-0.1.0.tar.gz.

File metadata

  • Download URL: match-video-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/21.1.0

File hashes

Hashes for match-video-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2babdf8362e764a7ab4ec7b25e6ecf6acea9c29cd8841a96a572b927e50b9c81
MD5 ca183ba8bfc8ff6c3d65ceb36c852f70
BLAKE2b-256 dc6baad17ed8eeffd44f9222b2a9a2eb75b8e1ba759721ea5b12340165f52534

See more details on using hashes here.

File details

Details for the file match_video-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: match_video-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/21.1.0

File hashes

Hashes for match_video-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6436e3b0f779c33fee463a2451ed2b5ae2c819185b71b387d56740179a2f66b2
MD5 97d1e5df961f4937b9f0d2629070de1d
BLAKE2b-256 cae1698bc0f214e15e654acfd026560fcfff201c98bf080dfb1704743838dd35

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