Skip to content

Commit 00f057c

Browse files
committed
Change build-dependencies.yml
1 parent 4986e36 commit 00f057c

File tree

1 file changed

+29
-53
lines changed

1 file changed

+29
-53
lines changed
Lines changed: 29 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,46 @@
1-
name: Build FFmpeg with CUDA Acceleration
1+
name: Build FFmpeg with CUDA support
22

33
on:
44
workflow_dispatch:
55

66
jobs:
77
build:
88
runs-on: windows-latest
9-
strategy:
10-
matrix:
11-
# os: [windows-latest, ubuntu-latest, macos-latest]
12-
os: [windows-latest]
9+
1310
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v2
11+
- name: Checkout the repository
12+
uses: actions/checkout@v3
1613

17-
- name: Set up CUDA for Windows
18-
if: matrix.os == 'windows-latest'
19-
run: |
20-
choco install cuda --version=11.6
21-
setx PATH "%PATH%;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin"
14+
- name: Set up Visual Studio
15+
uses: microsoft/setup-msbuild@v1
16+
with:
17+
vs-version: 'latest' # Use the latest version of Visual Studio
2218

23-
- name: Set up dependencies for Linux
24-
if: matrix.os == 'ubuntu-latest'
19+
- name: Install CUDA
2520
run: |
26-
sudo apt update
27-
sudo apt install -y build-essential yasm nasm libvpx-dev libx264-dev
28-
sudo apt install -y nvidia-cuda-toolkit
21+
choco install cuda --version=11.2 # Ensure CUDA is installed (version 11.2 or as needed)
2922
30-
- name: Set up dependencies for macOS
31-
if: matrix.os == 'macos-latest'
23+
- name: Download FFmpeg source
3224
run: |
33-
brew install yasm nasm
25+
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
26+
cd ffmpeg
27+
git checkout release/5.1 # You can adjust the release version as necessary
3428
35-
- name: Install FFmpeg dependencies
29+
- name: Configure FFmpeg with CUDA support
3630
run: |
37-
if [ ${{ matrix.os }} == 'windows-latest' ]; then
38-
choco install yasm
39-
choco install nasm
40-
fi
31+
cd ffmpeg
32+
./configure --enable-nvenc --enable-nvdec --enable-cuda --enable-libnpp --enable-shared --prefix=%cd%/ffmpeg_build --extra-cflags="-I%cd%/ffmpeg_build/include" --extra-ldflags="-L%cd%/ffmpeg_build/lib"
4133
42-
- name: Compile FFmpeg with CUDA support
34+
- name: Build FFmpeg with Visual Studio
4335
run: |
44-
if [ ${{ matrix.os }} == 'windows-latest' ]; then
45-
call "%VS140COMNTOOLS%..\..\..\VC\vcvarsall.bat" amd64
46-
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
47-
cd ffmpeg
48-
git checkout release/7.1
49-
./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-gpl
50-
make -j$(nproc)
51-
make install
52-
fi
53-
54-
if [ ${{ matrix.os }} == 'ubuntu-latest' ]; then
55-
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
56-
cd ffmpeg
57-
git checkout release/7.1
58-
./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-gpl
59-
make -j$(nproc)
60-
sudo make install
61-
fi
62-
63-
if [ ${{ matrix.os }} == 'macos-latest' ]; then
64-
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
65-
cd ffmpeg
66-
git checkout release/7.1
67-
./configure --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-gpl
68-
make -j$(nproc)
69-
sudo make install
70-
fi
36+
cd ffmpeg
37+
msbuild /p:Configuration=Release /p:Platform=x64
38+
39+
- name: Upload FFmpeg artifacts
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: ffmpeg-build-artifacts
43+
path: |
44+
ffmpeg_build/include
45+
ffmpeg_build/bin
46+
ffmpeg_build/lib

0 commit comments

Comments
 (0)