Skip to main content

ffmpeg filter graph bindings for python

Project description

Design proposal

Biblioteka ma za zadanie zastąpić i rozszerzyć istniejącą bibliotekę (https://github.com/kkroening/ffmpeg-python)

Minimalną funkcjonalność, którą chcemy zaimplementować, to ta oferowana przez powyższą bibliotekę, czyli korzystanie z grafów filtrów poprzez prosty interfejs. Poza tym, zależy nam na lepszej integracji z IDE (opisy filtrów w docstringach, typy argumentów), żeby ograniczyć potrzebę krążenia po dokumentacji FFmpeg.

Stack technologiczny

  • szablon cookiecutter: https://github.com/ionelmc/cookiecutter-pylibrary

  • dokumentacja sphinx

  • linter ruff

  • mypy do sprawdzanie statycznego typowania

  • Poetry do budowania paczki

  • tox do automatycznych testów

  • CI/CD przy użyciu github actions (uruchomienie testów, budowanie paczki, aktualizacja Changelog)

  • codecov do badania pokrycia testami kodu

Planowany rozkład jazdy

  1. 18.03-24.03
    • Struktura projektu (cookiecutter)

    • Chcemy mieć możliwość uruchomienia testów, zbudowania dokumentacji (narazie pustej), zbudowania paczki.

  2. 25.03-31.03
    • Podstawowa interakcja z procesem FFmpeg jako subproces

    • metody input, output

    • testy potwierdzające działanie

  3. 01.04-07.04
    • metoda filter, run, compile

  4. 08.04-14.04
    • implementacja części logiki grafu filtrów

    • jakiś podzbiór funkcjonalności np. concat tylko

  5. 15.04-21.04
    • dalsza część logiki grafów

  6. 22.04-28.04
    • poboczne metody: probe, view, run_async

  7. 29.04-05.05
    • dodanie osobnych metod na popularne filtry np. hfilp.

    • ? automatyczna generacja metod z kodu źródłowego ffmpeg

Tygodnie 8-13 przewidziane na potencjalne przesunięcia w planie.

Dokumentacja będzie pisana regularnie wraz z kodem jako docstringi

Możliwe ścieżki rozwouju

  • implementacja filtrów złożonych z wieloma wyjściami

  • wygenerowanie pozostałych filtrów złożonych

  • dodać podpowiedzi przy fluent interface

  • dodać obsługę filtrów złożonych do view

  • przyjmować wejście i wyjście nie tylko przez plik np. kamera na żywo

ZPRP FFmpeg

docs

Documentation Status

tests

GitHub Actions Build Status Coverage Status

package

PyPI Package latest release PyPI Wheel Supported versions Supported implementations Commits since latest release

Implementation of the successor to the ffmpeg-python library

  • Free software: MIT license

Installation

The package is available on pip:

pip install zprp_ffmpeg

Getting started

A minimal example showing basic usage of the library:

import zprp_ffmpeg
stream = zprp_ffmpeg.input("input.mp4")
stream = zprp_ffmpeg.hflip(stream)
stream = zprp_ffmpeg.output(stream, "output.mp4")
zprp_ffmpeg.run(stream)

Check out more examples

Further documentation is available at https://zprp-ffmpeg.readthedocs.io/en/latest/

Development

Project uses poetry for package management. Check out their docs for installation steps. Tests are managed by tox, which uses pytest under the hood.

To install package in development mode, enter the virtual environment managed by poetry, then use install command:

poetry shell
poetry install --with="typecheck"

To run tests on multiple python interpreters, build documentation, check for linting issues, run:

tox

However, this might be cumbersome, since it requires having all supported python interpreters available. To run only selected interpreters, use -e option, for example:

tox -e py312-lin,check #python 3.12 on linux, and linter checks

You can view all defined interpreters with tox -l

To check for typing and linting issues manually, run:

mypy src
pre-commit run --all-files

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

zprp_ffmpeg-2.2.0.tar.gz (83.4 kB view hashes)

Uploaded Source

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