Av1an/.github/workflows/tests.yml

198 lines
5.3 KiB
YAML
Raw Normal View History

name: tests
on:
push:
paths-ignore:
- "*.yml"
- .gitignore
- "*.md"
pull_request:
paths-ignore:
- "*.yml"
- .gitignore
- "*.md"
2020-08-10 22:22:55 +00:00
env:
deps: tree llvm clang
DEBIAN_FRONTEND: noninteractive
jobs:
validate:
2021-06-05 07:38:22 +00:00
name: ${{ matrix.name }} ${{ matrix.enc }}
runs-on: ubuntu-latest
container: luigi311/encoders-docker:latest
strategy:
fail-fast: false
matrix:
enc: [aom, rav1e, svt-av1, vpx, x265, x264]
name: [baseline, baseline-select, target-quality, probe-slow]
include:
2020-12-23 12:06:36 +00:00
- name: baseline
flags: ""
- name: baseline-select
flags: "--chunk-method select"
2021-06-05 07:38:22 +00:00
- name: target-quality
flags: --target-quality 95
- name: probe-slow
flags: --target-quality 95 --probe-slow
2020-12-23 12:06:36 +00:00
- name: chunk_hybrid
enc: aom
2021-06-05 07:38:22 +00:00
flags: --chunk-method hybrid
2020-12-23 12:06:36 +00:00
- name: chunk_select
enc: aom
2021-06-05 07:38:22 +00:00
flags: --chunk-method select
- name: chunk_ffms2
enc: aom
2021-07-10 14:42:17 +00:00
flags: --chunk-method ffms2
- name: chunk_lsmash
enc: aom
2021-07-10 14:42:17 +00:00
flags: --chunk-method lsmash
2020-12-23 12:06:36 +00:00
- name: scenes
enc: aom
flags: -s scenes.json
2020-12-23 12:06:36 +00:00
- name: workers
enc: aom
flags: -w 2
2020-12-23 12:06:36 +00:00
- name: vmaf
enc: aom
flags: --vmaf
2020-12-23 12:06:36 +00:00
- name: extra_splits
enc: aom
2021-06-05 07:38:22 +00:00
flags: -x 10
2020-12-23 12:06:36 +00:00
- name: video_settings
2020-12-23 11:50:41 +00:00
enc: aom
flags: -v " --cpu-used=3 --end-usage=q --cq-level=30 --threads=8 "
2020-12-23 12:06:36 +00:00
- name: temp
2020-12-23 11:50:41 +00:00
enc: aom
flags: --temp temporary
steps:
- uses: actions/checkout@v2
- name: Validate encoders
run: |
aomenc --help
SvtAv1EncApp --help
rav1e --help
x265 --help || true
2021-06-05 07:38:22 +00:00
2021-05-15 06:09:01 +00:00
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: default
default: true
components: rustfmt, clippy
- name: Install requirements
run: |
apt-get update && apt-get install -y ${{ env.deps }}
2021-05-15 06:09:01 +00:00
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --no-default-features
2021-05-15 06:09:01 +00:00
- name: Build Av1an
run: |
Scene detect changes (#383) * Remove sc-downscale-height CLI option The standard scenecut detection method at 1080p is currently as fast as downsampling to 720p and running scenecut detection on that, and the fast scenecut method is significantly faster without downsampling, because the algorithm is faster than ffmpeg's resizing algorithm. As such, it doesn't make sense to have this option anymore. * Fix conditional use of newer VS APIs It makes sense to enable these by default, since the vast majority of users should have a moderately recent version of Vapoursynth. We also needed to disable the static ffmpeg as the default for now. libaom returns None for the pixel format, so it is not usable for the changes needed later in this PR. I attempted to get the git version of ffmpeg-next compiling with libdav1d, but was running into issues, I believe because Arch's package manager only includes a dynamic library for libdav1d and not a static version. It probably makes sense to disable it anyway given the issues Windows users have been having with it. * No longer convert input to 8-bit for scene detect It appears that downconverting does have an impact on scene detection accuracy. The speed penalty for running in 10-bit compared to 8-bit is only 10%. Given this, it seems preferable to run the scene detect in the more accurate format. * Skip ffmpeg intermediate step for vapoursynth input * Fix skipping of ffmpeg pipe step This optimization added in #379 was never triggered. Because the initialize() method always added a set of default params to self.ffmpeg_params, the clause to skip the ffmpeg pipe, self.ffmpeg_params.is_empty(), was unreachable. * Revert "Remove sc-downscale-height CLI option" This reverts commit a51763607faddae07a595f567d4f4cf815de3299. * Validate pixel formats based on encoder support * Fix CI build The dynamic linking of ffmpeg doesn't seem to play nicely with the old version of ffmpeg which is packaged in Ubuntu's last LTS. This enables static linking when we are running in CI to work around that issue, given that that workaround is easier than overhauling which docker container we use.
2021-10-20 16:54:48 +00:00
cargo build --release --features ffmpeg_static
2021-05-15 06:09:01 +00:00
- name: Download videos
run: |
for url in raw.githubusercontent.com/OpenVisualCloud/SVT-AV1-Resources/master randomderp.com; do
curl -LO https://$url/video.tar.gz && break
done
tar xf video.tar.gz
2021-06-05 07:38:22 +00:00
- name: Testing ${{ matrix.name }}
run: |
target/release/av1an -i bus_cif.y4m -e ${{ matrix.enc }} -l log_av1an --keep -o "bus_cif.mkv" ${{ matrix.flags }}
du -h bus_cif.mkv
tree -a
2021-06-05 07:38:22 +00:00
- name: Cat log
if: always()
run: cat log_av1an.log
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2021-06-05 07:38:22 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
2021-06-05 07:38:22 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2021-06-05 07:38:22 +00:00
- name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: false
tags: av1an:action
cache-to: type=local,dest=/tmp/.buildx-cache
2021-06-05 07:38:22 +00:00
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2021-06-05 07:38:22 +00:00
- name: Tar docker cache
run: tar -cf /tmp/docker-cache.tar /tmp/.buildx-cache
- name: Artifact docker cache
uses: actions/upload-artifact@v2
with:
name: docker-cache
path: /tmp/docker-cache.tar
docker-publish:
needs: [validate, docker]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
2021-06-05 07:38:22 +00:00
- uses: actions/download-artifact@v2
with:
name: docker-cache
path: /tmp/
- name: Extract docker cache
run: tar -xf /tmp/docker-cache.tar -C /
2021-06-05 07:38:22 +00:00
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/av1an # list of Docker images to use as base name for tags
tag-sha: true # add git short SHA as Docker tag
2021-06-05 07:38:22 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
2021-06-05 07:38:22 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2021-06-05 07:38:22 +00:00
- name: Login to DockerHub
2021-06-05 07:38:22 +00:00
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2021-06-05 07:38:22 +00:00
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
2021-06-05 07:38:22 +00:00
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}