Skip to main content

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

Author:

Christoph Gohlke

License:

BSD-3-Clause

Version:

2026.8.8

Quickstart

Install the vidsrc package and all dependencies from the Python Package Index:

python -m pip install -U vidsrc

See Examples for using the programming interface.

Source code and support are available on GitHub.

Requirements

This revision was tested with the following requirements and dependencies (other versions may work):

  • CPython 3.12.10, 3.13.15, 3.14.7, 3.15.0rc

  • Numpy 2.5.2

  • Microsoft Visual Studio 2026 (build)

  • DirectX 9.0c SDK (build)

  • DirectShow BaseClasses include files (build)

  • DirectShow STRMBASE.lib (build)

Revisions

2026.8.8

  • Make C++ extension ABI3 and free-threading compatible.

  • Drop support for Python 3.11 and numpy 2.0 (SPEC0).

  • Support Python 3.15.

2026.1.18

  • Use multi-phase initialization.

2025.8.1

  • Drop support for Python 3.10, support Python 3.14.

2025.1.6

  • Add type hints.

  • Drop support for Python 3.9, support Python 3.13 and NumPy 2.

2024.1.6

  • Support Python 3.12.

  • Drop support for Python 3.8 and NumPy 1.22 (NEP 29).

2022.9.28

  • Update metadata.

2021.6.6

  • Drop support for Python 3.6 (NEP 29).

  • Fix compile error on PyPy3.

2020.1.1

  • Drop support for Python 2.7 and 3.5.

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).

To fix compile error C2146: syntax error: missing ';' before identifier 'PVOID64', change typedef void * POINTER_64 PVOID64; to typedef void * __ptr64 PVOID64; in winnt.h.

Examples

>>> 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)

Metadata

Release files for vidsrc 2026.8.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vidsrc 2026.8.8
File Size Uploaded
vidsrc-2026.8.8.tar.gz 146.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for vidsrc 2026.8.8
File
vidsrc-2026.8.8-cp315-cp315t-win_arm64.whl CPython 3.15 CPython 3.15 free-threading Windows ARM64 Details
vidsrc-2026.8.8-cp315-cp315t-win_amd64.whl CPython 3.15 CPython 3.15 free-threading Windows x86-64 Details
vidsrc-2026.8.8-cp315-cp315t-win32.whl CPython 3.15 CPython 3.15 free-threading Windows x86-32 Details
vidsrc-2026.8.8-cp314-cp314t-win_arm64.whl CPython 3.14 CPython 3.14 free-threading Windows ARM64 Details
vidsrc-2026.8.8-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
vidsrc-2026.8.8-cp314-cp314t-win32.whl CPython 3.14 CPython 3.14 free-threading Windows x86-32 Details
vidsrc-2026.8.8-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details
vidsrc-2026.8.8-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
vidsrc-2026.8.8-cp312-abi3-win32.whl CPython 3.12 abi3 Windows x86-32 Details

Total release size: 291.7 kB

Release files / vidsrc-2026.8.8.tar.gz

Download URL vidsrc-2026.8.8.tar.gz
Size 146.7 kB
Tags Source
SHA-256 checksum
How to use checksums
884129e08ded724b5ab531e9b8185e74d8377f31f4de5f272f9e6549a995fcab
BLAKE2b-256 checksum
How to use checksums
81c1dbdb9ff534ea9a65dfbe348d114918f60294beab2958bb62241e6986ff20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp315-cp315t-win_arm64.whl

Download URL vidsrc-2026.8.8-cp315-cp315t-win_arm64.whl
Size 16.3 kB
Tags CPython 3.15 CPython 3.15 free-threading Windows ARM64
SHA-256 checksum
How to use checksums
befc3f51cc59160ded4d11506beb7d7b939f0a31b15ba7a89aba42a25d0731f7
BLAKE2b-256 checksum
How to use checksums
8fb3cf621b369ef1ab7b062e6a650eedddecf73be54d3c56c8b58b4888cdfce4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp315-cp315t-win_amd64.whl

Download URL vidsrc-2026.8.8-cp315-cp315t-win_amd64.whl
Size 16.8 kB
Tags CPython 3.15 CPython 3.15 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
151e82ece79f77871f299feefe2688ca2c750c83dff335b458534d68a219c33c
BLAKE2b-256 checksum
How to use checksums
aaeed03db394b4f756c454d5a9ec908bd06c0dfe0940c6aaba357bbb058389bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp315-cp315t-win32.whl

Download URL vidsrc-2026.8.8-cp315-cp315t-win32.whl
Size 16.0 kB
Tags CPython 3.15 CPython 3.15 free-threading Windows x86-32
SHA-256 checksum
How to use checksums
84da66ea6666fce6fbb8db07be1a2c87cf9007a070ce28e184e657b7cc5b3e34
BLAKE2b-256 checksum
How to use checksums
732899aa70195c33459443cd14b8a58c84af56ac4e63bfbcde1dcfe1aa9a0a85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp314-cp314t-win_arm64.whl

Download URL vidsrc-2026.8.8-cp314-cp314t-win_arm64.whl
Size 16.3 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows ARM64
SHA-256 checksum
How to use checksums
37e9d00c7fac374f8b502ac096f74a0774cf0a03705b8260e0ed94318bf60b2f
BLAKE2b-256 checksum
How to use checksums
e7c076b99ef25b5b5f88507f77b7cbaa850f5a51edb2b58a303dca12b89e27ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp314-cp314t-win_amd64.whl

Download URL vidsrc-2026.8.8-cp314-cp314t-win_amd64.whl
Size 16.8 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
94c61f49429a31f9fb68f0dfd8276ffa9b5883405a408aca716a3c8d88c2f2f9
BLAKE2b-256 checksum
How to use checksums
b4f70aeec1d3460037e1cb44a972aec8b366d97c5ccb9adcbca55c51b3bb5ba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp314-cp314t-win32.whl

Download URL vidsrc-2026.8.8-cp314-cp314t-win32.whl
Size 16.0 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-32
SHA-256 checksum
How to use checksums
2bbecd9f0937282b4769f36d0bfcf971157112e43a1e95e5267bc38858f3a445
BLAKE2b-256 checksum
How to use checksums
39ca0500404920363fddbc7ad6004334247884a0249a9949792f2882e254d7cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp312-abi3-win_arm64.whl

Download URL vidsrc-2026.8.8-cp312-abi3-win_arm64.whl
Size 15.6 kB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
7d4f6e2e5ebaa55694ec376c471dc5c0677fb8863f51824f7a6cae6d6f4e255e
BLAKE2b-256 checksum
How to use checksums
93544510ceb5dc2a81da2d93213d8e2e04e90e3eedb9c31fc2c33cb0b7e09c35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp312-abi3-win_amd64.whl

Download URL vidsrc-2026.8.8-cp312-abi3-win_amd64.whl
Size 16.1 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f37c0c08bba70e91d01de96f2cdb110ab28d8fba88939f279f7ccecf38c7f6eb
BLAKE2b-256 checksum
How to use checksums
c5415d928cc3b44cd50f28e788d836c21a7fb79864344e8ad22b34e78749aba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vidsrc-2026.8.8-cp312-abi3-win32.whl

Download URL vidsrc-2026.8.8-cp312-abi3-win32.whl
Size 15.3 kB
Tags CPython 3.12 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
0b1fa5eb25b826d8c2e4921e5f4f8635503e776133ff0285657e8d9b91d8eec8
BLAKE2b-256 checksum
How to use checksums
61f52dab9e1786fb173438a0badde6efef8974cc18e52492fed9bd6dee6056dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page