How google/mediapy works
mediapy is a Python library for reading, writing, transforming, and displaying images and videos in IPython/Jupyter notebooks. The main user workflow is to provide arrays or media paths, optionally transform media, then save it or render it in notebook output. Video file I/O relies on external ffmpeg. The implementation is concentrated in one large module; the graph separates its principal API responsibilities. Relationships follow the README examples and the sampled module excerpt; unsampled internals are not assumed to call one another.
Main entry points: __init__.py Read videos
Components 19
Image workflows
- Read images
mediapy/__init__.py - Write images
mediapy/__init__.py - Image transforms
mediapy/__init__.py - Image compression
mediapy/__init__.py
Video workflows
- Read videos
mediapy/__init__.py - VideoReader
mediapy/__init__.py - Write videos
mediapy/__init__.py - VideoWriter
mediapy/__init__.py - Video transforms
mediapy/__init__.py
Shared media tools
- Media generators
mediapy/__init__.py - Format conversion
mediapy/__init__.py
Notebook display
- Show images
mediapy/__init__.py - Compare images
mediapy/__init__.py - Show videos
mediapy/__init__.py - Multi-video display
mediapy/__init__.py
Other components
- Python user
- ffmpeg
- IPython/Jupyter
- Media paths or URLs
Connections 26
- Python user → Read images: requests read
README.md - Media paths or URLs → Read images: supplies path
README.md - Read images → Image transforms: resize example
mediapy_examples.py - Image transforms → Show images: displays result
mediapy_examples.py - Python user → Write images: requests write
README.md - Python user → Show images: requests display
README.md - Python user → Compare images: requests comparison
- Python user → Read videos: requests read
README.md - Media paths or URLs → Read videos: supplies path
README.md - Read videos → Video transforms: resize example
mediapy_examples.py - Video transforms → Show videos: displays result
mediapy_examples.py - Python user → Write videos: requests write
README.md - Python user → Show videos: requests playback
README.md - Python user → VideoReader: opens reader
README.md - Python user → VideoWriter: opens writer
README.md - VideoReader → VideoWriter: streams frames
README.md - Read videos → ffmpeg: decodes video
README.md - Write videos → ffmpeg: encodes video
README.md - Python user → Multi-video display: requests display
- Python user → Media generators: creates media
README.md - Python user → Format conversion: converts formats
- Show images → IPython/Jupyter: renders output
README.md - Compare images → IPython/Jupyter: renders comparison
mediapy/__init__.py - Show videos → IPython/Jupyter: renders playback
README.md - Multi-video display → IPython/Jupyter: renders output
- Image compression → Show images: compresses for display
mediapy/__init__.py