skillfed

mediapy

Read/write/show images and videos in an IPython notebook

mediapy v1.2.7 1.1M downloads/30d#4,302 on PyPI449
Permissive license Active released

What it is and what it does

Mediapy is a library that integrates image and video I/O directly into IPython and Jupyter notebook environments. It wraps common operations—reading from URLs or files, displaying with optional sizing and titles, writing to disk—and returns media as numpy arrays so you can manipulate them with standard scientific Python tools. The library handles metadata like video framerate automatically and provides both high-level convenience functions (show_image, read_video) and lower-level streaming interfaces (VideoReader, VideoWriter) for frame-by-frame processing.

The package depends on matplotlib, numpy, and Pillow for image handling, plus ipython for notebook integration. Video I/O requires ffmpeg to be installed on your system PATH. It targets modern Python versions and is designed specifically for notebook workflows, making it most useful when you're already working interactively in Jupyter rather than in scripts.

Use it for:

  • Display images fetched from URLs or local files directly in a notebook cell with optional height and title parameters.
  • Read video files and play them back in a notebook with correct framerate, or extract individual frames as numpy arrays.
  • Process video frame-by-frame using VideoReader/VideoWriter to apply transformations and save the result.
  • Show multiple images side-by-side in a notebook grid for visual comparison of results.
  • Generate synthetic test images or videos programmatically and display them immediately for inspection.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Mediapy reads, writes, and displays images and videos directly in IPython and Jupyter notebooks, returning them as numpy arrays for further processing.

Yes, if you work in Jupyter or IPython notebooks and need to display or manipulate images and videos. The low install friction, active maintenance, permissive license, and tight integration with the notebook environment make it a straightforward choice. The only gotcha is the ffmpeg system dependency for video I/O, which is documented and typically a one-time setup.

Install

mediapy on PyPI

pip

pip install mediapy

uv

uv add mediapy

poetry

poetry add mediapy

Installing mediapy

Before you install

Low friction install with four common runtime dependencies (ipython, matplotlib, numpy, Pillow). Actively maintained with a recent release 44 days ago.

License in practice

Licensed under Apache Software License (permissive), allowing use in most commercial and open-source projects without significant restriction.

Quickstart

pip install mediapy
import mediapy as media
import numpy as np

image = media.read_image('https://github.com/hhoppe/data/raw/main/image.png')
media.show_image(image)

video = media.read_video('https://github.com/hhoppe/data/raw/main/video.mp4')
media.show_video(video)

Video I/O requires ffmpeg to be installed and present in the system PATH; on Unix this can be installed via apt install ffmpeg.

Verify before relying

  • Whether ffmpeg installation on Windows is straightforward or requires additional setup steps beyond the Unix apt install shown in the docs.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 4 — ipython, matplotlib, numpy, Pillow
Maintenance actively maintained — 44 days since the last release
Last repo commit
First released
Downloads 1,143,601/month — #4,302 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mediapy-1.2.7-py3-none-any.whl

Framework :: IPythonFramework :: JupyterLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Multimedia :: Graphics :: ViewersTopic :: Multimedia :: Video :: Display

Tags

jupyter notebook image displayvideo playback in jupyterread write images numpynotebook media vieweripython image video tools
jupyter-integrationmedia-io

More Viewers packages