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)

Download files

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

Source Distribution

vidsrc-2026.8.8.tar.gz (146.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vidsrc-2026.8.8-cp315-cp315t-win_arm64.whl (16.3 kB view details)

Uploaded CPython 3.15tWindows ARM64

vidsrc-2026.8.8-cp315-cp315t-win_amd64.whl (16.8 kB view details)

Uploaded CPython 3.15tWindows x86-64

vidsrc-2026.8.8-cp315-cp315t-win32.whl (16.0 kB view details)

Uploaded CPython 3.15tWindows x86

vidsrc-2026.8.8-cp314-cp314t-win_arm64.whl (16.3 kB view details)

Uploaded CPython 3.14tWindows ARM64

vidsrc-2026.8.8-cp314-cp314t-win_amd64.whl (16.8 kB view details)

Uploaded CPython 3.14tWindows x86-64

vidsrc-2026.8.8-cp314-cp314t-win32.whl (16.0 kB view details)

Uploaded CPython 3.14tWindows x86

vidsrc-2026.8.8-cp312-abi3-win_arm64.whl (15.6 kB view details)

Uploaded CPython 3.12+Windows ARM64

vidsrc-2026.8.8-cp312-abi3-win_amd64.whl (16.1 kB view details)

Uploaded CPython 3.12+Windows x86-64

vidsrc-2026.8.8-cp312-abi3-win32.whl (15.3 kB view details)

Uploaded CPython 3.12+Windows x86

File details

Details for the file vidsrc-2026.8.8.tar.gz.

File metadata

  • Download URL: vidsrc-2026.8.8.tar.gz
  • Upload date:
  • Size: 146.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8.tar.gz
Algorithm Hash digest
SHA256 884129e08ded724b5ab531e9b8185e74d8377f31f4de5f272f9e6549a995fcab
MD5 395b330384bfec0f90064410ed3f0275
BLAKE2b-256 81c1dbdb9ff534ea9a65dfbe348d114918f60294beab2958bb62241e6986ff20

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp315-cp315t-win_arm64.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp315-cp315t-win_arm64.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: CPython 3.15t, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp315-cp315t-win_arm64.whl
Algorithm Hash digest
SHA256 befc3f51cc59160ded4d11506beb7d7b939f0a31b15ba7a89aba42a25d0731f7
MD5 42d36bbd9c775f811cf342abcbf262a3
BLAKE2b-256 8fb3cf621b369ef1ab7b062e6a650eedddecf73be54d3c56c8b58b4888cdfce4

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp315-cp315t-win_amd64.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp315-cp315t-win_amd64.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: CPython 3.15t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp315-cp315t-win_amd64.whl
Algorithm Hash digest
SHA256 151e82ece79f77871f299feefe2688ca2c750c83dff335b458534d68a219c33c
MD5 3e0fdc06dc96784e49a1616c453861b3
BLAKE2b-256 aaeed03db394b4f756c454d5a9ec908bd06c0dfe0940c6aaba357bbb058389bf

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp315-cp315t-win32.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp315-cp315t-win32.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: CPython 3.15t, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp315-cp315t-win32.whl
Algorithm Hash digest
SHA256 84da66ea6666fce6fbb8db07be1a2c87cf9007a070ce28e184e657b7cc5b3e34
MD5 ac04629b0d86c134047c371b39b880ae
BLAKE2b-256 732899aa70195c33459443cd14b8a58c84af56ac4e63bfbcde1dcfe1aa9a0a85

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp314-cp314t-win_arm64.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp314-cp314t-win_arm64.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: CPython 3.14t, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp314-cp314t-win_arm64.whl
Algorithm Hash digest
SHA256 37e9d00c7fac374f8b502ac096f74a0774cf0a03705b8260e0ed94318bf60b2f
MD5 af73644cc96c5055c1f462d8ca669de1
BLAKE2b-256 e7c076b99ef25b5b5f88507f77b7cbaa850f5a51edb2b58a303dca12b89e27ca

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 94c61f49429a31f9fb68f0dfd8276ffa9b5883405a408aca716a3c8d88c2f2f9
MD5 cbb7d8f4289cd06e2005246b7d9a7422
BLAKE2b-256 b4f70aeec1d3460037e1cb44a972aec8b366d97c5ccb9adcbca55c51b3bb5ba9

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp314-cp314t-win32.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp314-cp314t-win32.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: CPython 3.14t, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp314-cp314t-win32.whl
Algorithm Hash digest
SHA256 2bbecd9f0937282b4769f36d0bfcf971157112e43a1e95e5267bc38858f3a445
MD5 60234a6601daa295e2ee3f01dca2736a
BLAKE2b-256 39ca0500404920363fddbc7ad6004334247884a0249a9949792f2882e254d7cc

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp312-abi3-win_arm64.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp312-abi3-win_arm64.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: CPython 3.12+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp312-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 7d4f6e2e5ebaa55694ec376c471dc5c0677fb8863f51824f7a6cae6d6f4e255e
MD5 a2a22f1cd1003126c8fb01905afb820e
BLAKE2b-256 93544510ceb5dc2a81da2d93213d8e2e04e90e3eedb9c31fc2c33cb0b7e09c35

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f37c0c08bba70e91d01de96f2cdb110ab28d8fba88939f279f7ccecf38c7f6eb
MD5 7be6e031924e6c5ff7be4707ea204baf
BLAKE2b-256 c5415d928cc3b44cd50f28e788d836c21a7fb79864344e8ad22b34e78749aba4

See more details on using hashes here.

File details

Details for the file vidsrc-2026.8.8-cp312-abi3-win32.whl.

File metadata

  • Download URL: vidsrc-2026.8.8-cp312-abi3-win32.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: CPython 3.12+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for vidsrc-2026.8.8-cp312-abi3-win32.whl
Algorithm Hash digest
SHA256 0b1fa5eb25b826d8c2e4921e5f4f8635503e776133ff0285657e8d9b91d8eec8
MD5 35fafacb69fc12de6d4b2c6af002fcd6
BLAKE2b-256 61f52dab9e1786fb173438a0badde6efef8974cc18e52492fed9bd6dee6056dc

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2026.8.8 This release

10 files

2026.1.18

16 files

2025.8.1

16 files

2025.1.6

13 files

2024.1.6

15 files

2022.9.28

13 files

2021.6.6

11 files

2020.1.1

8 files

2019.1.1

13 files

2018.10.18

11 files

2018.8.15

11 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page