Sign inSign up
python-media logo

stden/python-media

By stden

•Updated 1 day ago

Process audio and video with FFmpeg, ffprobe, Python, and uv.

Image
Languages & frameworks
Developer tools
0

1.2K

stden/python-media repository overview

⁠stden/python-media

Process audio and video with FFmpeg, ffprobe, Python, and uv.

⁠What you learn

You learn to use python-media in a Docker container.

⁠Overview

This image contains Python and a current stable FFmpeg build. It includes ffmpeg, ffprobe, and support for x264, LAME MP3, Opus, and VP8/VP9 through libvpx. Use it for media conversion and Python scripts that inspect media.

The working directory is /workspace. The default command starts Bash. The image does not include ffplay.

⁠Tags

TagMeaningPlatform
latestLatest successful build from main.linux/amd64

View all tags on Docker Hub⁠. The latest tag changes when a new build passes its tests.

⁠Pull the image

docker pull stden/python-media:latest

⁠Convert media

Run these commands from a directory that contains input.wav:

docker run --rm -v "$PWD":/workspace stden/python-media:latest \
  ffmpeg -i input.wav -c:a libmp3lame output.mp3

docker run --rm -v "$PWD":/workspace stden/python-media:latest \
  ffmpeg -i input.wav -c:a libopus output.ogg

Convert a video to H.264 with AAC audio:

docker run --rm -v "$PWD":/workspace stden/python-media:latest \
  ffmpeg -i input.mov -c:v libx264 -c:a aac output.mp4

The output files stay in the mounted host directory. Use a new output file name for each command. To replace an existing output file, add -y.

⁠Inspect media with ffprobe

docker run --rm -v "$PWD":/workspace stden/python-media:latest \
  ffprobe -v error -show_streams -show_format -of json output.mp4

Run a Python script in the same environment:

docker run --rm -v "$PWD":/workspace stden/python-media:latest \
  python inspect_media.py

Install extra Python libraries in a child image that starts with FROM stden/python-media:latest. The image contains command-line media tools. You must install project-specific Python media libraries separately.

⁠Source and checks

The smoke test generates audio, encodes it as Opus, and decodes it to PCM. Python checks the codec, duration, channel count, sample rate, and audio data.

Tag summary

Content type

Image

Digest

sha256:3c2604548…

Size

574.7 MB

Last updated

1 day ago

docker pull stden/python-media