From 4ba43eb7612f6d331996530a3de5bcddbcda6178 Mon Sep 17 00:00:00 2001 From: Daniel Flehner Heen Date: Fri, 2 Feb 2024 11:20:51 +0100 Subject: [PATCH] Prepare for 0.17.0 release of OTIO core (#3) * Removed create_draft_release.yaml * Use 0.17.0.dev1 as dependency in pyproject.toml * Updated ci.yaml to use --pre release of 0.17.0 and main * Updated ci.yaml github-action versions * Updated README.md * Fixed typo in test_burnins.py * Added "pillow" to dependencies in pyproject.toml --------- Signed-off-by: apetrynet --- .github/workflows/ci.yaml | 21 +++------ .github/workflows/create_draft_release.yaml | 33 -------------- README.md | 50 +++++++++++++++++++-- pyproject.toml | 4 +- tests/test_burnins.py | 2 +- 5 files changed, 56 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/create_draft_release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a13a789..a501227 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,24 +22,17 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - os: [ubuntu-latest, macos-latest, windows-latest] - otio-version: [ "extract_adapters" ] - # TODO Once we have landed extracted adapters we replace otio-version - #otio-version: ["0.15.0", "main"] - # We exclude this combination as it's not supported on all - # platforms at the time of this commit - exclude: - - python-version: "3.11" - otio-version: "0.15.0" + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + os: [ ubuntu-latest, macos-latest, windows-latest ] + otio-version: [ "0.17.0", "main" ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -48,10 +41,8 @@ jobs: python -m pip install --upgrade pip if [[ "${{ matrix.otio-version }}" == "main" ]]; then pip install "git+https://github.com/AcademySoftwareFoundation/OpenTimelineIO.git" - elif [[ "${{ matrix.otio-version }}" == "extract_adapters" ]]; then - pip install "git+https://github.com/AcademySoftwareFoundation/OpenTimelineIO.git@${{ matrix.otio-version }}" else - pip install -V OpenTimelineIO==${{ matrix.otio-version }} + pip install OpenTimelineIO>=${{ matrix.otio-version }} --pre --only-binary :all: fi pip install flake8 pytest pytest-cov shell: bash diff --git a/.github/workflows/create_draft_release.yaml b/.github/workflows/create_draft_release.yaml deleted file mode 100644 index dc46e4b..0000000 --- a/.github/workflows/create_draft_release.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Create draft release - -on: - push: - tags: - - '*' - -jobs: - build: - env: - plugin_name: "otio-burnins-adapter" - - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.ref }} - release_name: otio-template-plugin{{ github.ref }} - body: | - Changes in this release - * something - * something - - Please upgrade your adapter with `pip install --upgrade ${{ env.plugin_name }}` - draft: true - prerelease: false diff --git a/README.md b/README.md index bc33c9d..f92ac8a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,48 @@ # OpenTimelineIO Burnins Adapter +[![Build Status](https://github.com/OpenTimelineIO/otio-burnins-adapter/actions/workflows/ci.yaml/badge.svg)](https://github.com/OpenTimelineIO/otio-burnins-adapter/actions/workflows/ci.yaml) +![Dynamic YAML Badge](https://img.shields.io/badge/dynamic/yaml?url=https%3A%2F%2Fraw.githubusercontent.com%2FOpenTimelineIO%2Fotio-burnins-adapter%2Fmain%2F.github%2Fworkflows%2Fci.yaml&query=%24.jobs%5B%22test-plugin%22%5D.strategy.matrix%5B%22otio-version%22%5D&label=OpenTimelineIO) +![Dynamic YAML Badge](https://img.shields.io/badge/dynamic/yaml?url=https%3A%2F%2Fraw.githubusercontent.com%2FOpenTimelineIO%2Fotio-burnins-adapter%2Fmain%2F.github%2Fworkflows%2Fci.yaml&query=%24.jobs%5B%22test-plugin%22%5D.strategy.matrix%5B%22python-version%22%5D&label=Python) -The `burnins` adapter is part of OpenTimelineIO's contrib adapter plugins. +The `burnins` adapter is part of OpenTimelineIO's adapter plugins. Uses FFmpeg to burn text overlays into video media. +# Usage +Add your own variation of the following setup to the Timeline's metadata + +``` json +"metadata": { + "burnins": { + "overwrite": true, + "burnins": [ + { + "text": "Top Center", + "align": "top_centered", + "font": "/System/Library/Fonts/Menlo.ttc", + "font_size": 48, + "function": "text" + }, + { + "align": "top_left", + "x_offset": 75, + "font": "/System/Library/Fonts/Menlo.ttc", + "frame_offset": 101, + "font_size": 48, + "function": "frame_number" + } + ], + "streams": [ + { + "codec_type": "video", + "codec_name": "h264", + "width": 1920, + "height": 1080, + "r_frame_rate": "30/1", + "start_time": "0.000000", + "duration": "20.000000" + } + ] + } +``` # License OpenTimelineIO and the "burnins" adapter are open source software. @@ -11,13 +51,15 @@ Please see the [LICENSE](LICENSE) for details. Nothing in the license file or this project grants any right to use Pixar or any other contributor’s trade names, trademarks, service marks, or product names. -## Contributions +# Contributions If you want to contribute to the project, -please see: https://opentimelineio.readthedocs.io/en/latest/tutorials/contributing.html +please see: https://opentimelineio.readthedocs.io/en/latest/tutorials/contributing.html +Please also read up on [testing your code](https://github.com/OpenTimelineIO/otio-plugin-template#testing-your-plugin-during-development) +in the "getting started" section of the OpenTimelineIO plugin template repository. # Contact For more information, please visit http://opentimeline.io/ or https://github.com/AcademySoftwareFoundation/OpenTimelineIO -or join our discussion forum: https://lists.aswf.io/g/otio-discussion \ No newline at end of file +or join our discussion forum: https://lists.aswf.io/g/otio-discussion diff --git a/pyproject.toml b/pyproject.toml index 0e58584..2f66811 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,8 @@ license = { file="LICENSE" } readme = "README.md" requires-python = ">=3.7" dependencies = [ - "opentimelineio >= 0.15.0" + "opentimelineio >= 0.17.0.dev1", + "pillow" ] classifiers = [ @@ -31,6 +32,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: OS Independent", "Natural Language :: English" ] diff --git a/tests/test_burnins.py b/tests/test_burnins.py index 622ec5a..fe68217 100644 --- a/tests/test_burnins.py +++ b/tests/test_burnins.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the OpenTimelineIO project -"""Unit tests for the rv session file adapter""" +"""Unit tests for the burnins adapter""" import unittest