Metadata-Version: 2.1
Name: ffmpeg-asyncio
Version: 0.1.2
Summary: A fork of the excellent python-ffmpeg binding for FFmpeg, updated for native async API support only.
Author: Bruce Cutler
Author-email: Bruce Cutler <bruce@sumebrius.net>
License: Copyright 2023 Bruce Cutler
        Copyright 2023 Jonghwan Hyeon
        
        Copyright for portions of this project are held by Jonghwan Hyeon as part of project ffmpeg-python. All other copyright for this project are held by Bruce Cutler.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        
Keywords: ffmpeg,asyncio
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyee
Requires-Dist: typing-extensions

# ffmpeg-asyncio

A fork of the excellent [`python-ffmpeg`](https://python-ffmpeg.readthedocs.io) 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:

```python
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())
```
