|
1 |
| -name: Build FFmpeg with CUDA Acceleration |
| 1 | +name: Build FFmpeg with CUDA support |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | workflow_dispatch:
|
5 | 5 |
|
6 | 6 | jobs:
|
7 | 7 | build:
|
8 | 8 | runs-on: windows-latest
|
9 |
| - strategy: |
10 |
| - matrix: |
11 |
| -# os: [windows-latest, ubuntu-latest, macos-latest] |
12 |
| - os: [windows-latest] |
| 9 | + |
13 | 10 | steps:
|
14 |
| - - name: Checkout repository |
15 |
| - uses: actions/checkout@v2 |
| 11 | + - name: Checkout the repository |
| 12 | + uses: actions/checkout@v3 |
16 | 13 |
|
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 |
22 | 18 |
|
23 |
| - - name: Set up dependencies for Linux |
24 |
| - if: matrix.os == 'ubuntu-latest' |
| 19 | + - name: Install CUDA |
25 | 20 | 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) |
29 | 22 |
|
30 |
| - - name: Set up dependencies for macOS |
31 |
| - if: matrix.os == 'macos-latest' |
| 23 | + - name: Download FFmpeg source |
32 | 24 | 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 |
34 | 28 |
|
35 |
| - - name: Install FFmpeg dependencies |
| 29 | + - name: Configure FFmpeg with CUDA support |
36 | 30 | 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" |
41 | 33 |
|
42 |
| - - name: Compile FFmpeg with CUDA support |
| 34 | + - name: Build FFmpeg with Visual Studio |
43 | 35 | 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