PyAV-Org / PyAV

Pythonic bindings for FFmpeg's libraries.
https://pyav.basswood-io.com/
BSD 3-Clause "New" or "Revised" License
2.47k stars 360 forks source link

Allow using the ffmpeg cli API #1421

Closed WyattBlue closed 2 months ago

WyattBlue commented 3 months ago

a.k.a ffmpeg.c in fftools

Overview

Doing many tasks using the "proper" APIs is verbose, error-prone, and brittle in the face of major ffmpeg version bumps.
Allowing using the command line syntax is fast and familiar to users. It also lets developers not have to bundle separate ffmpeg binaries if they want to use that api.

Expected PyAV API


from av.fftools import ffmpeg

ffmpeg(["-i", "input.mp4", "output.mkv"])

def ffmpeg(args: list[str]) -> None:
   """Interprets args like the ffmpeg cli does. Wraps `main()` in `fftools/ffmpeg.c`"""
   ...
moonsikpark commented 3 months ago

Will this just call ffmpeg and quit or provide imageio-ffmpeg like capabilities where it can communicate with it?

WyattBlue commented 2 months ago

FFmpeg's build system does not support this, and I don't want to maintain those patches.

An alternative idea is to provide a high-level, fluent syntax that's ffmpeg-like.