Skip to main content

A fork of the excellent python-ffmpeg binding for FFmpeg, updated for native async API support only.

Project description

ffmpeg-asyncio

A fork of the excellent python-ffmpeg binding for FFmpeg, updated for native async API support only.

The primary difference from the upstream library's async API is handling of abnormal exit by FFmpeg. Rather than raising an exception, an event will be emitted, allowing async handling.

Example usage:

import asyncio

from ffmpeg_asyncio import FFmpeg, Progress


async def main():
    ffmpeg = (
        FFmpeg()
        .input("input.mp4")
        .output("output.mp4")
    )

    @ffmpeg.on("progress")
    def on_progress(progress: Progress):
        print(progress)

    @ffmpeg.on("completed")
    def completed():
        print("Finished!")

    @ffmpeg.on("terminated")
    def exited(return_code: int):
        print("Oh no!")

    await ffmpeg.execute()


if __name__ == "__main__":
    asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffmpeg_asyncio-0.1.3.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

ffmpeg_asyncio-0.1.3-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page