Skip to main content

Video Frameserver for Numpy

Project description

Vidsrc is a Python library to read frames from video files as numpy arrays via the DirectShow IMediaDet interface.

Author:

Christoph Gohlke

Organization:

Laboratory for Fluorescence Dynamics. University of California, Irvine

Version:

2019.1.1

Requirements

  • CPython 2.7 or 3.5+

  • Numpy 1.14

  • Microsoft Visual Studio (build)

  • DirectX 9.0c SDK (build)

  • DirectShow BaseClasses include files (build)

  • DirectShow STRMBASE.lib (build)

Revisions

2019.1.1

Update copyright year.

Notes

The DirectShow IMediaDet interface is deprecated and may be removed from future releases of Windows (https://docs.microsoft.com/en-us/windows/desktop/directshow/imediadet).

Example

>>> from vidsrc import VideoSource
>>> video = VideoSource('test.avi', grayscale=False)
>>> len(video)  # number of frames in video
48
>>> video.duration  # length in s
1.6016
>>> video.framerate  # frames per second
29.970089850329373
>>> video.shape  # frames, height, width, color channels
(48, 64, 64, 3)
>>> frame = video[0]  # access first frame
>>> frame = video[-1]  # access last frame
>>> for frame in video:
...     pass  # do_something_with(frame)

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

vidsrc-2019.1.1.tar.gz (146.4 kB view hashes)

Uploaded Source

Built Distributions

vidsrc-2019.1.1-cp38-cp38-win_amd64.whl (14.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

vidsrc-2019.1.1-cp38-cp38-win32.whl (13.0 kB view hashes)

Uploaded CPython 3.8 Windows x86

vidsrc-2019.1.1-cp37-cp37m-win_amd64.whl (14.1 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

vidsrc-2019.1.1-cp37-cp37m-win32.whl (13.0 kB view hashes)

Uploaded CPython 3.7m Windows x86

vidsrc-2019.1.1-cp36-cp36m-win_amd64.whl (13.9 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

vidsrc-2019.1.1-cp36-cp36m-win32.whl (12.8 kB view hashes)

Uploaded CPython 3.6m Windows x86

vidsrc-2019.1.1-cp35-cp35m-win_amd64.whl (13.8 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

vidsrc-2019.1.1-cp35-cp35m-win32.whl (12.8 kB view hashes)

Uploaded CPython 3.5m Windows x86

vidsrc-2019.1.1-cp34-cp34m-win_amd64.whl (10.3 kB view hashes)

Uploaded CPython 3.4m Windows x86-64

vidsrc-2019.1.1-cp34-cp34m-win32.whl (10.4 kB view hashes)

Uploaded CPython 3.4m Windows x86

vidsrc-2019.1.1-cp27-cp27m-win_amd64.whl (10.3 kB view hashes)

Uploaded CPython 2.7m Windows x86-64

vidsrc-2019.1.1-cp27-cp27m-win32.whl (10.5 kB view hashes)

Uploaded CPython 2.7m Windows x86

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