Skip to content
/ psfv Public

Estimate Baseball/Softball Pitching Speed from Video Clip

License

Notifications You must be signed in to change notification settings

syncom/psfv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psfv: Estimate Baseball/Softball Pitch Speed from Video Clip

psfv (Pitch Speed From Video) is a simple tool to estimate the speed of a pitched softball or baseball from a video clip (i.e., one that was taken using a cell phone's camera), without using more accurate equipment such as PITCHf/x or a radar gun.

The methodology

The psfv tool computes the average velocity v of a pitched ball, using the simple formula

v = d / t

where d and t are the distance and duration, respectively, from the ball leaves a pitcher's hand until it is above the home plate. Note that our estimate is different from and slower than the MLB velocity (VELO), which is defined to be "the maximum speed of a given pitch at any point from its release to the time it crosses home plate" (effectively the speed of the ball at the release point due to physics).

How to use

Currently, only softball pitch speed estimation is supported. Baseball support will be added in the future.

Install dependency and psfv

psfv depends on ffprobe, which can be obtained by installing ffmpeg.

On macOS

brew install ffmpeg

On Ubuntu 24.04 LTS

sudo apt install ffmpeg

Install psfv

go install github.com/syncom/psfv@latest

Prepare the video clip

Before AI can help us do better, one needs to do the video clip preparation step manually. The manual work here isn't too difficult, yet needs to be performed carefully.

To obtain the input video clip for psfv, load your game footage into a video editor supporting video trimming at the frame level. For example, QuickTime Player for Mac can be used to do this. Carefully trim the video so that the resulting clip starts at the frame when the ball is released from the pitcher's hand, and end at the frame when the ball crosses the home plate. The duration of the video clip should be less than 1 second in practical scenarios. A sample prepared video clip is pitch_sample_10u.mp4

Run psfv

For softball 10U

$ psfv softball --age-group 10u testdata/pitch_sample_10u.mp4 
Duration of video: 0.636003
Age group: 10u
Average pitch speed: 33.233119 mph (53.483388 kph)

Please refer to psfv --help and psfv softball --help for more usage detail.

About

Estimate Baseball/Softball Pitching Speed from Video Clip

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages