Skip to main content

Toolbox to slice videos along arbitrary dimensions

Project description

This package provides a VideoSlicer object that allows you to access a video file as if it is a matrix. You can create VideoView objects from a VideoSlicer object that target specific parts of a video file using native Python slicing and indexing mechanisms. The VideoView objects can be used to iterate over the frames in arbitrary dimensions, resulting in VideoFrame or VideoFrameCRS objects. Both objects provide a convenient interface to transport, resize, save and reference frames from the original video file.

As slicing, indexing and iterating is supported in arbitrary dimensions, the VideoSlicer object can be used to quickly extract timestacks as well as ordinary frames in physical meaningful coordinates.

Examples

slicer = VideoSlicer('movie.avi')
view = slicer[:10,::10,::10]
for frame in view:
    frame.save('frame{:06d}.jpg'.format(frame.index))
slicer = VideoSlicer('movie.avi')
frame = slicer[10,...]
frame.save('frame.jpg')
frame.plot()
slicer = VideoSlicer('movie.avi', axis=2) # loop over horizontal dimension
for frame in slicer[:,:,::10]:
    frame.T.save('timestack{:06d}.jpg'.format(frame.index)) # transpose to have time on the horizontal axis

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

videoslicer-1.0.0rc2-py2.py3-none-any.whl (13.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file videoslicer-1.0.0rc2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for videoslicer-1.0.0rc2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 280021c64fcd3127351fc437d7b55f4f2864b60bc1d06403eba4c0e64c754992
MD5 589192c78c7b03b39086ecde4290d8d8
BLAKE2b-256 df30c43f65ff1b07c84a4105927668473182efa1ecf3d08eb6f4564958d09413

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