{"id":6870,"library":"scikit-video","title":"scikit-video: Video Processing in Python","description":"scikit-video is a Python module for video processing, built on top of scipy, numpy, and relying on external `ffmpeg` or `libav` binaries. It aims to provide an all-in-one solution for research-level video processing, offering both high-level and low-level abstractions for reading, writing, and manipulating video files. The current version is 1.1.11, with development seemingly in maintenance mode since its last major release in 2018.","status":"maintenance","version":"1.1.11","language":"en","source_language":"en","source_url":"https://github.com/scikit-video/scikit-video","tags":["video processing","ffmpeg","libav","numpy","scipy","computer vision","multimedia","scientific computing"],"install":[{"cmd":"pip install scikit-video","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Backend for video decoding/encoding, version >= 2.8. Alternatively, libav (version 10 or 11) can be used.","package":"ffmpeg","optional":false},{"reason":"Core numerical operations, version >= 1.9.2.","package":"numpy","optional":false},{"reason":"Scientific computing functionalities, version >= 0.16.0.","package":"scipy","optional":false},{"reason":"Image processing, version >= 3.1.","package":"Pillow","optional":false},{"reason":"Required for some functionalities, version >= 0.18.","package":"scikit-learn","optional":false},{"reason":"Required for installation from source.","package":"setuptools","optional":false},{"reason":"Optional tool for metadata probing.","package":"mediainfo","optional":true}],"imports":[{"note":"For video reading and writing functionalities.","symbol":"skvideo.io","correct":"import skvideo.io"},{"note":"Provides access to test datasets.","symbol":"skvideo.datasets","correct":"import skvideo.datasets"},{"note":"For various utility functions.","symbol":"skvideo.utils","correct":"import skvideo.utils"}],"quickstart":{"code":"import skvideo.io\nimport skvideo.datasets\nimport numpy as np\n\n# Get a sample video filename\nfilename = skvideo.datasets.bigbuckbunny()\n\n# Read the video into a NumPy array\n# For larger videos, consider skvideo.io.vreader for frame-by-frame processing\nvideodata = skvideo.io.vread(filename, num_frames=10) # Read first 10 frames for quick test\n\nprint(f\"Video data shape: {videodata.shape}\")\nprint(f\"Data type: {videodata.dtype}\")\n\n# Example: Convert to grayscale (if not already)\nif videodata.shape[-1] == 3:\n    # Simple average for grayscale, or use more advanced conversion\n    grayscale_video = np.mean(videodata, axis=-1, keepdims=True).astype(videodata.dtype)\n    print(f\"Grayscale video shape: {grayscale_video.shape}\")\n\n# To prevent 'module numpy has no attribute float' errors with recent NumPy, \n# you might need this workaround before importing anything that uses it if it breaks:\n# import numpy\n# numpy.float = numpy.float64\n# numpy.int = numpy.int_","lang":"python","description":"This quickstart demonstrates how to load a sample video from `skvideo.datasets` into a NumPy array using `skvideo.io.vread`. It also shows how to inspect the video's shape and data type. For large videos, `skvideo.io.vreader` is recommended for memory efficiency."},"warnings":[{"fix":"Downgrade NumPy to a version prior to 1.20 (e.g., `pip install numpy==1.19.5`) or apply a monkey-patch before `skvideo` imports: `import numpy; numpy.float = numpy.float64; numpy.int = numpy.int_`.","message":"Incompatibility with recent NumPy versions (>=1.20, especially >=1.24) due to the removal of `numpy.float` and `numpy.int` aliases, causing `AttributeError`.","severity":"breaking","affected_versions":"scikit-video <= 1.1.11 with NumPy >= 1.20"},{"fix":"Ensure previous installations of `sk-video` are uninstalled before installing `scikit-video`: `pip uninstall sk-video` then `pip install scikit-video`.","message":"Older installations of `scikit-video` might have used the package name `sk-video`, leading to import conflicts or unexpected behavior if `scikit-video` is installed afterwards.","severity":"gotcha","affected_versions":"< 1.1.10"},{"fix":"For large videos, use `skvideo.io.vreader` which returns a generator, allowing frame-by-frame processing and significantly reducing memory footprint.","message":"The `skvideo.io.vread` function loads the entire video into memory. For large video files, this can lead to `MemoryError` or system instability.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always specify `num_frames` when reading only a subset of frames (e.g., `skvideo.io.vread(filename, num_frames=N)`).","message":"`skvideo.io.vread` can be significantly slower if `num_frames` is not explicitly provided, especially for certain video types, as it may perform multiple passes to auto-detect video properties.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install `ffmpeg` (recommended) or `libav` on your system. If they are not in PATH, you can explicitly set their location using `skvideo.setFFmpegPath('/path/to/ffmpeg')` or `skvideo.setLibAVPath('/path/to/libav')`.","message":"Requires external `ffmpeg` or `libav` binaries to be installed and available in the system's PATH. Without them, video I/O operations will fail.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For Python 3.12+, installation from source may require manual intervention or the use of `pip install --no-build-isolation .` or equivalent methods, if the project is not updated to `pyproject.toml`.","message":"The `setup.py` script, used for installing from source, relies on `numpy.distutils`, which is deprecated and removed in Python 3.12 and later, potentially breaking source installations.","severity":"deprecated","affected_versions":"All versions (impacts Python >= 3.12)"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}