typed-ffmpeg


Nametyped-ffmpeg JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://livingbio.github.io/typed-ffmpeg/
SummaryModern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.
upload_time2024-04-09 07:28:23
maintainerNone
docs_urlNone
authorlucemia
requires_python<4.0,>=3.10
licenseMIT
keywords ffmpeg video audio multimedia filter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ## typed-ffmpeg

[![CI Package](https://github.com/livingbio/typed-ffmpeg/actions/workflows/ci-package.yml/badge.svg)](https://github.com/livingbio/typed-ffmpeg/actions?query=workflow%3Aci-package)
[![Documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://livingbio.github.io/typed-ffmpeg/)
[![PyPI Version](https://img.shields.io/pypi/v/typed-ffmpeg.svg)](https://pypi.org/project/typed-ffmpeg/)
[![codecov](https://codecov.io/gh/livingbio/typed-ffmpeg/graph/badge.svg?token=B95PR629LP)](https://codecov.io/gh/livingbio/typed-ffmpeg)

**typed-ffmpeg** offers a modern, Pythonic interface to FFmpeg, providing extensive support for complex filters with detailed typing and documentation. Inspired by `ffmpeg-python`, this package enhances functionality by addressing common limitations, such as lack of IDE integration and comprehensive typing, while also introducing new features like JSON serialization of filter graphs and automatic FFmpeg validation.

---

### Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Quick Usage](#quick-usage)
- [Documentation](https://livingbio.github.io/typed-ffmpeg/)
- [Acknowledgements](#acknowledgements)

---

## Features

![typed-ffmpeg](https://raw.githubusercontent.com/livingbio/typed-ffmpeg/main/docs/media/autocomplete.png)


- **Zero Dependencies:** Built purely with the Python standard library, ensuring maximum compatibility and security.
- **User-Friendly:** Simplifies the construction of filter graphs with an intuitive Pythonic interface.
- **Comprehensive FFmpeg Filter Support:** Out-of-the-box support for most FFmpeg filters, with IDE auto-completion.
- **Integrated Documentation:** In-line docstrings provide immediate reference for filter usage, reducing the need to consult external documentation.
- **Robust Typing:** Offers static and dynamic type checking, enhancing code reliability and development experience.
- **Filter Graph Serialization:** Enables saving and reloading of filter graphs in JSON format for ease of use and repeatability.
- **Graph Visualization:** Leverages `graphviz` for visual representation, aiding in understanding and debugging.
- **Validation and Auto-correction:** Assists in identifying and fixing errors within filter graphs.

### Planned Features

Please note that the following features are under consideration or development for future releases:

- **Partial Evaluation:** Enhance the flexibility of filter graphs by enabling partial evaluation, allowing for modular construction and reuse.
- **Extended FFmpeg Version Support:** While `typed-ffmpeg` is currently built with FFmpeg version 6.0 in mind, we are working to ensure compatibility across different FFmpeg versions. Feedback and issue reports are welcome to improve version support.
- **Additional Filter Support:** We aim to expand the range of FFmpeg filters supported by `typed-ffmpeg`. Continuous updates will be made to include more complex and varied filters.
- **Input and Output Options Support:** Provide a more comprehensive interface for input and output options, including support for additional codecs and formats.

---

## Installation

To install `typed-ffmpeg`, simply use pip:

```bash
pip install typed-ffmpeg
```

Note: FFmpeg must be installed on your system.

### Visualization Support

To enable graph visualization features:

```bash
pip install 'typed-ffmpeg[graph]'
```

Note: This requires Graphviz to be installed on your system.

---

## Quick Usage

Here's how to quickly start using `typed-ffmpeg`:

```python
import ffmpeg

# Flip video horizontally and output
f = (
    ffmpeg
    .input(filename='input.mp4')
    .hflip()
    .output(filename='output.mp4')
)
f.run()
```

![](https://raw.githubusercontent.com/livingbio/typed-ffmpeg/main/docs/media/quick-usage.png)

For a more complex example:

```python
import ffmpeg

# Complex filter graph example
in_file = ffmpeg.input("input.mp4")
overlay_file = ffmpeg.input("overlay.png")

f = (
    ffmpeg
    .concat(
        in_file.trim(start_frame=10, end_frame=20),
        in_file.trim(start_frame=30, end_frame=40),
    )
    .overlay(overlay_file.hflip())
    .drawbox(x="50", y="50", width="120", height="120", color="red", thickness="5")
    .output(filename="out.mp4")
)
f.run()
```

![](https://raw.githubusercontent.com/livingbio/typed-ffmpeg/main/docs/media/quick-usage-complex.png)

See the [Usage](https://livingbio.github.io/typed-ffmpeg/usage/typed/) section in our documentation for more examples and detailed guides.

---

## Acknowledgements

This project was initially inspired by the capabilities of GPT-3, with the original concept focusing on using GPT-3 to generate an FFmpeg filter SDK directly from the FFmpeg documentation. However, during the development process, I encountered limitations with GPT-3's ability to fully automate this task.

As a result, I shifted to traditional code generation methods to complete the SDK, ensuring a more robust and reliable tool. Despite this change in approach, both GitHub Copilot and GPT-3 were instrumental in accelerating the development process, providing valuable insights and saving significant time.

I would also like to extend my gratitude to the `ffmpeg-python` project, which inspired this project significantly. The API style and design ideas from `ffmpeg-python` have been influential, and I have utilized these aspects to shape the development of our SDK.

This project is dedicated to my son, Austin, on his seventh birthday (February 24, 2024), whose curiosity and zest for life continually inspire me.

---

Feel free to check the [Documentation](https://livingbio.github.io/typed-ffmpeg/) for detailed information and more advanced features.


            

Raw data

            {
    "_id": null,
    "home_page": "https://livingbio.github.io/typed-ffmpeg/",
    "name": "typed-ffmpeg",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "ffmpeg, video, audio, multimedia, filter",
    "author": "lucemia",
    "author_email": "lucemia@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fa/bc/4b460426fe011cb60ca7aa8c7326a2b6c043e6474458d9b34f180c9ebe05/typed_ffmpeg-2.0.0.tar.gz",
    "platform": null,
    "description": "## typed-ffmpeg\n\n[![CI Package](https://github.com/livingbio/typed-ffmpeg/actions/workflows/ci-package.yml/badge.svg)](https://github.com/livingbio/typed-ffmpeg/actions?query=workflow%3Aci-package)\n[![Documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://livingbio.github.io/typed-ffmpeg/)\n[![PyPI Version](https://img.shields.io/pypi/v/typed-ffmpeg.svg)](https://pypi.org/project/typed-ffmpeg/)\n[![codecov](https://codecov.io/gh/livingbio/typed-ffmpeg/graph/badge.svg?token=B95PR629LP)](https://codecov.io/gh/livingbio/typed-ffmpeg)\n\n**typed-ffmpeg** offers a modern, Pythonic interface to FFmpeg, providing extensive support for complex filters with detailed typing and documentation. Inspired by `ffmpeg-python`, this package enhances functionality by addressing common limitations, such as lack of IDE integration and comprehensive typing, while also introducing new features like JSON serialization of filter graphs and automatic FFmpeg validation.\n\n---\n\n### Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Usage](#quick-usage)\n- [Documentation](https://livingbio.github.io/typed-ffmpeg/)\n- [Acknowledgements](#acknowledgements)\n\n---\n\n## Features\n\n![typed-ffmpeg](https://raw.githubusercontent.com/livingbio/typed-ffmpeg/main/docs/media/autocomplete.png)\n\n\n- **Zero Dependencies:** Built purely with the Python standard library, ensuring maximum compatibility and security.\n- **User-Friendly:** Simplifies the construction of filter graphs with an intuitive Pythonic interface.\n- **Comprehensive FFmpeg Filter Support:** Out-of-the-box support for most FFmpeg filters, with IDE auto-completion.\n- **Integrated Documentation:** In-line docstrings provide immediate reference for filter usage, reducing the need to consult external documentation.\n- **Robust Typing:** Offers static and dynamic type checking, enhancing code reliability and development experience.\n- **Filter Graph Serialization:** Enables saving and reloading of filter graphs in JSON format for ease of use and repeatability.\n- **Graph Visualization:** Leverages `graphviz` for visual representation, aiding in understanding and debugging.\n- **Validation and Auto-correction:** Assists in identifying and fixing errors within filter graphs.\n\n### Planned Features\n\nPlease note that the following features are under consideration or development for future releases:\n\n- **Partial Evaluation:** Enhance the flexibility of filter graphs by enabling partial evaluation, allowing for modular construction and reuse.\n- **Extended FFmpeg Version Support:** While `typed-ffmpeg` is currently built with FFmpeg version 6.0 in mind, we are working to ensure compatibility across different FFmpeg versions. Feedback and issue reports are welcome to improve version support.\n- **Additional Filter Support:** We aim to expand the range of FFmpeg filters supported by `typed-ffmpeg`. Continuous updates will be made to include more complex and varied filters.\n- **Input and Output Options Support:** Provide a more comprehensive interface for input and output options, including support for additional codecs and formats.\n\n---\n\n## Installation\n\nTo install `typed-ffmpeg`, simply use pip:\n\n```bash\npip install typed-ffmpeg\n```\n\nNote: FFmpeg must be installed on your system.\n\n### Visualization Support\n\nTo enable graph visualization features:\n\n```bash\npip install 'typed-ffmpeg[graph]'\n```\n\nNote: This requires Graphviz to be installed on your system.\n\n---\n\n## Quick Usage\n\nHere's how to quickly start using `typed-ffmpeg`:\n\n```python\nimport ffmpeg\n\n# Flip video horizontally and output\nf = (\n    ffmpeg\n    .input(filename='input.mp4')\n    .hflip()\n    .output(filename='output.mp4')\n)\nf.run()\n```\n\n![](https://raw.githubusercontent.com/livingbio/typed-ffmpeg/main/docs/media/quick-usage.png)\n\nFor a more complex example:\n\n```python\nimport ffmpeg\n\n# Complex filter graph example\nin_file = ffmpeg.input(\"input.mp4\")\noverlay_file = ffmpeg.input(\"overlay.png\")\n\nf = (\n    ffmpeg\n    .concat(\n        in_file.trim(start_frame=10, end_frame=20),\n        in_file.trim(start_frame=30, end_frame=40),\n    )\n    .overlay(overlay_file.hflip())\n    .drawbox(x=\"50\", y=\"50\", width=\"120\", height=\"120\", color=\"red\", thickness=\"5\")\n    .output(filename=\"out.mp4\")\n)\nf.run()\n```\n\n![](https://raw.githubusercontent.com/livingbio/typed-ffmpeg/main/docs/media/quick-usage-complex.png)\n\nSee the [Usage](https://livingbio.github.io/typed-ffmpeg/usage/typed/) section in our documentation for more examples and detailed guides.\n\n---\n\n## Acknowledgements\n\nThis project was initially inspired by the capabilities of GPT-3, with the original concept focusing on using GPT-3 to generate an FFmpeg filter SDK directly from the FFmpeg documentation. However, during the development process, I encountered limitations with GPT-3's ability to fully automate this task.\n\nAs a result, I shifted to traditional code generation methods to complete the SDK, ensuring a more robust and reliable tool. Despite this change in approach, both GitHub Copilot and GPT-3 were instrumental in accelerating the development process, providing valuable insights and saving significant time.\n\nI would also like to extend my gratitude to the `ffmpeg-python` project, which inspired this project significantly. The API style and design ideas from `ffmpeg-python` have been influential, and I have utilized these aspects to shape the development of our SDK.\n\nThis project is dedicated to my son, Austin, on his seventh birthday (February 24, 2024), whose curiosity and zest for life continually inspire me.\n\n---\n\nFeel free to check the [Documentation](https://livingbio.github.io/typed-ffmpeg/) for detailed information and more advanced features.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Modern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://livingbio.github.io/typed-ffmpeg/",
        "Repository": "https://github.com/livingbio/typed-ffmpeg"
    },
    "split_keywords": [
        "ffmpeg",
        " video",
        " audio",
        " multimedia",
        " filter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a1f18c6044963a4c6d0c0a3f957948ae912a5b1812b770e14e9e7f0461ed3a2d",
                "md5": "faded6ee867a3f7af22e3699e0d2c088",
                "sha256": "a48c2b90b2a1f53dddfd45877701c2a40fb8b280e10d175620645dcf14c86a1c"
            },
            "downloads": -1,
            "filename": "typed_ffmpeg-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "faded6ee867a3f7af22e3699e0d2c088",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 139562,
            "upload_time": "2024-04-09T07:28:22",
            "upload_time_iso_8601": "2024-04-09T07:28:22.436538Z",
            "url": "https://files.pythonhosted.org/packages/a1/f1/8c6044963a4c6d0c0a3f957948ae912a5b1812b770e14e9e7f0461ed3a2d/typed_ffmpeg-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fabc4b460426fe011cb60ca7aa8c7326a2b6c043e6474458d9b34f180c9ebe05",
                "md5": "904b0b10ad2c9c9a43fcca046520ef14",
                "sha256": "fc367d6443ee7652ac8a869cd9f4d5c1563f9d6366e5e1add9f093f8639d4764"
            },
            "downloads": -1,
            "filename": "typed_ffmpeg-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "904b0b10ad2c9c9a43fcca046520ef14",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 128737,
            "upload_time": "2024-04-09T07:28:23",
            "upload_time_iso_8601": "2024-04-09T07:28:23.851292Z",
            "url": "https://files.pythonhosted.org/packages/fa/bc/4b460426fe011cb60ca7aa8c7326a2b6c043e6474458d9b34f180c9ebe05/typed_ffmpeg-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-09 07:28:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "livingbio",
    "github_project": "typed-ffmpeg",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "typed-ffmpeg"
}
        
Elapsed time: 0.23307s