Welcome to avfilters’ documentation!

Welcome to avfilters’ documentation!#

concatenate(files, dst)

Concatenate multiple media into a single media.

inspect(file)

Inpsect a multimedia file container.

reverse(src, dst)

Reverse a media.

Common Audio and Video filters.

This package provides an easy-to-use, high-level, and well tested interface to some of features exposed by the av module.

While this library was first developed for another Python project, another Python project, Manim Slides, I welcome any feature suggestion, bug report, or question in the GitHub issues!

Install#

All you need is to add avfilters to your list of dependencies.

On most modern platforms, it will download binary wheels so you do not need to worry about a local FFmpeg installation. However, if your platform does not have pre-built binary wheels, or if you want to use an already existing FFmpeg installation, please checkout PyAV’s installation instructions.

Usage#

Using this library should be straightforward, as most functions contain a well-defined, self-contained, feature.

E.g., if you want to reverse a media, then just use avfilters.reverse.

For more usage examples, please see the documentation of each individual function.

Re-exports#

The core utilities of this library are re-exported in the main module. For more details or functionalities, check individual submodules.

concatenate(files, dst)[source]

Concatenate multiple media into a single media.

Roughly equivalent to:

ffmpeg -f concat -safe 0 -i list.txt -c copy dst

Where list.txt contains the list of files to concatenate. It will be automatically created in a temporary file.

Parameters:
  • files (Iterable[str]) –

    The files that should be concatenated.

    All files must have the same streams (same codecs, same time base, etc.)

  • dst (str) – The path to the destination file. Any existing file will be overwritten.

Return type:

None

inspect(file)[source]

Inpsect a multimedia file container.

Parameters:

file (str) – The multimedia file.

Return type:

Container

Returns:

The corresponding container dataclass.

reverse(src, dst)[source]

Reverse a media.

Roughly equivalent to:

ffmpeg -i src -vf reverse -af areverse dst
Parameters:
  • src (str) – The path to the source file. The file must exist and be a valid media.

  • dst (str) – The path to the destination file. Any existing file will be overwritten.

Return type:

None