Python video processing libraries

Updated Nov 2026

Python video processing libraries decode, edit, and encode video files frame by frame. Most rely on FFmpeg, either through bindings to its libraries or by building commands for its executable. These libraries let media pipelines, computer vision models, and editing tools read and write video in code.

Popularity

opencv-python-headless has the most monthly downloads in this comparison, at 64.1M, a count that covers all its computer vision work.

LibraryMonthly downloadsStarsLast releaseLicense
opencv-python-headless
64.1M
5.5KNov 2026Apache-2.0
av
52.3M
3.3KOct 2026BSD-3-Clause
imageio
47.4M
1.7KNov 2026BSD-2-Clause
imageio-ffmpeg
27.1M
306Nov 2026BSD-2-Clause
torchvision
18.0M
18.0KOct 2026BSD-3-Clause
ffmpeg-python
11.1M
11.0KJul 2019Apache-2.0
moviepy
5.5M
15.2KMay 2025MIT
torchcodec
4.5M
1.2KSep 2026BSD-3-Clause
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryVideo encodingAudio/video muxingNumPy frame output
opencv-python-headlessBuilt-inUnsupportedBuilt-in
avBuilt-inBuilt-inBuilt-in
imageioBuilt-inBuilt-inBuilt-in
imageio-ffmpegBuilt-inBuilt-inUnsupported
torchvisionUnsupportedUnsupportedUnsupported
ffmpeg-pythonBuilt-inBuilt-inUnsupported
moviepyBuilt-inBuilt-inBuilt-in
torchcodecBuilt-inBuilt-inUnsupported
Built-inNot supported

Libraries and code examples

opencv-python-headless

Wraps the OpenCV Python bindings.

Downloads / mo
64.1M
Stars
5.5K
Last release
5.1.0.95
License
Apache-2.0

Quickstart

From videoio.hpp
$ pip install opencv-python-headless
import cv2

capture = cv2.VideoCapture('input.mp4')
ok, frame = capture.read()
capture.release()

opencv-python-headless examples

From open-source projects on GitHub

Provides Pythonic bindings for FFmpeg's libraries.

Downloads / mo
52.3M
Stars
3.3K
Last release
19.0.2
License
BSD-3-Clause

Quickstart

From core.py
$ pip install av
import av

with av.open('input.mp4') as container:
    frame = next(container.decode(video=0))

av examples

From open-source projects on GitHub

Provides image and video reading and writing through selectable backend plugins.

Downloads / mo
47.4M
Stars
1.7K
Last release
2.38.2
License
BSD-2-Clause

Strengths

  • Iterates frames without bulk loading. Use imiter for videos too large to load together.
  • Applies filters through PyAV. Run FFmpeg filter sequences or graphs during video processing.

Limitations

  • Video support needs extra packages. Install the selected PyAV or FFmpeg backend.
  • Audio can outlast shortened video. Trim audio separately when using the FFmpeg backend’s audio_path option.

Quickstart

From examples.html
$ pip install imageio imageio-ffmpeg
import imageio

with imageio.get_reader('input.mp4', format='FFMPEG') as reader:
    frame = reader.get_data(0)

imageio examples

From open-source projects on GitHub

Wraps FFmpeg for Python.

Downloads / mo
27.1M
Stars
306
Last release
0.8.1
License
BSD-2-Clause

Quickstart

From README.md
$ pip install imageio-ffmpeg
from imageio_ffmpeg import read_frames

reader = read_frames('input.mp4')
metadata = next(reader)
frame = next(reader)
reader.close()

imageio-ffmpeg examples

From open-source projects on GitHub

Provides image and video datasets and models for PyTorch deep learning.

Downloads / mo
18.0M
Stars
18.0K
Last release
0.29.2
License
BSD-3-Clause

Quickstart

From _temporal.py
$ pip install torch torchvision
import torch
from torchvision.transforms.v2 import UniformTemporalSubsample

video = torch.zeros(4, 3, 8, 8)
sampled = UniformTemporalSubsample(num_samples=2)(video)

torchvision examples

From open-source projects on GitHub

Builds FFmpeg input, output, and filter graphs through a Python interface.

Downloads / mo
11.1M
Stars
11.0K
Last release
0.2.0
License
Apache-2.0

Strengths

  • Builds complex filter graphs. Connect trimming, overlays, and other filters in a Python pipeline.
  • Exposes the generated command. Inspect get_args or compile before running the pipeline.

Limitations

  • Requires a separate FFmpeg install. Install FFmpeg and make its executable accessible before running pipelines.
  • Filters can drop audio. Select and recombine audio explicitly when the filter pipeline drops it.

Quickstart

From README.md
$ pip install ffmpeg-python
import ffmpeg

stream = ffmpeg.input('input.mp4')
stream = ffmpeg.output(stream, 'output.mp4')
ffmpeg.run(stream)

ffmpeg-python examples

From open-source projects on GitHub

Edits and combines video clips, audio, titles, and custom effects.

Downloads / mo
5.5M
Stars
15.2K
Last release
2.2.1
License
MIT

Strengths

  • Combines clips, titles, and audio. Build an edited video from separate media clips.
  • Supports custom frame effects. Control video frames and audio when creating effects.

Limitations

  • Cannot stream live video. Use another tool for webcam capture or live remote rendering.
  • Pure conversion adds overhead. Call FFmpeg directly when the task only converts video formats.
$ pip install moviepy
from moviepy import VideoFileClip

with VideoFileClip('input.mp4') as clip:
    frame = clip.get_frame(0)

moviepy examples

From open-source projects on GitHub

Decodes video for PyTorch.

Downloads / mo
4.5M
Stars
1.2K
Last release
0.17.0
License
BSD-3-Clause

Quickstart

From README.md
$ pip install torch torchcodec
from torchcodec.decoders import VideoDecoder

decoder = VideoDecoder('input.mp4', device='cpu')
frame = decoder[0]

torchcodec examples

From open-source projects on GitHub

FAQ

av suits code that works with FFmpeg's libraries directly from Python. ffmpeg-python suits complex filter graphs built as a Python pipeline. moviepy suits edits that combine clips, titles, and audio.

ffmpeg-python builds FFmpeg input, output, and filter graphs through a Python interface. It requires a separate FFmpeg install on the machine.

moviepy edits and combines video clips, audio, titles, and custom effects. It cannot stream live video such as webcam capture.

imageio reads and writes images and video through selectable backend plugins. Video support needs the PyAV or FFmpeg backend installed.

av provides Pythonic bindings for FFmpeg's libraries.

For coding agents

Found your video processing library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official