前言
Vapoursynth(后文简称VS) 是目前流行的压制工具,由于很多插件都只提供编译好的Windows插件,Linux插件需要自己手动编译。本文由此提供环境构建思路和Docker镜像,方便用户进行编译。同时也探讨了使用Github Action进行构建的可能性,欢迎大家一起探讨。
环境搭建
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| sudo -i apt-get update\ && apt-get install -y wget curl\ && echo "deb http://www.deb-multimedia.org bullseye main non-free" >> /etc/apt/sources.list\ && wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb\ && dpkg -i deb-multimedia-keyring_2016.8.1_all.deb\ && rm -rf deb-multimedia-keyring_2016.8.1_all.deb\ && apt-get update\ && apt-get upgrade -y\ && apt-get install -y python python3 python3-pip git unzip vim\ && apt-get install -y autoconf cargo git libfftw3-dev libtool vapoursynth-dev nasm\ && apt-get clean\ && apt-get autoremove \ && pip3 install meson ninja
|
Docker 镜像,
为了方便使用,我搭建了一个Docker镜像,方便直接直接进行构建:encodeguy/vapoursynth-linux:dev
1 2 3 4 5
| sudo -i apt install docker-compose
docker run -it encodeguy/vapoursynth-linux:dev /bin/bash
|
Github Actions 自动构建
鉴于 Github Actions 提供的自动化服务能够帮助我们在云端构建,同时编译二进制文件也不需要持续化运行,因此我考虑使用该方案进行自动化配置。
参考VS官方文档中说明,最小化构建没有安装所有可选的依赖,能够节约一定的时间;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
name: Build Vapoursynth Plugin
on: workflow_dispatch:
jobs: Build: runs-on: ubuntu-latest steps: - name: Set up Python run: | sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.9 python3-pip - name: Install decencies run: | sudo apt-get update sudo apt-get install -y wget curl sudo apt-get update sudo apt-get upgrade -y sudo apt-get install -y autoconf cargo git libfftw3-dev libtool nasm sudo apt-get clean sudo apt-get autoremove pip3 install meson ninja cython - name: Check zimg uses: actions/checkout@v2 with: repository: sekrit-twc/zimg ref: v3.0 - name: Install zimg run: | ./autogen.sh ./configure make sudo make install - name: Checkout Vapoursynth uses: actions/checkout@v2 with: repository: vapoursynth/vapoursynth
- name: Compile VS run: | ./autogen.sh ./configure make sudo make install - name: Checkout Plugin uses: actions/checkout@v2 with: repository: dubhater/vapoursynth-mvtools - name: Compile run: | mkdir build && cd build meson ../ ninja - name: Upload File uses: actions/upload-artifact@v2.2.2 with: name: Compiled path: build/*.so
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
name: Build Vapoursynth Plugin
on: workflow_dispatch:
jobs: Build: runs-on: ubuntu-latest steps: - name: Set up Python run: | sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.9 python3-pip - name: Install decencies run: | sudo apt-get update sudo apt-get install -y wget curl sudo apt-get update sudo apt-get upgrade -y sudo apt-get install -y autoconf cargo git libfftw3-dev libtool nasm sudo apt-get clean sudo apt-get autoremove /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install python3 ffmpeg libass zimg imagemagick pip3 install meson ninja cython - name: Checkout Vapoursynth uses: actions/checkout@v2 with: repository: vapoursynth/vapoursynth - name: Compile VS run: | ./autogen.sh ./configure make sudo make install - name: Checkout Plugin uses: actions/checkout@v2 with: repository: dubhater/vapoursynth-mvtools - name: Compile run: | mkdir build && cd build meson ../ ninja - name: Upload File uses: actions/upload-artifact@v2.2.2 with: name: Compiled path: build/*.so
|
后记
通过构建压制环境开发环境并打包成为Docker镜像以后可以很方便的帮助我们后续编译插件,而利用Github Actions 更是能够实现自动化编译