Skip to content

Commit

Permalink
⚡️[0.2.6] Enhanced Video Orientation Support and Ended support for Py…
Browse files Browse the repository at this point in the history
…thon `3.7.x` legacies [#49]

**Core Improvements:**
- ♻️ Ended support for Python 3.7.x legacies (Fixes #48).
  - 🔥 Removed Python 3.7 support from CI/CD pipelines.
  - ✨ Added Python 3.11 support across CI/CD configurations.
  - 🙈 Updated paths to ignore additional file types in CI/CD Pipelines and Codecov:
    - Added `*.html`, `*.js`, `*.css`, `mkdocs.yml`, `README.md`.
  - 👷 Changed runner from `ubuntu-latest` to `ubuntu-20.04` in GitHub Actions.
  - 🎨 Updated dependencies in `docs_deployer.yml` for better readability.
  - 💚 Modified Mike deploy commands to use `--alias-type=copy` instead of deprecated `--no-redirect`.

**Sourcer Enhancements:**
- ⚡️ Added new parameters to metadata to display video orientation (Fixes #39).
  - 🏗️ Updated `__extract_resolution_framerate` function to also return video orientation.
  - ✨ Added new regex pattern and filter for accurate video orientation extraction.
  - 🚩 Added `source_video_orientation` parameter (default `0.0`).
  - 🚩 Added `output_orientation` parameter (default `0.0`).
  - 🔨 Added new class parameters for handling video orientation values.

 **FFhelper Enhancements:**
- ✨ Added support for SRTP/RTSPS in `is_valid_url` function (Fixes #50).
  - ⚡️ Enhanced `is_valid_url` to support `rtsp` and `rtsps` protocols.
  - 💬 SRTP/RTSPS extends RTSP/RTP to encrypt video/audio data using ciphers like AES with a 128-bit key.

**FFhelper Bug Fixes:**
- 🐛 Fixed regex expression bugs in `get_supported_demuxers` method.
  - ⚡️ Simplified regex search for demuxers and handled multi-line output correctly.
  - 🎨 Improved output extraction logic to handle commas within demuxer names.
- 👷 Improved regex pattern in `get_supported_demuxers` function.

**Maintenance Updates:**
- 🔖 Bumped version to 0.2.6.
- 🩹 Updated patch for `long_description`.

**CI Fixes:**
- 💚 Fixed Assertion error with WriteGear API.
- 💚 Removed unsupported darwin platform from `test_FFdecoder_params` test.
  • Loading branch information
abhiTronix authored Jun 23, 2024
2 parents d462c5f + 0a0f9ad commit b6ee94b
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 96 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/CIlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,31 @@ on:
branches:
- master
paths-ignore:
- '**/*.md'
- 'docs/**'
- "**/*.md"
- "**/*.html"
- "**/*.js"
- "**/*.css"
- "docs/**/*"
- README.md
- mkdocs.yml
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- 'docs/**'
- "**/*.md"
- "docs/**/*"


jobs:
test:
name: CI Linux
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install APT Dependencies
Expand All @@ -56,8 +62,8 @@ jobs:
run: |
sudo pip install -U pip wheel numpy
sudo pip install -U .
sudo pip install git+https://github.com/abhiTronix/vidgear@testing#egg=vidgear[core]
sudo pip install -U opencv-python-headless
sudo pip install -U opencv-python-headless
sudo pip install -U vidgear[core]
sudo pip install -U flake8 six codecov pytest pytest-cov
if: success()
- name: Run prepare_dataset Bash script
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/docs_deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
types: [published]

env:
PYTHON_VERSION: 3.8
PYTHON_VERSION: 3.9
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
GIT_NAME: ${{ secrets.GIT_NAME }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
Expand All @@ -34,10 +34,10 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: install_deffcode
Expand All @@ -47,9 +47,9 @@ jobs:
if: success()
- name: install_docs_deps
run: |
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin
pip install -U mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy
pip install jinja2==3.0.*
pip install git+https://github.com/facelessuser/pymdown-extensions@main#egg=pymdown-extensions
if: success()
- name: git configure
run: |
Expand All @@ -72,7 +72,7 @@ jobs:
- name: mike deploy docs release
run: |
echo "${{ env.NAME_RELEASE }}"
mike deploy --push --update-aliases --no-redirect ${{ env.NAME_RELEASE }} ${{ env.RELEASE_NAME }} --title=${{ env.RELEASE_NAME }}
mike deploy --push --update-aliases --alias-type=copy ${{ env.NAME_RELEASE }} ${{ env.RELEASE_NAME }} --title=${{ env.RELEASE_NAME }}
env:
NAME_RELEASE: "v${{ env.RELEASE_NAME }}-release"
if: success() && ${{ steps.skip_check.outputs.should_skip != 'true' }}
Expand All @@ -82,10 +82,10 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: install_deffcode
Expand All @@ -95,9 +95,9 @@ jobs:
if: success()
- name: install_docs_deps
run: |
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin
pip install -U mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy
pip install jinja2==3.0.*
pip install git+https://github.com/facelessuser/pymdown-extensions@main#egg=pymdown-extensions
if: success()
- name: git configure
run: |
Expand All @@ -120,7 +120,7 @@ jobs:
- name: mike deploy docs stable
run: |
echo "${{ env.NAME_STABLE }}"
mike deploy --push --update-aliases --no-redirect ${{ env.NAME_STABLE }} latest --title=latest
mike deploy --push --update-aliases --alias-type=copy ${{ env.NAME_STABLE }} latest --title=latest
mike set-default --push latest
env:
NAME_STABLE: "v${{ env.RELEASE_NAME }}-stable"
Expand All @@ -131,11 +131,11 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git checkout dev
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: install_deffcode
Expand All @@ -145,9 +145,9 @@ jobs:
if: success()
- name: install_docs_deps
run: |
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy
pip install -U mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-minify-plugin
pip install -U mkdocs-exclude mike mkdocstrings mkdocstrings-python-legacy
pip install jinja2==3.0.*
pip install git+https://github.com/facelessuser/pymdown-extensions@main#egg=pymdown-extensions
if: success()
- name: git configure
run: |
Expand All @@ -170,7 +170,7 @@ jobs:
- name: mike deploy docs dev
run: |
echo "Releasing ${{ env.NAME_DEV }}"
mike deploy --push --update-aliases --no-redirect ${{ env.NAME_DEV }} dev --title=dev
mike deploy --push --update-aliases --alias-type=copy ${{ env.NAME_DEV }} dev --title=dev
env:
NAME_DEV: "v${{ env.RELEASE_NAME }}-dev"
if: success() && ${{ steps.skip_check.outputs.should_skip != 'true' }}
17 changes: 11 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ image: Visual Studio 2019

environment:
matrix:
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python38-x64"
PYTHON_VERSION: "3.8.x"
PYTHON_ARCH: "64"
Expand All @@ -34,6 +30,10 @@ environment:
PYTHON_VERSION: "3.10.x"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python311-x64"
PYTHON_VERSION: "3.11.x"
PYTHON_ARCH: "64"

build: off

version: '{branch}-{build}'
Expand All @@ -47,8 +47,13 @@ branches:

skip_commits:
files:
- '**/*.md'
- docs/*
- "**/*.md"
- "**/*.html"
- "**/*.js"
- "**/*.css"
- docs/**/*
- mkdocs.yml
- README.md

matrix:
fast_finish: true
Expand Down
29 changes: 17 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@

# specific path build
trigger:
branches:
include:
- master
paths:
exclude:
- docs
- README.md
branches:
include:
- master
paths:
exclude:
- docs/**/*
- README.md
- mkdocs.yml
- "**/*.md"
- "**/*.html"
- "**/*.js"
- "**/*.css"

pr:
- master
Expand All @@ -32,14 +37,14 @@ pool:

strategy:
matrix:
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
python.version: "3.8"
Python39:
python.version: '3.9'
python.version: "3.9"
Python310:
python.version: '3.10'
python.version: "3.10"
Python311:
python.version: "3.11"

steps:
- task: UsePythonVersion@0
Expand Down
4 changes: 3 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ ignore:
- "docs"
- "scripts"
- "setup.py"
- "**/*.md"
- "**/*.md"
- "**/*.html"
- "mkdocs.yml"
30 changes: 18 additions & 12 deletions deffcode/ffhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,15 @@ def get_supported_demuxers(path):
**Returns:** List of supported demuxers.
"""
# extract and clean FFmpeg output
demuxers = check_sp_output([path, "-hide_banner", "-demuxers"])
splitted = [x.decode("utf-8").strip() for x in demuxers.split(b"\n")]
supported_demuxers = splitted[splitted.index("--") + 1 : len(splitted) - 1]
# compile regex
finder = re.compile(r"\s\s[a-z0-9_,-]+\s+")
# find all outputs
outputs = finder.findall("\n".join(supported_demuxers))
# return output findings
split_index = [idx for idx, s in enumerate(splitted) if "--" in s][0]
supported_demuxers = splitted[split_index + 1 : len(splitted) - 1]
# search all demuxers
outputs = [re.search(r"\s[a-z0-9_,-]{2,}\s", d) for d in supported_demuxers]
outputs = [o.group(0) for o in outputs if o]
# return demuxers output
return [o.strip() if not ("," in o) else o.split(",")[-1].strip() for o in outputs]


Expand Down Expand Up @@ -518,10 +519,12 @@ def extract_device_n_demuxer(path, machine_OS=None, verbose=False):
logger.info(
"[{}]: {}".format(
idx,
dev
if machine_OS != "Linux"
else "{} at path `{}`".format(
next(iter(dev.values()))[0], next(iter(dev.keys()))
(
dev
if machine_OS != "Linux"
else "{} at path `{}`".format(
next(iter(dev.values()))[0], next(iter(dev.keys()))
)
),
)
)
Expand Down Expand Up @@ -632,8 +635,11 @@ def is_valid_url(path, url=None, verbose=False):
protocols = check_sp_output([path, "-hide_banner", "-protocols"])
splitted = [x.decode("utf-8").strip() for x in protocols.split(b"\n")]
supported_protocols = splitted[splitted.index("Output:") + 1 : len(splitted) - 1]
# rtsp is a demuxer somehow
supported_protocols += ["rtsp"] if "rtsp" in get_supported_demuxers(path) else []
# RTSP is a demuxer somehow
# support both RTSP and RTSPS(over SSL)
supported_protocols += (
["rtsp", "rtsps"] if "rtsp" in get_supported_demuxers(path) else []
)
# Test and return result whether scheme is supported
if extracted_scheme_url and extracted_scheme_url in supported_protocols:
verbose and logger.debug(
Expand Down
Loading

0 comments on commit b6ee94b

Please sign in to comment.