GitHub CI: build own FFmpeg [Linux]

The one in repository no longer contains NVENC and it is perhaps better
not to rely on a third-party PPA.
This commit is contained in:
Martin Pulec
2020-06-30 16:49:17 +02:00
parent b25998a05e
commit 0fda3dadef
4 changed files with 28 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
#!/bin/bash -eux
git clone --depth 1 https://git.ffmpeg.org/ffmpeg.git /var/tmp/ffmpeg
cd /var/tmp/ffmpeg
( git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git && cd nv-codec-headers && make && sudo make install )
( git clone --depth 1 https://aomedia.googlesource.com/aom && mkdir -p aom/build && cd aom/build && cmake -DBUILD_SHARED_LIBS=1 .. && make && sudo make install )
./configure --enable-shared --enable-gpl --enable-libx264 --enable-libopus --enable-nonfree --enable-nvenc --enable-libaom --enable-libvpx
make

7
.github/scripts/Linux/install_ffmpeg.sh vendored Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash -eux
cd /var/tmp/ffmpeg
( cd nv-codec-headers && sudo make install )
( cd aom/build && sudo make install )
sudo make install
sudo ldconfig

View File

@@ -13,9 +13,7 @@ else
fi
echo "::set-env name=CUDA_HOST_COMPILER::$CUDA_HOST_COMPILER"
if expr "$(lsb_release -ds)" : "Ubuntu 16.04"; then
sudo add-apt-repository -y ppa:jonathonf/ffmpeg-4
fi
sudo sed -n 'p; /^deb /s/^deb /deb-src /p' -i /etc/apt/sources.list # for build-dep ffmpeg
sudo apt update
sudo apt install libcppunit-dev nvidia-cuda-toolkit
sudo apt install libglew-dev freeglut3-dev libgl1-mesa-dev
@@ -23,7 +21,7 @@ sudo apt install libx11-dev
sudo apt install libsdl2-dev
sudo apt install libssl-dev
sudo apt install portaudio19-dev libjack-jackd2-dev libasound-dev libv4l-dev
sudo apt install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libva-dev libvdpau-dev
sudo apt build-dep ffmpeg
sudo apt install libopencv-dev
sudo apt install libglib2.0-dev libcurl4-nss-dev
( mkdir gpujpeg/build && cd gpujpeg/build && CC=$CUDA_HOST_COMPILER cmake .. && make && sudo make install && sudo ldconfig )

View File

@@ -76,6 +76,17 @@ jobs:
run: |
. .github/scripts/environment.sh
.github/scripts/Linux/prepare.sh
- name: Cache FFmpeg
id: cache-ffmpeg
uses: actions/cache@v1
with:
path: '/var/tmp/ffmpeg'
key: cache-ffmpeg-3
- name: Build FFmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: .github/scripts/Linux/download_build_ffmpeg.sh
- name: Install FFmpeg
run: .github/scripts/Linux/install_ffmpeg.sh
- name: configure
run: "[ ${{ github.ref }} != refs/heads/ndi-build ] && NDI=-disable-ndi; ./autogen.sh --enable-qt --with-cuda-host-compiler=$CUDA_HOST_COMPILER --enable-plugins --enable-jack-transport=force --with-live555=/usr/local $NDI"
- name: make