Compare commits
223 Commits
Author | SHA1 | Date | |
---|---|---|---|
4d4388bf62 | |||
5d7ddc217d | |||
1f8d08089d | |||
c78e519a2c | |||
e4ca060d44 | |||
aee86b9b20 | |||
d505e5d46c | |||
a1f41de31c | |||
0f144b81bb | |||
6f0a2d7ad6 | |||
46ef28c470 | |||
270c6fce9c | |||
1ac33dab8a | |||
a8752554ef | |||
da34fb4599 | |||
93976e2534 | |||
0c82344961 | |||
7dd8c987d0 | |||
d039a386b7 | |||
873680be3f | |||
09f9013713 | |||
56f8c998f6 | |||
349b58eecc | |||
b959d27624 | |||
10c88876bc | |||
c6b92d2f4e | |||
70bda63e9d | |||
1c68c6335a | |||
e72bad0214 | |||
1804b4eb32 | |||
1d19b49727 | |||
cbd4dc48f7 | |||
9295130beb | |||
5598d953c3 | |||
396376fd07 | |||
0fe5d095d9 | |||
c760b3218c | |||
c14c227819 | |||
82d140e7d3 | |||
38ecab2019 | |||
38d71e2878 | |||
5db2bab432 | |||
eb230b209c | |||
724ad0736a | |||
8249dc670a | |||
9b3025cd76 | |||
a477f8d2ed | |||
c447171e55 | |||
bf890278c0 | |||
6ebcc05909 | |||
d715a754f1 | |||
d0d8aae880 | |||
b0449badb8 | |||
2ebeb3e9a4 | |||
73b5fc5d98 | |||
cef469de9b | |||
7c904d18ac | |||
f1f3fb794c | |||
737f74db0c | |||
0e1b67f310 | |||
a15bfc298b | |||
ad9364ec80 | |||
c0567694ab | |||
7b6aab919f | |||
4298e9a94d | |||
e7df369012 | |||
6786d1fe98 | |||
8046a30542 | |||
702e11e7ad | |||
47aaf438f6 | |||
c5660a2fe3 | |||
105f314c8e | |||
949b952ef9 | |||
e517e524cc | |||
70c8c16e55 | |||
4f07e4e84e | |||
6929f42dd6 | |||
20bf845ddf | |||
66bd1fb20d | |||
5857c8f7b3 | |||
3662187a26 | |||
2538643d8f | |||
b02d60ae70 | |||
4b2f10e62c | |||
77fa7d0425 | |||
b4843c3c93 | |||
a34f18b836 | |||
037df191bb | |||
011e815b21 | |||
87ee3a9deb | |||
8b1aa0203b | |||
c2e11fe458 | |||
f149931d2f | |||
512fe8083a | |||
f43a71aaa0 | |||
1b3becb8d8 | |||
cea23c6d3f | |||
09afe7f781 | |||
6d8af9bd2a | |||
cf5c490ca7 | |||
740c0f1443 | |||
8e736fc176 | |||
0794129eb3 | |||
a510ee6450 | |||
cadbae2468 | |||
eed4f3bfd2 | |||
1173e86544 | |||
e4f69871fa | |||
847b88a4b4 | |||
beb2862876 | |||
bf9c403d51 | |||
4fc92a4b53 | |||
1db41d1069 | |||
5fce763b97 | |||
8cd96d2a1e | |||
adbbe8b0e2 | |||
8c1377ac0b | |||
f6b6de8146 | |||
d5c4a80332 | |||
89e2887db4 | |||
df491a68fd | |||
4418828161 | |||
158a3f4219 | |||
02c8f9089f | |||
cf638258b7 | |||
ebe0343972 | |||
29d3ae53b9 | |||
2744a17ea0 | |||
649f8542d4 | |||
61b2af2760 | |||
6e5afa8bd5 | |||
3e5859259a | |||
62166944bf | |||
85b34eb0c1 | |||
702d6bda6a | |||
3f9ddde766 | |||
28facf1b5f | |||
c3109dbae1 | |||
6d5c133800 | |||
e979b4ee9d | |||
a2350f473d | |||
36ddb729c5 | |||
cae9b66875 | |||
713613ff6f | |||
c9f3103a02 | |||
de055eec1f | |||
42175c4654 | |||
b309463c3d | |||
82d1853964 | |||
3ea263c5fc | |||
76c5a4779f | |||
1fe245034f | |||
4f496673c2 | |||
06b1779fcb | |||
8872ea8748 | |||
55949027f5 | |||
8d121ed665 | |||
024632c2b0 | |||
30c24bd34a | |||
acf3df4ff3 | |||
9ed037f47d | |||
0add715f1d | |||
09891f4dab | |||
67ea676a43 | |||
10adcb4b30 | |||
51d04c226a | |||
92558ec0fe | |||
099bd45b65 | |||
30326de759 | |||
a0306f7482 | |||
42ba9ed16a | |||
8a99c8191a | |||
287a563a0d | |||
64ebdbb558 | |||
b79b78022a | |||
f5a74179a5 | |||
bb8dc83221 | |||
67c37cd9e2 | |||
e9e97ab726 | |||
181af0c684 | |||
4adf604017 | |||
5c122f7c9c | |||
c490f875e1 | |||
99448ba228 | |||
4f08126a5b | |||
21c9f2a966 | |||
46eb4b8996 | |||
bb34f9235d | |||
162bd7a657 | |||
62b44ac5ed | |||
f3e31a5c17 | |||
8c1c88860b | |||
d976c0a693 | |||
fa34f5e06f | |||
b7ba32c1cb | |||
0ca0001fdc | |||
cedfb4f831 | |||
721da5031c | |||
4cb460ae3a | |||
c4552ae9f6 | |||
49dbae0739 | |||
911b943b8b | |||
dd9b7f02f5 | |||
39020cb85a | |||
1d71c25774 | |||
c3a854dff1 | |||
b4e3a01b9f | |||
4ddec41343 | |||
3bbaab4377 | |||
11b61948a3 | |||
0e943a3418 | |||
6dfde52c97 | |||
4925f91bc5 | |||
cf751b6179 | |||
991e88165e | |||
d11a030f7a | |||
87b01c3d32 | |||
ca5c74009e | |||
2cce057825 | |||
199183c25c | |||
0b17eb8a08 | |||
3ee7f9a5e6 | |||
9531c5f046 |
43
.github/actions/libfdkaac/action.yml
vendored
Normal file
43
.github/actions/libfdkaac/action.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: libfdkaac
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout FDK AAC
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: mstorsjo/fdk-aac
|
||||||
|
ref: ${{ inputs.refId }}
|
||||||
|
path: fdkaac
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build FDK AAC
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd fdkaac ; autoreconf -fiv ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared --disable-static ; make -j 2 ; make install ; cd ../build ; tar czf ../dist/libfdkaac.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libfdkaac-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libfdkaac.tgz
|
18
.github/actions/libmfx/action.yml
vendored
Normal file
18
.github/actions/libmfx/action.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: libmfx
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libmfx-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: .github/actions/libmfx/libmfx.tgz
|
BIN
.github/actions/libmfx/libmfx.tgz
vendored
Normal file
BIN
.github/actions/libmfx/libmfx.tgz
vendored
Normal file
Binary file not shown.
32
.github/actions/libmp3lame/action.yml
vendored
Normal file
32
.github/actions/libmp3lame/action.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: libmp3lame
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm svn
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build LAME
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'svn co https://svn.code.sf.net/p/lame/svn/${{ inputs.refId }}/lame lame ; cd lame ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --enable-nasm --disable-frontend --disable-shared --enable-static ; make -j ; make install ; cd ../build ; tar czf ../dist/libmp3lame.tgz *
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libmp3lame-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libmp3lame.tgz
|
61
.github/actions/liboggvorbis/action.yml
vendored
Normal file
61
.github/actions/liboggvorbis/action.yml
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
name: liboggvorbis
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
libogg_refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
libvorbis_refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout Ogg
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: xiph/ogg
|
||||||
|
ref: ${{ inputs.libogg_refId }}
|
||||||
|
path: ogg
|
||||||
|
- name: Checkout Vorbis
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: xiph/vorbis
|
||||||
|
ref: ${{ inputs.libvorbis_refId }}
|
||||||
|
path: vorbis
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build Ogg
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ogg ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared ; make -j ; make install'
|
||||||
|
- name: Build Vorbis
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vorbis ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared ; make -j ; make install ; sed -i '/^Libs\.private.*/d' ../build/lib/pkgconfig/vorbis.pc ; cd ../build ; tar czf ../dist/liboggvorbis.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: liboggvorbis-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/liboggvorbis.tgz
|
46
.github/actions/libopus/action.yml
vendored
Normal file
46
.github/actions/libopus/action.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
name: libopus
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout OPUS
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: xiph/opus
|
||||||
|
ref: v1.3.1
|
||||||
|
path: opus
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build OPUS
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
|
cd opus\win32\VS2015
|
||||||
|
MSBuild.exe /property:Configuration="${{ env.msbuildConfig }}" /property:Platform=x64 /property:PlatformToolset=v143 opus.vcxproj
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cp x64/${{ inputs.config }}/opus.lib ../../../build/lib/opus.lib ; cd ../../.. ; cp -r opus/include build/include/opus ; cp opus/opus.pc.in build/lib/pkgconfig/opus.pc ; sed -i "s#@prefix@#$(realpath ../../../build)#g" build/lib/pkgconfig/opus.pc ; sed -i "s/@exec_prefix@/\$\{prefix\}/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@libdir@/\$\{prefix\}\/lib/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@includedir@/\$\{prefix\}\/include/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@LIBM@//g" build/lib/pkgconfig/opus.pc; sed -i "s/@VERSION@/2.0.0/g" build/lib/pkgconfig/opus.pc ; cd build ; tar czf ../dist/libopus.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libopus-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libopus.tgz
|
50
.github/actions/libsnappy/action.yml
vendored
Normal file
50
.github/actions/libsnappy/action.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
name: libsnappy
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout Snappy
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: google/snappy
|
||||||
|
ref: ${{ inputs.refId }}
|
||||||
|
path: snappy
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build Snappy
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
|
cd snappy
|
||||||
|
git submodule update --init
|
||||||
|
md work
|
||||||
|
cd work
|
||||||
|
cmake -G "Visual Studio 17 2022" .. -DCMAKE_INSTALL_PREFIX=..\..\build -DBUILD_SHARED_LIBS=OFF -DSNAPPY_BUILD_TESTS=OFF
|
||||||
|
MSBuild.exe /property:Configuration="${{ env.msbuildConfig }}" Snappy.sln
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cp ${{ inputs.config }}/snappy.lib ../../build/lib/snappy.lib ; cp ../snappy.h ../snappy-c.h ../../build/include/ ; cd ../../build ; tar czf ../dist/libsnappy.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libsnappy-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libsnappy.tgz
|
47
.github/actions/libsvtav1/action.yml
vendored
Normal file
47
.github/actions/libsvtav1/action.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
name: libsvtav1
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git clone -b ${{ inputs.refId }} https://gitlab.com/AOMediaCodec/SVT-AV1 svtav1
|
||||||
|
cd svtav1
|
||||||
|
git apply --ignore-whitespace --verbose ..\.github\actions\libsvtav1\patches\A01-metadata-copy-segfault-fix.patch
|
||||||
|
cd ..
|
||||||
|
#- name: Checkout SVT AV1
|
||||||
|
# uses: actions/checkout@v3
|
||||||
|
# with:
|
||||||
|
# repository: AOMediaCodec/SVT-AV1
|
||||||
|
# ref: ${{ inputs.refId }}
|
||||||
|
# path: svtav1
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build SVT AV1
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd svtav1/Build/windows ; ./build.bat 2022 ${{ inputs.config }} static ; cp -r ../../Source/API ../../../build/include/svt-av1 ; cp ../../Bin/${{ inputs.config }}/SvtAv1Enc.lib ../../../build/lib/ ; cp SvtAv1Enc.pc ../../../build/lib/pkgconfig/ ; cd ../../../build ; tar czf ../dist/libsvtav1.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libsvtav1-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libsvtav1.tgz
|
37
.github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch
vendored
Normal file
37
.github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
From 213854249dc8d69653a9f3281cdd4c2063cd3779 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christopher Degawa <christopher.degawa@intel.com>
|
||||||
|
Date: Wed, 10 Aug 2022 13:53:17 -0500
|
||||||
|
Subject: [PATCH] copy_input_buffer: only copy metadata if a frame was actaully
|
||||||
|
sent
|
||||||
|
|
||||||
|
Fixes a segfault if EOS was send through the library without zeroing
|
||||||
|
out the metadata array
|
||||||
|
|
||||||
|
Signed-off-by: Christopher Degawa <christopher.degawa@intel.com>
|
||||||
|
---
|
||||||
|
Source/Lib/Encoder/Globals/EbEncHandle.c | 9 +++++----
|
||||||
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Source/Lib/Encoder/Globals/EbEncHandle.c b/Source/Lib/Encoder/Globals/EbEncHandle.c
|
||||||
|
index ba5e719a4..fc7a2b1f4 100644
|
||||||
|
--- a/Source/Lib/Encoder/Globals/EbEncHandle.c
|
||||||
|
+++ b/Source/Lib/Encoder/Globals/EbEncHandle.c
|
||||||
|
@@ -4814,11 +4814,12 @@ static void copy_input_buffer(SequenceControlSet* scs, EbBufferHeaderType* dst,
|
||||||
|
} else if (pass != ENCODE_FIRST_PASS || copy_frame) {
|
||||||
|
// Bypass copy for the unecessary picture in IPPP pass
|
||||||
|
// Copy the picture buffer
|
||||||
|
- if (src->p_buffer != NULL)
|
||||||
|
+ if (src->p_buffer != NULL) {
|
||||||
|
copy_frame_buffer(scs, dst->p_buffer, dst_y8b->p_buffer, src->p_buffer, pass);
|
||||||
|
- // Copy the metadata array
|
||||||
|
- if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone)
|
||||||
|
- dst->metadata = NULL;
|
||||||
|
+ // Copy the metadata array
|
||||||
|
+ if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone)
|
||||||
|
+ dst->metadata = NULL;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy the private data list
|
||||||
|
--
|
||||||
|
GitLab
|
48
.github/actions/libvpl/action.yml
vendored
Normal file
48
.github/actions/libvpl/action.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
name: libvpl
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout oneVPL
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: oneapi-src/oneVPL
|
||||||
|
ref: ${{ inputs.refId }}
|
||||||
|
path: onevpl
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build oneVPL
|
||||||
|
shell: cmd
|
||||||
|
#env:
|
||||||
|
# vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
# msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md temp build dist
|
||||||
|
cd temp
|
||||||
|
cmake.exe -G "Visual Studio 17 2022" ..\onevpl -T host=x64 -A x64 -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=..\build -DCMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD=ON
|
||||||
|
MSBuild.exe -t:VPL,INSTALL -p:Configuration=${{ env.msbuildConfig }} -m vpl.sln
|
||||||
|
cd ..\build
|
||||||
|
IF EXIST "lib\vpld.lib" move "lib\vpld.lib" "lib\vpl.lib"
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'rm -rf bin/cmake ; tar czf ../dist/libvpl.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libvpl-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libvpl.tgz
|
38
.github/actions/libvpx/action.yml
vendored
Normal file
38
.github/actions/libvpx/action.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
name: libvpx
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git clone --depth 1 -b ${{ inputs.refId }} https://github.com/webmproject/libvpx.git vpx
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build LibVpx
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vpx ; ./configure --prefix=../build --target=x86_64-win64-vs17 --enable-vp9-highbitdepth --disable-shared --disable-examples --disable-tools --disable-docs --disable-libyuv --disable-unit_tests --disable-postproc ; make -j ; make install ; mv ../build/lib/x64/vpxmd.lib ../build/lib/vpx.lib ; rm -rf ../build/lib/x64 ; cd ../build ; tar czf ../dist/libvpx.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libvpx-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libvpx.tgz
|
43
.github/actions/libx264/action.yml
vendored
Normal file
43
.github/actions/libx264/action.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: libx264
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout X264
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: mirror/x264
|
||||||
|
ref: ${{ inputs.refId }}
|
||||||
|
path: x264
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build X264
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd x264 ; CC=cl ./configure --prefix=$(realpath ../build) --disable-cli --enable-static --enable-pic --libdir=../build/lib ; make -j ; make install-lib-static ; cd ../build ; tar czf ../dist/libx264.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libx264-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libx264.tgz
|
39
.github/actions/libx265-10/action.yml
vendored
Normal file
39
.github/actions/libx265-10/action.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: libx265-10
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Checkout X265
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git clone -b ${{ inputs.refId }} https://github.com/videolan/x265.git x265
|
||||||
|
- name: Set up MSBuild
|
||||||
|
uses: microsoft/setup-msbuild@v1.1
|
||||||
|
- name: Set up NASM
|
||||||
|
uses: ilammy/setup-nasm@v1.2.1
|
||||||
|
- name: Build X265 (10 bit)
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
cd x265/build/vc15-x86_64
|
||||||
|
md work
|
||||||
|
cd work
|
||||||
|
cmake -G "Visual Studio 17 2022" ..\..\..\source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
|
||||||
|
MSBuild.exe /property:Configuration="${{ env.msbuildConfig }}" x265-static.vcxproj
|
||||||
|
move ${{ inputs.config }}\x265-static.lib ..\..\..\..\dist\x265_10bit.lib
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: x265_10bit-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/x265_10bit.lib
|
43
.github/actions/libx265-12/action.yml
vendored
Normal file
43
.github/actions/libx265-12/action.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: libx265-12
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Checkout X265
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git clone -b ${{ inputs.refId }} https://github.com/videolan/x265.git x265
|
||||||
|
- name: Set up MSBuild
|
||||||
|
uses: microsoft/setup-msbuild@v1.1
|
||||||
|
- name: Set up NASM
|
||||||
|
uses: ilammy/setup-nasm@v1.2.1
|
||||||
|
- name: Build X265 (12 bit)
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
cd x265/build/vc15-x86_64
|
||||||
|
md work
|
||||||
|
cd work
|
||||||
|
cmake -G "Visual Studio 17 2022" ..\..\..\source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
|
||||||
|
MSBuild.exe /property:Configuration="${{ env.msbuildConfig }}" x265-static.vcxproj
|
||||||
|
move ${{ inputs.config }}\x265-static.lib ..\..\..\..\dist\x265_12bit.lib
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: x265_12bit-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/x265_12bit.lib
|
58
.github/actions/libx265/action.yml
vendored
Normal file
58
.github/actions/libx265/action.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
name: libx265
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Checkout X265
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git clone -b Release_3.5 https://github.com/videolan/x265.git x265
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake
|
||||||
|
path-type: inherit
|
||||||
|
- name: Set up MSBuild
|
||||||
|
uses: microsoft/setup-msbuild@v1.1
|
||||||
|
- name: Set up NASM
|
||||||
|
uses: ilammy/setup-nasm@v1.2.1
|
||||||
|
- name: Set up dependant libs
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build
|
||||||
|
- name: Build X265
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md di dist dist\include dist\lib dist\lib\pkgconfig
|
||||||
|
cd x265/build/vc15-x86_64
|
||||||
|
md work
|
||||||
|
cd work
|
||||||
|
cmake -G "Visual Studio 17 2022" ..\..\..\source -DCMAKE_INSTALL_PREFIX=..\..\..\..\build -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DEXTRA_LIB="libx265_10bit.lib;libx265_12bit.lib" -DLINKED_10BIT=ON -DLINKED_12BIT=ON
|
||||||
|
MSBuild.exe /property:Configuration="${{ env.msbuildConfig }}" x265-static.vcxproj
|
||||||
|
cp x265.pc ..\..\..\..\dist\lib\pkgconfig\x265.pc
|
||||||
|
move ${{ inputs.config }}\x265-static.lib ..\..\..\..\build\
|
||||||
|
move x265_config.h ..\..\..\..\dist\include\
|
||||||
|
cd ..\..\..\..
|
||||||
|
"${{ env.vsPath }}VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\lib.exe" /ignore:4006 /ignore:4221 /OUT:dist\lib\x265.lib build\x265-static.lib build\x265_10bit-${{ runner.os }}-${{ inputs.config }}\x265_10bit.lib build\x265_12bit-${{ runner.os }}-${{ inputs.config }}\x265_12bit.lib
|
||||||
|
copy x265\source\x265.h dist\include\
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd dist ; tar czf ../di/libx265.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libx265-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: di/libx265.tgz
|
44
.github/actions/libzimg/action.yml
vendored
Normal file
44
.github/actions/libzimg/action.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: libzimg
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout ZIMG
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: sekrit-twc/zimg
|
||||||
|
ref: ${{ inputs.refId }}
|
||||||
|
path: zimg
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build ZIMG
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd zimg ; ./autogen.sh ; ./configure --prefix=$(realpath ../build) ; cd _msvc/zimg ; MSBuild.exe /property:Configuration="${{ env.msbuildConfig }}" /property:ConfigurationType=StaticLibrary /property:PlatformToolset=v143 /property:Platform=x64 /property:WholeProgramOptimization=false zimg.vcxproj ; cp x64/${{ inputs.config }}/z.lib ../../../build/lib/zimg.lib ; cd ../.. ; cp src/zimg/api/zimg.h ../build/include/zimg.h ; cp zimg.pc ../build/lib/pkgconfig/zimg.pc ; cd ../build ; tar czf ../dist/libzimg.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libzimg-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libzimg.tgz
|
23
.github/workflows/build.yml
vendored
Normal file
23
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: Build all
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
# schedule:
|
||||||
|
# - cron: "0 1 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ffmpeg-static-debug:
|
||||||
|
uses: ./.github/workflows/ffmpeg.yml
|
||||||
|
with:
|
||||||
|
system: windows-2022
|
||||||
|
type: static
|
||||||
|
config: debug
|
||||||
|
ffmpegRef: release/5.1
|
||||||
|
|
||||||
|
ffmpeg-static-release:
|
||||||
|
uses: ./.github/workflows/ffmpeg.yml
|
||||||
|
with:
|
||||||
|
system: windows-2022
|
||||||
|
type: static
|
||||||
|
config: release
|
||||||
|
ffmpegRef: release/5.1
|
220
.github/workflows/ffmpeg-cartwheel.yml
vendored
Normal file
220
.github/workflows/ffmpeg-cartwheel.yml
vendored
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
name: 'Build FFmpeg from cartwheel'
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'windows-2022'
|
||||||
|
description: 'System'
|
||||||
|
options:
|
||||||
|
- windows-2022
|
||||||
|
|
||||||
|
type:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'static'
|
||||||
|
description: Type
|
||||||
|
options:
|
||||||
|
- static
|
||||||
|
- shared
|
||||||
|
|
||||||
|
config:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'debug'
|
||||||
|
description: 'Configuration'
|
||||||
|
options:
|
||||||
|
- debug
|
||||||
|
- release
|
||||||
|
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
ffmpegRef:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
COMPONENTS: "--enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvpx "
|
||||||
|
NASM_EXECUTABLE: nasm
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
libvpl:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libvpl
|
||||||
|
with:
|
||||||
|
refId: master
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
liboggvorbis:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/liboggvorbis
|
||||||
|
with:
|
||||||
|
libogg_refId: v1.3.5
|
||||||
|
libvorbis_refId: v1.3.7
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libsvtav1:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libsvtav1
|
||||||
|
with:
|
||||||
|
refId: v1.1.0
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libsnappy:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libsnappy
|
||||||
|
with:
|
||||||
|
refId: 1.1.9
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libvpx:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libvpx
|
||||||
|
with:
|
||||||
|
refId: v1.12.0
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libmp3lame:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libmp3lame
|
||||||
|
with:
|
||||||
|
refId: tags/RELEASE__3_100
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libzimg:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libzimg
|
||||||
|
with:
|
||||||
|
refId: release-3.0.4
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libopus:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libopus
|
||||||
|
with:
|
||||||
|
refId: v1.3.1
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libfdkaac:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libfdkaac
|
||||||
|
with:
|
||||||
|
refId: v2.0.2
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx264:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx264
|
||||||
|
with:
|
||||||
|
refId: stable
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx265-12:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx265-12
|
||||||
|
with:
|
||||||
|
refId: Release_3.5
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx265-10:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx265-10
|
||||||
|
with:
|
||||||
|
refId: Release_3.5
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx265:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
needs: [libx265-12,libx265-10]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx265
|
||||||
|
with:
|
||||||
|
refId: Release_3.5
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
cartwheel:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
needs: [libvpl,libopus,libsvtav1,libsnappy,libmp3lame,libzimg,liboggvorbis,libx264,libx265,libfdkaac,libvpx]
|
||||||
|
steps:
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Set up GIT
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git config --global user.email "daniel.stankewitz@gmail.com"
|
||||||
|
git config --global user.name "Daniel Stankewitz"
|
||||||
|
- name: Checkout patches
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
- name: Checkout NvEnc
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: FFmpeg/nv-codec-headers
|
||||||
|
ref: master
|
||||||
|
path: nvenc
|
||||||
|
- name: Checkout AMF
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: GPUOpen-LibrariesAndSDKs/AMF
|
||||||
|
ref: master
|
||||||
|
path: amf
|
||||||
|
- name: Set up artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build_artifacts
|
||||||
|
- name: Build FFmpeg from Cartwheel
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
rem D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git checkout b3f9843cffd4118e35bb000779444ca2f4196342 ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0003-dynamic-loading-of-shared-fdk-aac-library-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --pkg-config-flags="--static" --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --disable-devices --disable-demuxers --disable-decoders --disable-network --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-static-${{ inputs.config }}.tar.gz *'
|
||||||
|
rem D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git checkout 2757a1d43ca83a3762b24a7ddd74b3291873f89c ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0001-dynamic-loading-of-shared-fdk-aac-library-cw-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --pkg-config-flags="--static" --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-static-${{ inputs.config }}.tar.gz *'
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../libfdkaac-dynlib-5.1.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||||
|
- name: Publish artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: FFmpeg ${{ runner.os }} ${{ inputs.type }} ${{ inputs.config }} package build
|
||||||
|
path: dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz
|
186
.github/workflows/ffmpeg-lgpl.yaml
vendored
Normal file
186
.github/workflows/ffmpeg-lgpl.yaml
vendored
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
name: 'Build FFmpeg (LGPL)'
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'windows-2022'
|
||||||
|
description: 'System'
|
||||||
|
options:
|
||||||
|
- windows-2022
|
||||||
|
|
||||||
|
type:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'shared'
|
||||||
|
description: Type
|
||||||
|
options:
|
||||||
|
- static
|
||||||
|
- shared
|
||||||
|
|
||||||
|
config:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'release'
|
||||||
|
description: 'Configuration'
|
||||||
|
options:
|
||||||
|
- debug
|
||||||
|
- release
|
||||||
|
|
||||||
|
ffmpegRef:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
default: 'master'
|
||||||
|
description: 'FFmpeg refId'
|
||||||
|
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
ffmpegRef:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
COMPONENTS: "--enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libvpx --enable-libopus "
|
||||||
|
#--enable-libvorbis
|
||||||
|
NASM_EXECUTABLE: nasm
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared --build-suffix=-voukoderpro' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
libvpl:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libvpl
|
||||||
|
with:
|
||||||
|
refId: master
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
#liboggvorbis:
|
||||||
|
# runs-on: ${{ inputs.system }}
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v3
|
||||||
|
# - uses: ./.github/actions/liboggvorbis
|
||||||
|
# with:
|
||||||
|
# libogg_refId: v1.3.5
|
||||||
|
# libvorbis_refId: v1.3.7
|
||||||
|
# config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libsvtav1:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libsvtav1
|
||||||
|
with:
|
||||||
|
refId: v1.4.1
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libsnappy:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libsnappy
|
||||||
|
with:
|
||||||
|
refId: 1.1.9
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libvpx:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libvpx
|
||||||
|
with:
|
||||||
|
refId: v1.12.0
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libmp3lame:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libmp3lame
|
||||||
|
with:
|
||||||
|
refId: tags/RELEASE__3_100
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libzimg:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libzimg
|
||||||
|
with:
|
||||||
|
refId: release-3.0.4
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libopus:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libopus
|
||||||
|
with:
|
||||||
|
refId: v1.3.1
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
ffmpeg:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
needs: [libvpl,libsvtav1,libsnappy,libvpx,libmp3lame,libzimg,libopus]
|
||||||
|
#liboggvorbis
|
||||||
|
steps:
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Set up GIT
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git config --global user.email "daniel.stankewitz@gmail.com"
|
||||||
|
git config --global user.name "Daniel Stankewitz"
|
||||||
|
- name: Checkout patches
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
- name: Checkout FFmpeg
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: FFmpeg/FFmpeg.git
|
||||||
|
ref: ${{ inputs.ffmpegRef }}
|
||||||
|
path: ffmpeg
|
||||||
|
- name: Checkout NvEnc
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: FFmpeg/nv-codec-headers
|
||||||
|
ref: master
|
||||||
|
path: nvenc
|
||||||
|
- name: Checkout AMF
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: GPUOpen-LibrariesAndSDKs/AMF
|
||||||
|
ref: master
|
||||||
|
path: amf
|
||||||
|
- name: Set up artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build_artifacts
|
||||||
|
- name: Build FFmpeg
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../build/lib ; rm -rf cmake pkgconfig *.la ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||||
|
- name: Publish FFmpeg artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: FFmpeg ${{ inputs.system }} ${{ inputs.config }}${{ inputs.config }} package build
|
||||||
|
path: dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz
|
406
.github/workflows/ffmpeg-shared.yml
vendored
406
.github/workflows/ffmpeg-shared.yml
vendored
@ -1,406 +0,0 @@
|
|||||||
name: FFmpeg Shared (v143)
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
config:
|
|
||||||
type: choice
|
|
||||||
description: Configuration
|
|
||||||
options:
|
|
||||||
- Debug
|
|
||||||
- Release
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: "0 5 * * *"
|
|
||||||
|
|
||||||
env:
|
|
||||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
|
||||||
switches: "--enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libopus --enable-libvorbis --enable-libvpx "
|
|
||||||
NASM_EXECUTABLE: nasm
|
|
||||||
msysConfig: release
|
|
||||||
winConfig: Release
|
|
||||||
cFlags: -MD
|
|
||||||
source: "official"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
liboggvorbis:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout Ogg
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: xiph/ogg
|
|
||||||
ref: master
|
|
||||||
path: ogg
|
|
||||||
- name: Checkout Vorbis
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: xiph/vorbis
|
|
||||||
ref: master
|
|
||||||
path: vorbis
|
|
||||||
- name: Check cache
|
|
||||||
id: liboggvorbis-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: liboggvorbis-${{ env.msysConfig }}-${{ hashFiles('ogg') }}-${{ hashFiles('vorbis') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.liboggvorbis-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build Ogg
|
|
||||||
if: steps.liboggvorbis-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ogg ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared ; make -j ; make install'
|
|
||||||
- name: Build Vorbis
|
|
||||||
if: steps.liboggvorbis-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vorbis ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared ; make -j ; make install ; sed -i '/^Libs\.private.*/d' ../build/lib/pkgconfig/vorbis.pc ; cd ../build ; tar czf ../dist/liboggvorbis.tgz *'
|
|
||||||
echo "switches=${{env.switches}} --enable-encoder=libopus --enable-encoder=libvorbis" >> $GITHUB_ENV
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: liboggvorbis
|
|
||||||
path: dist/liboggvorbis.tgz
|
|
||||||
|
|
||||||
libvpl:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout oneVPL
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: oneapi-src/oneVPL
|
|
||||||
ref: master
|
|
||||||
path: onevpl
|
|
||||||
- name: Check cache
|
|
||||||
id: libvpl-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libvpl-${{ env.msysConfig }}-${{ hashFiles('onevpl') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libvpl-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build oneVPL
|
|
||||||
if: steps.libvpl-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md temp build dist
|
|
||||||
cd temp
|
|
||||||
cmake.exe -G "Visual Studio 17 2022" ..\onevpl -T host=x64 -A x64 -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=..\build -DCMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD=ON
|
|
||||||
MSBuild.exe -t:VPL,INSTALL -p:Configuration=${{ env.winConfig }} -m vpl.sln
|
|
||||||
cd ..\build
|
|
||||||
IF EXIST "lib\vpld.lib" move "lib\vpld.lib" "lib\vpl.lib"
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'rm -rf bin/cmake ; tar czf ../dist/libvpl.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libvpl
|
|
||||||
path: dist/libvpl.tgz
|
|
||||||
|
|
||||||
libsvtav1:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout SVT AV1
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: AOMediaCodec/SVT-AV1
|
|
||||||
ref: master
|
|
||||||
path: svtav1
|
|
||||||
- name: Check cache
|
|
||||||
id: libsvtav1-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libsvtav1-${{ env.msysConfig }}-${{ hashFiles('svtav1') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libsvtav1-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build SVT AV1
|
|
||||||
if: steps.libsvtav1-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd svtav1/Build/windows ; ./build.bat 2022 ${{ env.winConfig }} static ; cp -r ../../Source/API ../../../build/include/svt-av1 ; cp ../../Bin/${{ env.msysConfig }}/SvtAv1Enc.lib ../../../build/lib/ ; cp SvtAv1Enc.pc ../../../build/lib/pkgconfig/ ; cd ../../../build ; tar czf ../dist/libsvtav1.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libsvtav1
|
|
||||||
path: dist/libsvtav1.tgz
|
|
||||||
|
|
||||||
libsnappy:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout Snappy
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: google/snappy
|
|
||||||
ref: "1.1.8"
|
|
||||||
path: snappy
|
|
||||||
- name: Check cache
|
|
||||||
id: libsnappy-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libsnappy-${{ env.msysConfig }}-${{ hashFiles('snappy') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libsnappy-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build Snappy
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
cd snappy
|
|
||||||
md work
|
|
||||||
cd work
|
|
||||||
cmake -G "Visual Studio 17 2022" .. -DCMAKE_INSTALL_PREFIX=..\..\build -DBUILD_SHARED_LIBS=OFF -DSNAPPY_BUILD_TESTS=OFF
|
|
||||||
MSBuild.exe /property:Configuration="${{ env.winConfig }}" Snappy.sln
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cp ${{ env.winConfig }}/snappy.lib ../../build/lib/snappy.lib ; cp ../snappy.h ../snappy-c.h ../../build/include/ ; cd ../../build ; tar czf ../dist/libsnappy.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libsnappy
|
|
||||||
path: dist/libsnappy.tgz
|
|
||||||
|
|
||||||
libvpx:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
git clone https://github.com/webmproject/libvpx.git vpx
|
|
||||||
- name: Check cache
|
|
||||||
id: libvpx-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libvpx-${{ env.msysConfig }}-${{ hashFiles('vpx') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libvpx-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build LibVpx
|
|
||||||
if: steps.libvpx-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vpx ; ./configure --prefix=../build --target=x86_64-win64-vs17 --enable-vp9-highbitdepth --disable-shared --disable-examples --disable-tools --disable-docs --disable-libyuv --disable-unit_tests --disable-postproc ; make -j ; make install ; mv ../build/lib/x64/vpxmd.lib ../build/lib/vpx.lib ; rm -rf ../build/lib/x64 ; cd ../build ; tar czf ../dist/libvpx.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libvpx
|
|
||||||
path: dist/libvpx.tgz
|
|
||||||
|
|
||||||
libmp3lame:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up MSYS2
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm svn
|
|
||||||
path-type: inherit
|
|
||||||
- name: Set up cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
env:
|
|
||||||
cache-name: cache-ffmpeg-${{ env.msysConfig }}
|
|
||||||
with:
|
|
||||||
path: cache
|
|
||||||
key: cache-key
|
|
||||||
- name: Build LAME
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'svn co https://svn.code.sf.net/p/lame/svn/trunk/lame@6474 lame ; cd lame ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --enable-nasm --disable-frontend --disable-shared --enable-static ; make -j ; make install ; cd ../build ; tar czf ../dist/libmp3lame.tgz *
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libmp3lame
|
|
||||||
path: dist/libmp3lame.tgz
|
|
||||||
|
|
||||||
libzimg:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout ZIMG
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: sekrit-twc/zimg
|
|
||||||
ref: release-2.9.2
|
|
||||||
path: zimg
|
|
||||||
- name: Check cache
|
|
||||||
id: libzimg-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libzimg-${{ env.msysConfig }}-${{ hashFiles('zimg') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libzimg-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build ZIMG
|
|
||||||
if: steps.libzimg-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd zimg ; ./autogen.sh ; ./configure --prefix=$(realpath ../build) ; cd _msvc/zimg ; MSBuild.exe /property:Configuration="${{ env.winConfig }}" /property:ConfigurationType=StaticLibrary /property:PlatformToolset=v143 /property:Platform=x64 /property:WholeProgramOptimization=false zimg.vcxproj ; cp x64/${{ env.winConfig }}/z.lib ../../../build/lib/zimg.lib ; cd ../.. ; cp src/zimg/api/zimg.h ../build/include/zimg.h ; cp zimg.pc ../build/lib/pkgconfig/zimg.pc ; cd ../build ; tar czf ../dist/libzimg.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libzimg
|
|
||||||
path: dist/libzimg.tgz
|
|
||||||
|
|
||||||
libopus:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout OPUS
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: xiph/opus
|
|
||||||
ref: master
|
|
||||||
path: opus
|
|
||||||
- name: Check cache
|
|
||||||
id: libopus-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libopus-${{ env.msysConfig }}-${{ hashFiles('opus') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libopus-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build OPUS
|
|
||||||
if: steps.libopus-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
cd opus\win32\VS2015
|
|
||||||
MSBuild.exe /property:Configuration="${{ env.winConfig }}" /property:Platform=x64 /property:PlatformToolset=v143 opus.vcxproj
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cp x64/${{ env.winConfig }}/opus.lib ../../../build/lib/opus.lib ; cd ../../.. ; cp -r opus/include build/include/opus ; cp opus/opus.pc.in build/lib/pkgconfig/opus.pc ; sed -i "s#@prefix@#$(realpath ../../../build)#g" build/lib/pkgconfig/opus.pc ; sed -i "s/@exec_prefix@/\$\{prefix\}/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@libdir@/\$\{prefix\}\/lib/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@includedir@/\$\{prefix\}\/include/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@LIBM@//g" build/lib/pkgconfig/opus.pc; sed -i "s/@VERSION@/2.0.0/g" build/lib/pkgconfig/opus.pc ; cd build ; tar czf ../dist/libopus.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libopus
|
|
||||||
path: dist/libopus.tgz
|
|
||||||
|
|
||||||
ffmpeg:
|
|
||||||
runs-on: windows-2022
|
|
||||||
needs: [libopus,libvpl,libsvtav1,libsnappy,libmp3lame,libzimg,liboggvorbis,libvpx]
|
|
||||||
steps:
|
|
||||||
- name: Set up MSYS2
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
git config --global user.email "daniel.stankewitz@gmail.com"
|
|
||||||
git config --global user.name "Daniel Stankewitz"
|
|
||||||
|
|
||||||
- name: Checkout patches
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
|
|
||||||
- name: Checkout FFmpeg
|
|
||||||
if: ${{env.source == 'official'}}
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: FFmpeg/FFmpeg.git
|
|
||||||
ref: release/5.0
|
|
||||||
path: ffmpeg
|
|
||||||
|
|
||||||
- name: Checkout NvEnc
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: FFmpeg/nv-codec-headers
|
|
||||||
ref: sdk/9.1
|
|
||||||
path: nvenc
|
|
||||||
|
|
||||||
- name: Checkout AMF
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: GPUOpen-LibrariesAndSDKs/AMF
|
|
||||||
ref: master
|
|
||||||
path: amf
|
|
||||||
|
|
||||||
- name: Set up artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
path: build_artifacts
|
|
||||||
|
|
||||||
- name: Build FFmpeg
|
|
||||||
if: ${{env.source == 'official'}}
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; git apply --ignore-whitespace --verbose ../0003-dynamic-loading-of-shared-fdk-aac-library-5.0.patch ; cd ../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --pkg-config-flags="--static" --build-suffix=-voukoderpro --disable-doc --disable-static --enable-shared --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.switches }} ; make ; make install ; cd ../build ; dir ; tar czf ../dist/ffmpeg-win64-shared-${{ env.msysConfig }}.tar.gz *'
|
|
||||||
|
|
||||||
- name: Build FFmpeg from Cartwheel
|
|
||||||
if: ${{env.source == 'cartwheel'}}
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; cd patches ; git apply --ignore-whitespace ../../hotfix.patch ; cd .. ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0001-dynamic-loading-of-shared-fdk-aac-library-cw-5.0.patch ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --pkg-config-flags="--static" --extra-libs=Ole32.lib --build-suffix=-voukoderpro --extra-libs=Advapi32.lib --disable-doc --disable-static --enable-shared --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.switches }} ; make ; make install ; cd ../../build ; dir ; tar czf ../dist/ffmpeg-win64-shared-${{ env.msysConfig }}.tar.gz *'
|
|
||||||
|
|
||||||
- name: Publish FFmpeg artifacts
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ env.winConfig }} package build
|
|
||||||
path: dist/ffmpeg-win64-shared-${{ env.msysConfig }}.tar.gz
|
|
609
.github/workflows/ffmpeg-static.yml
vendored
609
.github/workflows/ffmpeg-static.yml
vendored
@ -1,609 +0,0 @@
|
|||||||
name: FFmpeg Static (v143)
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
config:
|
|
||||||
type: choice
|
|
||||||
description: Configuration
|
|
||||||
options:
|
|
||||||
- Debug
|
|
||||||
- Release
|
|
||||||
|
|
||||||
schedule:
|
|
||||||
- cron: "0 5 * * *"
|
|
||||||
|
|
||||||
env:
|
|
||||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
|
||||||
switches: "--enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvpx "
|
|
||||||
NASM_EXECUTABLE: nasm
|
|
||||||
msysConfig: release
|
|
||||||
winConfig: Release
|
|
||||||
cFlags: -MD
|
|
||||||
useCartwheel: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
liboggvorbis:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout Ogg
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: xiph/ogg
|
|
||||||
ref: master
|
|
||||||
path: ogg
|
|
||||||
- name: Checkout Vorbis
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: xiph/vorbis
|
|
||||||
ref: master
|
|
||||||
path: vorbis
|
|
||||||
- name: Check cache
|
|
||||||
id: liboggvorbis-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: liboggvorbis-${{ env.msysConfig }}-${{ hashFiles('ogg') }}-${{ hashFiles('vorbis') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.liboggvorbis-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build Ogg
|
|
||||||
if: steps.liboggvorbis-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ogg ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared ; make -j ; make install'
|
|
||||||
- name: Build Vorbis
|
|
||||||
if: steps.liboggvorbis-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vorbis ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared ; make -j ; make install ; sed -i '/^Libs\.private.*/d' ../build/lib/pkgconfig/vorbis.pc ; cd ../build ; tar czf ../dist/liboggvorbis.tgz *'
|
|
||||||
echo "switches=${{env.switches}} --enable-encoder=libopus --enable-encoder=libvorbis" >> $GITHUB_ENV
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: liboggvorbis
|
|
||||||
path: dist/liboggvorbis.tgz
|
|
||||||
|
|
||||||
libvpl:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout oneVPL
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: oneapi-src/oneVPL
|
|
||||||
ref: master
|
|
||||||
path: onevpl
|
|
||||||
- name: Check cache
|
|
||||||
id: libvpl-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libvpl-${{ env.msysConfig }}-${{ hashFiles('onevpl') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libvpl-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build oneVPL
|
|
||||||
if: steps.libvpl-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md temp build dist
|
|
||||||
cd temp
|
|
||||||
cmake.exe -G "Visual Studio 17 2022" ..\onevpl -T host=x64 -A x64 -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=..\build -DCMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD=ON
|
|
||||||
MSBuild.exe -t:VPL,INSTALL -p:Configuration=${{ env.winConfig }} -m vpl.sln
|
|
||||||
cd ..\build
|
|
||||||
IF EXIST "lib\vpld.lib" move "lib\vpld.lib" "lib\vpl.lib"
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'rm -rf bin/cmake ; tar czf ../dist/libvpl.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libvpl
|
|
||||||
path: dist/libvpl.tgz
|
|
||||||
|
|
||||||
libsvtav1:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout SVT AV1
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: AOMediaCodec/SVT-AV1
|
|
||||||
ref: master
|
|
||||||
path: svtav1
|
|
||||||
- name: Check cache
|
|
||||||
id: libsvtav1-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libsvtav1-${{ env.msysConfig }}-${{ hashFiles('svtav1') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libsvtav1-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build SVT AV1
|
|
||||||
if: steps.libsvtav1-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd svtav1/Build/windows ; ./build.bat 2022 ${{ env.winConfig }} static ; cp -r ../../Source/API ../../../build/include/svt-av1 ; cp ../../Bin/${{ env.msysConfig }}/SvtAv1Enc.lib ../../../build/lib/ ; cp SvtAv1Enc.pc ../../../build/lib/pkgconfig/ ; cd ../../../build ; tar czf ../dist/libsvtav1.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libsvtav1
|
|
||||||
path: dist/libsvtav1.tgz
|
|
||||||
|
|
||||||
libsnappy:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout Snappy
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: google/snappy
|
|
||||||
ref: "1.1.8"
|
|
||||||
path: snappy
|
|
||||||
- name: Check cache
|
|
||||||
id: libsnappy-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libsnappy-${{ env.msysConfig }}-${{ hashFiles('snappy') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libsnappy-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build Snappy
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
cd snappy
|
|
||||||
md work
|
|
||||||
cd work
|
|
||||||
cmake -G "Visual Studio 17 2022" .. -DCMAKE_INSTALL_PREFIX=..\..\build -DBUILD_SHARED_LIBS=OFF -DSNAPPY_BUILD_TESTS=OFF
|
|
||||||
MSBuild.exe /property:Configuration="${{ env.winConfig }}" Snappy.sln
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cp ${{ env.winConfig }}/snappy.lib ../../build/lib/snappy.lib ; cp ../snappy.h ../snappy-c.h ../../build/include/ ; cd ../../build ; tar czf ../dist/libsnappy.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libsnappy
|
|
||||||
path: dist/libsnappy.tgz
|
|
||||||
|
|
||||||
libvpx:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
git clone https://github.com/webmproject/libvpx.git vpx
|
|
||||||
- name: Check cache
|
|
||||||
id: libvpx-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libvpx-${{ env.msysConfig }}-${{ hashFiles('vpx') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libvpx-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build LibVpx
|
|
||||||
if: steps.libvpx-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vpx ; ./configure --prefix=../build --target=x86_64-win64-vs17 --enable-vp9-highbitdepth --disable-shared --disable-examples --disable-tools --disable-docs --disable-libyuv --disable-unit_tests --disable-postproc ; make -j ; make install ; mv ../build/lib/x64/vpxmd.lib ../build/lib/vpx.lib ; rm -rf ../build/lib/x64 ; cd ../build ; tar czf ../dist/libvpx.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libvpx
|
|
||||||
path: dist/libvpx.tgz
|
|
||||||
|
|
||||||
libmp3lame:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up MSYS2
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm svn
|
|
||||||
path-type: inherit
|
|
||||||
- name: Set up cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
env:
|
|
||||||
cache-name: cache-ffmpeg-${{ env.msysConfig }}
|
|
||||||
with:
|
|
||||||
path: cache
|
|
||||||
key: cache-key
|
|
||||||
- name: Build LAME
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'svn co https://svn.code.sf.net/p/lame/svn/trunk/lame@6474 lame ; cd lame ; autoreconf -i ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --enable-nasm --disable-frontend --disable-shared --enable-static ; make -j ; make install ; cd ../build ; tar czf ../dist/libmp3lame.tgz *
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libmp3lame
|
|
||||||
path: dist/libmp3lame.tgz
|
|
||||||
|
|
||||||
libzimg:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout ZIMG
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: sekrit-twc/zimg
|
|
||||||
ref: release-2.9.2
|
|
||||||
path: zimg
|
|
||||||
- name: Check cache
|
|
||||||
id: libzimg-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libzimg-${{ env.msysConfig }}-${{ hashFiles('zimg') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libzimg-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build ZIMG
|
|
||||||
if: steps.libzimg-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd zimg ; ./autogen.sh ; ./configure --prefix=$(realpath ../build) ; cd _msvc/zimg ; MSBuild.exe /property:Configuration="${{ env.winConfig }}" /property:ConfigurationType=StaticLibrary /property:PlatformToolset=v143 /property:Platform=x64 /property:WholeProgramOptimization=false zimg.vcxproj ; cp x64/${{ env.winConfig }}/z.lib ../../../build/lib/zimg.lib ; cd ../.. ; cp src/zimg/api/zimg.h ../build/include/zimg.h ; cp zimg.pc ../build/lib/pkgconfig/zimg.pc ; cd ../build ; tar czf ../dist/libzimg.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libzimg
|
|
||||||
path: dist/libzimg.tgz
|
|
||||||
|
|
||||||
libopus:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout OPUS
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: xiph/opus
|
|
||||||
ref: master
|
|
||||||
path: opus
|
|
||||||
- name: Check cache
|
|
||||||
id: libopus-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libopus-${{ env.msysConfig }}-${{ hashFiles('opus') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libopus-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build OPUS
|
|
||||||
if: steps.libopus-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
cd opus\win32\VS2015
|
|
||||||
MSBuild.exe /property:Configuration="${{ env.winConfig }}" /property:Platform=x64 /property:PlatformToolset=v143 opus.vcxproj
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cp x64/${{ env.winConfig }}/opus.lib ../../../build/lib/opus.lib ; cd ../../.. ; cp -r opus/include build/include/opus ; cp opus/opus.pc.in build/lib/pkgconfig/opus.pc ; sed -i "s#@prefix@#$(realpath ../../../build)#g" build/lib/pkgconfig/opus.pc ; sed -i "s/@exec_prefix@/\$\{prefix\}/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@libdir@/\$\{prefix\}\/lib/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@includedir@/\$\{prefix\}\/include/g" build/lib/pkgconfig/opus.pc ; sed -i "s/@LIBM@//g" build/lib/pkgconfig/opus.pc; sed -i "s/@VERSION@/2.0.0/g" build/lib/pkgconfig/opus.pc ; cd build ; tar czf ../dist/libopus.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libopus
|
|
||||||
path: dist/libopus.tgz
|
|
||||||
|
|
||||||
libx264:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout X264
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: mirror/x264
|
|
||||||
ref: master
|
|
||||||
path: x264
|
|
||||||
- name: Check cache
|
|
||||||
id: libx264-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libx264-${{ env.msysConfig }}-${{ hashFiles('x264') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libx264-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build X264
|
|
||||||
if: steps.libx264-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd x264 ; CC=cl ./configure --prefix=$(realpath ../build) --disable-cli --enable-static --enable-pic --libdir=../build/lib ; make -j ; make install-lib-static ; cd ../build ; tar czf ../dist/libx264.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libx264
|
|
||||||
path: dist/libx264.tgz
|
|
||||||
|
|
||||||
libfdkaac:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
- name: Checkout FDK AAC
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: mstorsjo/fdk-aac
|
|
||||||
ref: master
|
|
||||||
path: fdkaac
|
|
||||||
- name: Check cache
|
|
||||||
id: libfdkaac-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libfdkaac-${{ env.msysConfig }}-${{ hashFiles('fdkaac') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libfdkaac-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Build FDK AAC
|
|
||||||
if: steps.libfdkaac-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd fdkaac ; autoreconf -fiv ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared --disable-static ; make ; make install ; cd ../build ; tar czf ../dist/libfdkaac.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libfdkaac
|
|
||||||
path: dist/libfdkaac.tgz
|
|
||||||
|
|
||||||
libx265-12:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Checkout X265
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
git clone -b Release_3.5 https://github.com/videolan/x265.git x265
|
|
||||||
- name: Check cache
|
|
||||||
id: libx26512-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libx265-12-${{ env.msysConfig }}-${{ hashFiles('x265') }}
|
|
||||||
- name: Set up MSBuild
|
|
||||||
if: steps.libx26512-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: microsoft/setup-msbuild@v1.1
|
|
||||||
- name: Set up NASM
|
|
||||||
if: steps.libx26512-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: ilammy/setup-nasm@v1.2.1
|
|
||||||
- name: Build X265 (12 bit)
|
|
||||||
if: steps.libx26512-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
cd x265/build/vc15-x86_64
|
|
||||||
md work
|
|
||||||
cd work
|
|
||||||
cmake -G "Visual Studio 17 2022" ..\..\..\source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
|
|
||||||
MSBuild.exe /property:Configuration="${{ env.winConfig }}" x265-static.vcxproj
|
|
||||||
move ${{ env.winConfig }}\x265-static.lib ..\..\..\..\dist\x265_12bit.lib
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: x265_12bit
|
|
||||||
path: dist/x265_12bit.lib
|
|
||||||
|
|
||||||
libx265-10:
|
|
||||||
runs-on: windows-2022
|
|
||||||
steps:
|
|
||||||
- name: Checkout X265
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
git clone -b Release_3.5 https://github.com/videolan/x265.git x265
|
|
||||||
- name: Check cache
|
|
||||||
id: libx26510-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: dist
|
|
||||||
key: libx265-10-${{ env.msysConfig }}-${{ hashFiles('x265') }}
|
|
||||||
- name: Set up MSBuild
|
|
||||||
if: steps.libx26510-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: microsoft/setup-msbuild@v1.1
|
|
||||||
- name: Set up NASM
|
|
||||||
if: steps.libx26510-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: ilammy/setup-nasm@v1.2.1
|
|
||||||
- name: Build X265 (10 bit)
|
|
||||||
if: steps.libx26510-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
cd x265/build/vc15-x86_64
|
|
||||||
md work
|
|
||||||
cd work
|
|
||||||
cmake -G "Visual Studio 17 2022" ..\..\..\source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
|
|
||||||
MSBuild.exe /property:Configuration="${{ env.winConfig }}" x265-static.vcxproj
|
|
||||||
move ${{ env.winConfig }}\x265-static.lib ..\..\..\..\dist\x265_10bit.lib
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: x265_10bit
|
|
||||||
path: dist/x265_10bit.lib
|
|
||||||
|
|
||||||
libx265:
|
|
||||||
runs-on: windows-2022
|
|
||||||
needs: [libx265-12,libx265-10]
|
|
||||||
steps:
|
|
||||||
- name: Checkout X265
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
git clone -b Release_3.5 https://github.com/videolan/x265.git x265
|
|
||||||
- name: Check cache
|
|
||||||
id: libx265-cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: di
|
|
||||||
key: libx265-${{ env.msysConfig }}-${{ hashFiles('x265') }}
|
|
||||||
- name: Set up MSYS2
|
|
||||||
if: steps.libx265-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils autotools automake
|
|
||||||
path-type: inherit
|
|
||||||
- name: Set up MSBuild
|
|
||||||
if: steps.libx265-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: microsoft/setup-msbuild@v1.1
|
|
||||||
- name: Set up NASM
|
|
||||||
if: steps.libx265-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: ilammy/setup-nasm@v1.2.1
|
|
||||||
- name: Set up dependant libs
|
|
||||||
if: steps.libx265-cache.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
path: build
|
|
||||||
- name: Build X265
|
|
||||||
if: steps.libx265-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md di dist dist\include dist\lib dist\lib\pkgconfig
|
|
||||||
cd x265/build/vc15-x86_64
|
|
||||||
md work
|
|
||||||
cd work
|
|
||||||
cmake -G "Visual Studio 17 2022" ..\..\..\source -DCMAKE_INSTALL_PREFIX=..\..\..\..\build -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DEXTRA_LIB="libx265_10bit.lib;libx265_12bit.lib" -DLINKED_10BIT=ON -DLINKED_12BIT=ON
|
|
||||||
MSBuild.exe /property:Configuration="${{ env.winConfig }}" x265-static.vcxproj
|
|
||||||
cp x265.pc ..\..\..\..\dist\lib\pkgconfig\x265.pc
|
|
||||||
move ${{ env.winConfig }}\x265-static.lib ..\..\..\..\build\
|
|
||||||
move x265_config.h ..\..\..\..\dist\include\
|
|
||||||
cd ..\..\..\..
|
|
||||||
"${{ env.vsPath }}VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\lib.exe" /ignore:4006 /ignore:4221 /OUT:dist\lib\x265.lib build\x265-static.lib build\x265_10bit\x265_10bit.lib build\x265_12bit\x265_12bit.lib
|
|
||||||
copy x265\source\x265.h dist\include\
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd dist ; tar czf ../di/libx265.tgz *'
|
|
||||||
- name: Publish artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: libx265
|
|
||||||
path: di/libx265.tgz
|
|
||||||
|
|
||||||
ffmpeg:
|
|
||||||
runs-on: windows-2022
|
|
||||||
needs: [libopus,libvpl,libsvtav1,libsnappy,libmp3lame,libzimg,liboggvorbis,libx264,libx265,libfdkaac,libvpx]
|
|
||||||
steps:
|
|
||||||
- name: Set up MSYS2
|
|
||||||
uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
|
||||||
path-type: inherit
|
|
||||||
- name: Set up GIT
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf false
|
|
||||||
git config --global core.eol lf
|
|
||||||
git config --global user.email "daniel.stankewitz@gmail.com"
|
|
||||||
git config --global user.name "Daniel Stankewitz"
|
|
||||||
- name: Checkout patches
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
- name: Checkout FFmpeg
|
|
||||||
if: ${{!env.useCartwheel}}
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: FFmpeg/FFmpeg.git
|
|
||||||
ref: release/5.0
|
|
||||||
path: ffmpeg
|
|
||||||
- name: Checkout NvEnc
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: FFmpeg/nv-codec-headers
|
|
||||||
ref: sdk/9.1
|
|
||||||
path: nvenc
|
|
||||||
- name: Checkout AMF
|
|
||||||
uses: actions/checkout@v3.0.0
|
|
||||||
with:
|
|
||||||
repository: GPUOpen-LibrariesAndSDKs/AMF
|
|
||||||
ref: master
|
|
||||||
path: amf
|
|
||||||
- name: Set up artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
path: build_artifacts
|
|
||||||
- name: Build FFmpeg
|
|
||||||
if: ${{!env.useCartwheel}}
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; git apply --ignore-whitespace --verbose ../0003-dynamic-loading-of-shared-fdk-aac-library-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --pkg-config-flags="--static" --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --disable-devices --disable-demuxers --disable-decoders --disable-network --enable-w32threads --enable-gpl ${{ env.switches }} ; make ; make install ; cd ../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-static-${{ env.msysConfig }}.tar.gz *'
|
|
||||||
- name: Build FFmpeg from Cartwheel
|
|
||||||
if: ${{env.useCartwheel}}
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
md build dist
|
|
||||||
rem D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git checkout b3f9843cffd4118e35bb000779444ca2f4196342 ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0003-dynamic-loading-of-shared-fdk-aac-library-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --pkg-config-flags="--static" --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --disable-devices --disable-demuxers --disable-decoders --disable-network --enable-w32threads --enable-gpl ${{ env.switches }} ; make ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-static-${{ env.msysConfig }}.tar.gz *'
|
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; cd patches ; git apply --ignore-whitespace ../../hotfix.patch ; cd .. ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0001-dynamic-loading-of-shared-fdk-aac-library-cw-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --pkg-config-flags="--static" --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --disable-devices --disable-demuxers --disable-decoders --disable-network --enable-w32threads --enable-gpl ${{ env.switches }} ; make ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-static-${{ env.msysConfig }}.tar.gz *'
|
|
||||||
- name: Publish FFmpeg artifacts
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ env.winConfig }} package build
|
|
||||||
path: dist/ffmpeg-win64-static-${{ env.msysConfig }}.tar.gz
|
|
230
.github/workflows/ffmpeg.yml
vendored
Normal file
230
.github/workflows/ffmpeg.yml
vendored
Normal file
@ -0,0 +1,230 @@
|
|||||||
|
name: 'Build FFmpeg (GPL)'
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'windows-2022'
|
||||||
|
description: 'System'
|
||||||
|
options:
|
||||||
|
- windows-2022
|
||||||
|
|
||||||
|
type:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'static'
|
||||||
|
description: Type
|
||||||
|
options:
|
||||||
|
- static
|
||||||
|
- shared
|
||||||
|
|
||||||
|
config:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'release'
|
||||||
|
description: 'Configuration'
|
||||||
|
options:
|
||||||
|
- debug
|
||||||
|
- release
|
||||||
|
|
||||||
|
ffmpegRef:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
default: 'release/6.0'
|
||||||
|
description: 'FFmpeg refId'
|
||||||
|
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
ffmpegRef:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
COMPONENTS: "--enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libvpx --enable-libvorbis --enable-libopus --enable-libx264 --enable-libx265 "
|
||||||
|
NASM_EXECUTABLE: nasm
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
libvpl:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libvpl
|
||||||
|
with:
|
||||||
|
refId: master
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
liboggvorbis:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/liboggvorbis
|
||||||
|
with:
|
||||||
|
libogg_refId: v1.3.5
|
||||||
|
libvorbis_refId: v1.3.7
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libsvtav1:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libsvtav1
|
||||||
|
with:
|
||||||
|
refId: v1.4.1
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libsnappy:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libsnappy
|
||||||
|
with:
|
||||||
|
refId: 1.1.9
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libvpx:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libvpx
|
||||||
|
with:
|
||||||
|
refId: v1.12.0
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libmp3lame:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libmp3lame
|
||||||
|
with:
|
||||||
|
refId: tags/RELEASE__3_100
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libzimg:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libzimg
|
||||||
|
with:
|
||||||
|
refId: release-3.0.4
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libopus:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libopus
|
||||||
|
with:
|
||||||
|
refId: v1.3.1
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libfdkaac:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libfdkaac
|
||||||
|
with:
|
||||||
|
refId: v2.0.2
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx264:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx264
|
||||||
|
with:
|
||||||
|
refId: stable
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx265-12:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx265-12
|
||||||
|
with:
|
||||||
|
refId: Release_3.5
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx265-10:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx265-10
|
||||||
|
with:
|
||||||
|
refId: Release_3.5
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
libx265:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
needs: [libx265-12,libx265-10]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/libx265
|
||||||
|
with:
|
||||||
|
refId: Release_3.5
|
||||||
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
ffmpeg:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
needs: [libvpl,libsvtav1,libsnappy,libvpx,libmp3lame,libzimg,liboggvorbis,libopus,libfdkaac,libx264,libx265]
|
||||||
|
steps:
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Set up GIT
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git config --global user.email "daniel.stankewitz@gmail.com"
|
||||||
|
git config --global user.name "Daniel Stankewitz"
|
||||||
|
- name: Checkout patches
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
- name: Checkout FFmpeg
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: FFmpeg/FFmpeg.git
|
||||||
|
ref: ${{ inputs.ffmpegRef }}
|
||||||
|
path: ffmpeg
|
||||||
|
- name: Checkout NvEnc
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: FFmpeg/nv-codec-headers
|
||||||
|
ref: master
|
||||||
|
path: nvenc
|
||||||
|
- name: Checkout AMF
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: GPUOpen-LibrariesAndSDKs/AMF
|
||||||
|
ref: master
|
||||||
|
path: amf
|
||||||
|
- name: Set up artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build_artifacts
|
||||||
|
- name: Build FFmpeg
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; git apply --ignore-whitespace ../libfdkaac.patch ; cd ../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||||
|
- name: Publish FFmpeg artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: FFmpeg ${{ inputs.system }} ${{ inputs.config }}${{ inputs.config }} package build
|
||||||
|
path: dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz
|
111
.github/workflows/test.yml
vendored
Normal file
111
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
name: 'Test'
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'windows-2022'
|
||||||
|
description: 'System'
|
||||||
|
options:
|
||||||
|
- windows-2022
|
||||||
|
|
||||||
|
type:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'static'
|
||||||
|
description: Type
|
||||||
|
options:
|
||||||
|
- static
|
||||||
|
- shared
|
||||||
|
|
||||||
|
config:
|
||||||
|
type: choice
|
||||||
|
required: true
|
||||||
|
default: 'release'
|
||||||
|
description: 'Configuration'
|
||||||
|
options:
|
||||||
|
- debug
|
||||||
|
- release
|
||||||
|
|
||||||
|
ffmpegRef:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
default: 'release/5.1'
|
||||||
|
description: 'FFmpeg refId'
|
||||||
|
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
system:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
ffmpegRef:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
COMPONENTS: " "
|
||||||
|
NASM_EXECUTABLE: nasm
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ffmpeg:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
needs: []
|
||||||
|
steps:
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Set up GIT
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
git config --global user.email "daniel.stankewitz@gmail.com"
|
||||||
|
git config --global user.name "Daniel Stankewitz"
|
||||||
|
- name: Checkout patches
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
- name: Checkout FFmpeg
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: FFmpeg/FFmpeg.git
|
||||||
|
ref: ${{ inputs.ffmpegRef }}
|
||||||
|
path: ffmpeg
|
||||||
|
- name: Checkout NvEnc
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: FFmpeg/nv-codec-headers
|
||||||
|
ref: master
|
||||||
|
path: nvenc
|
||||||
|
- name: Checkout AMF
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: GPUOpen-LibrariesAndSDKs/AMF
|
||||||
|
ref: master
|
||||||
|
path: amf
|
||||||
|
- name: Set up artifacts
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
path: build_artifacts
|
||||||
|
- name: Build FFmpeg
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; git apply --ignore-whitespace ../amd-av1-amf.patch ; git apply --ignore-whitespace ../nvidia-av1-nvenc.patch ; git apply --ignore-whitespace --verbose ../libfdkaac-dynlib-5.1.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||||
|
- name: Publish FFmpeg artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: FFmpeg ${{ inputs.system }} ${{ inputs.config }}${{ inputs.config }} package build
|
||||||
|
path: dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz
|
462
amd-av1-amf.patch
Normal file
462
amd-av1-amf.patch
Normal file
@ -0,0 +1,462 @@
|
|||||||
|
diff --git a/configure b/configure
|
||||||
|
index ba5793b2ff..a7f5642a74 100755
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -3250,6 +3250,7 @@ vp9_qsv_encoder_select="qsvenc"
|
||||||
|
vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
|
||||||
|
wmv3_crystalhd_decoder_select="crystalhd"
|
||||||
|
av1_qsv_decoder_select="qsvdec"
|
||||||
|
+av1_amf_encoder_deps="amf"
|
||||||
|
|
||||||
|
# parsers
|
||||||
|
aac_parser_select="adts_header mpeg4audio"
|
||||||
|
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
|
||||||
|
index 457ec58377..4228851b9c 100644
|
||||||
|
--- a/libavcodec/Makefile
|
||||||
|
+++ b/libavcodec/Makefile
|
||||||
|
@@ -959,6 +959,7 @@ OBJS-$(CONFIG_AV1_DXVA2_HWACCEL) += dxva2_av1.o
|
||||||
|
OBJS-$(CONFIG_AV1_NVDEC_HWACCEL) += nvdec_av1.o
|
||||||
|
OBJS-$(CONFIG_AV1_VAAPI_HWACCEL) += vaapi_av1.o
|
||||||
|
OBJS-$(CONFIG_AV1_VDPAU_HWACCEL) += vdpau_av1.o
|
||||||
|
+OBJS-$(CONFIG_AV1_AMF_ENCODER) += amfenc_av1.o
|
||||||
|
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||||
|
OBJS-$(CONFIG_H263_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
|
||||||
|
OBJS-$(CONFIG_H264_D3D11VA_HWACCEL) += dxva2_h264.o
|
||||||
|
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
|
||||||
|
index bdfc2f6f45..f2b44a8d18 100644
|
||||||
|
--- a/libavcodec/allcodecs.c
|
||||||
|
+++ b/libavcodec/allcodecs.c
|
||||||
|
@@ -816,6 +816,7 @@ extern const FFCodec ff_libaom_av1_decoder;
|
||||||
|
extern const FFCodec ff_av1_decoder;
|
||||||
|
extern const FFCodec ff_av1_cuvid_decoder;
|
||||||
|
extern const FFCodec ff_av1_qsv_decoder;
|
||||||
|
+extern const FFCodec ff_av1_amf_encoder;
|
||||||
|
extern const FFCodec ff_libopenh264_encoder;
|
||||||
|
extern const FFCodec ff_libopenh264_decoder;
|
||||||
|
extern const FFCodec ff_h264_amf_encoder;
|
||||||
|
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
|
||||||
|
index a033e1220e..ab75556b6a 100644
|
||||||
|
--- a/libavcodec/amfenc.c
|
||||||
|
+++ b/libavcodec/amfenc.c
|
||||||
|
@@ -349,6 +349,9 @@ static int amf_init_encoder(AVCodecContext *avctx)
|
||||||
|
case AV_CODEC_ID_HEVC:
|
||||||
|
codec_id = AMFVideoEncoder_HEVC;
|
||||||
|
break;
|
||||||
|
+ case AV_CODEC_ID_AV1:
|
||||||
|
+ codec_id = AMFVideoEncoder_AV1;
|
||||||
|
+ break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
@@ -460,6 +463,12 @@ static int amf_copy_buffer(AVCodecContext *avctx, AVPacket *pkt, AMFBuffer *buff
|
||||||
|
pkt->flags = AV_PKT_FLAG_KEY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
+ case AV_CODEC_ID_AV1:
|
||||||
|
+ buffer->pVtbl->GetProperty(buffer, AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE, &var);
|
||||||
|
+ if (var.int64Value == AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_KEY) {
|
||||||
|
+ pkt->flags = AV_PKT_FLAG_KEY;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
@@ -681,6 +690,7 @@ int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
|
||||||
|
case AV_CODEC_ID_HEVC:
|
||||||
|
AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_INSERT_AUD, !!ctx->aud);
|
||||||
|
break;
|
||||||
|
+ //case AV_CODEC_ID_AV1 not supported
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h
|
||||||
|
index 1ab98d2f78..96abb58226 100644
|
||||||
|
--- a/libavcodec/amfenc.h
|
||||||
|
+++ b/libavcodec/amfenc.h
|
||||||
|
@@ -23,6 +23,7 @@
|
||||||
|
|
||||||
|
#include <AMF/components/VideoEncoderVCE.h>
|
||||||
|
#include <AMF/components/VideoEncoderHEVC.h>
|
||||||
|
+#include <AMF/components/VideoEncoderAV1.h>
|
||||||
|
|
||||||
|
#include "libavutil/fifo.h"
|
||||||
|
|
||||||
|
@@ -116,6 +117,10 @@ typedef struct AmfContext {
|
||||||
|
int min_qp_p;
|
||||||
|
int max_qp_p;
|
||||||
|
int tier;
|
||||||
|
+
|
||||||
|
+ // AV1 - specific options
|
||||||
|
+
|
||||||
|
+ enum AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_ENUM align;
|
||||||
|
} AmfContext;
|
||||||
|
|
||||||
|
extern const AVCodecHWConfigInternal *const ff_amfenc_hw_configs[];
|
||||||
|
diff --git a/libavcodec/amfenc_av1.c b/libavcodec/amfenc_av1.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..c0443f90ea
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/libavcodec/amfenc_av1.c
|
||||||
|
@@ -0,0 +1,361 @@
|
||||||
|
+/*
|
||||||
|
+ * This file is part of FFmpeg.
|
||||||
|
+ *
|
||||||
|
+ * FFmpeg is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation; either
|
||||||
|
+ * version 2.1 of the License, or (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * FFmpeg is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public
|
||||||
|
+ * License along with FFmpeg; if not, write to the Free Software
|
||||||
|
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "libavutil/internal.h"
|
||||||
|
+#include "libavutil/opt.h"
|
||||||
|
+#include "amfenc.h"
|
||||||
|
+#include "codec_internal.h"
|
||||||
|
+#include "internal.h"
|
||||||
|
+
|
||||||
|
+#define OFFSET(x) offsetof(AmfContext, x)
|
||||||
|
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
||||||
|
+static const AVOption options[] = {
|
||||||
|
+ { "usage", "Set the encoding usage", OFFSET(usage), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING }, AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING, AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY, VE, "usage" },
|
||||||
|
+ { "transcoding", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING }, 0, 0, VE, "usage" },
|
||||||
|
+ { "lowlatency", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY }, 0, 0, VE, "usage" },
|
||||||
|
+
|
||||||
|
+ { "profile", "Set the profile (default main)", OFFSET(profile), AV_OPT_TYPE_INT,{.i64 = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN }, AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN, AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN, VE, "profile" },
|
||||||
|
+ { "main", "", 0, AV_OPT_TYPE_CONST,{.i64 = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN }, 0, 0, VE, "profile" },
|
||||||
|
+
|
||||||
|
+ { "level", "Set the encoding level (default auto)", OFFSET(level), AV_OPT_TYPE_INT,{.i64 = 0 }, 0, AMF_VIDEO_ENCODER_AV1_LEVEL_7_3, VE, "level" },
|
||||||
|
+ { "auto", "", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, VE, "level" },
|
||||||
|
+ { "2.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_0 }, 0, 0, VE, "level" },
|
||||||
|
+ { "2.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_1 }, 0, 0, VE, "level" },
|
||||||
|
+ { "2.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "2.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_2_3 }, 0, 0, VE, "level" },
|
||||||
|
+ { "3.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_0 }, 0, 0, VE, "level" },
|
||||||
|
+ { "3.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_1 }, 0, 0, VE, "level" },
|
||||||
|
+ { "3.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "3.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_3_3 }, 0, 0, VE, "level" },
|
||||||
|
+ { "4.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_0 }, 0, 0, VE, "level" },
|
||||||
|
+ { "4.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_1 }, 0, 0, VE, "level" },
|
||||||
|
+ { "4.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "4.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_4_3 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_0 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_1 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_5_3 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_0 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_1 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_6_3 }, 0, 0, VE, "level" },
|
||||||
|
+ { "7.0", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_0 }, 0, 0, VE, "level" },
|
||||||
|
+ { "7.1", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_1 }, 0, 0, VE, "level" },
|
||||||
|
+ { "7.2", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "7.3", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_LEVEL_7_3 }, 0, 0, VE, "level" },
|
||||||
|
+
|
||||||
|
+ { "quality", "Set the encoding quality", OFFSET(quality), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED }, AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_HIGH_QUALITY, AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED, VE, "quality" },
|
||||||
|
+ { "balanced", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_BALANCED }, 0, 0, VE, "quality" },
|
||||||
|
+ { "speed", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED }, 0, 0, VE, "quality" },
|
||||||
|
+ { "quality", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_QUALITY }, 0, 0, VE, "quality" },
|
||||||
|
+ { "high_quality", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_HIGH_QUALITY }, 0, 0, VE, "quality" },
|
||||||
|
+
|
||||||
|
+ { "rc", "Set the rate control mode", OFFSET(rate_control_mode), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN }, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR, VE, "rc" },
|
||||||
|
+ { "cqp", "Constant Quantization Parameter", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CONSTANT_QP }, 0, 0, VE, "rc" },
|
||||||
|
+ { "vbr_latency", "Latency Constrained Variable Bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR }, 0, 0, VE, "rc" },
|
||||||
|
+ { "vbr_peak", "Peak Contrained Variable Bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR }, 0, 0, VE, "rc" },
|
||||||
|
+ { "cbr", "Constant Bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR }, 0, 0, VE, "rc" },
|
||||||
|
+
|
||||||
|
+ { "header_insertion_mode", "Set header insertion mode", OFFSET(header_insertion_mode), AV_OPT_TYPE_INT,{.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE }, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED, VE, "hdrmode" },
|
||||||
|
+ { "none", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE }, 0, 0, VE, "hdrmode" },
|
||||||
|
+ { "gop", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_GOP_ALIGNED }, 0, 0, VE, "hdrmode" },
|
||||||
|
+ { "frame", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED }, 0, 0, VE, "hdrmode" },
|
||||||
|
+
|
||||||
|
+ { "preanalysis", "Enable preanalysis", OFFSET(preanalysis), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE},
|
||||||
|
+ { "enforce_hrd", "Enforce HRD", OFFSET(enforce_hrd), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE},
|
||||||
|
+ { "filler_data", "Filler Data Enable", OFFSET(filler_data), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE},
|
||||||
|
+
|
||||||
|
+ // min_qp_i -> min_qp_intra, min_qp_p -> min_qp_inter
|
||||||
|
+ { "min_qp_i", "min quantization parameter for I-frame", OFFSET(min_qp_i), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "max_qp_i", "max quantization parameter for I-frame", OFFSET(max_qp_i), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "min_qp_p", "min quantization parameter for P-frame", OFFSET(min_qp_p), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "max_qp_p", "max quantization parameter for P-frame", OFFSET(max_qp_p), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "qp_p", "quantization parameter for P-frame", OFFSET(qp_p), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "qp_i", "quantization parameter for I-frame", OFFSET(qp_i), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "skip_frame", "Rate Control Based Frame Skip", OFFSET(skip_frame), AV_OPT_TYPE_BOOL,{.i64 = 0 }, 0, 1, VE },
|
||||||
|
+
|
||||||
|
+ { "align", "alignment mode", OFFSET(align), AV_OPT_TYPE_INT, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS }, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS, VE, "align" },
|
||||||
|
+ { "64x16", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY }, 0, 0, VE, "align" },
|
||||||
|
+ { "1080p", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_1080P_CODED_1082 }, 0, 0, VE, "align" },
|
||||||
|
+ { "none", "", 0, AV_OPT_TYPE_CONST, {.i64 = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS }, 0, 0, VE, "align" },
|
||||||
|
+
|
||||||
|
+ { NULL }
|
||||||
|
+
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static av_cold int amf_encode_init_av1(AVCodecContext* avctx)
|
||||||
|
+{
|
||||||
|
+ int ret = 0;
|
||||||
|
+ AMF_RESULT res = AMF_OK;
|
||||||
|
+ AmfContext* ctx = avctx->priv_data;
|
||||||
|
+ AMFVariantStruct var = { 0 };
|
||||||
|
+ amf_int64 profile = 0;
|
||||||
|
+ amf_int64 profile_level = 0;
|
||||||
|
+ AMFBuffer* buffer;
|
||||||
|
+ AMFGuid guid;
|
||||||
|
+ AMFRate framerate;
|
||||||
|
+ AMFSize framesize = AMFConstructSize(avctx->width, avctx->height);
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
|
||||||
|
+ framerate = AMFConstructRate(avctx->framerate.num, avctx->framerate.den);
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ framerate = AMFConstructRate(avctx->time_base.den, avctx->time_base.num * avctx->ticks_per_frame);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if ((ret = ff_amf_encode_init(avctx)) < 0)
|
||||||
|
+ return ret;
|
||||||
|
+
|
||||||
|
+ // init static parameters
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_USAGE, ctx->usage);
|
||||||
|
+
|
||||||
|
+ AMF_ASSIGN_PROPERTY_SIZE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMESIZE, framesize);
|
||||||
|
+
|
||||||
|
+ AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate);
|
||||||
|
+
|
||||||
|
+ switch (avctx->profile) {
|
||||||
|
+ case FF_PROFILE_AV1_MAIN:
|
||||||
|
+ profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN;
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ if (profile == 0) {
|
||||||
|
+ profile = ctx->profile;
|
||||||
|
+ }
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile);
|
||||||
|
+
|
||||||
|
+ profile_level = avctx->level;
|
||||||
|
+ if (profile_level == FF_LEVEL_UNKNOWN) {
|
||||||
|
+ profile_level = ctx->level;
|
||||||
|
+ }
|
||||||
|
+ if (profile_level != 0) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_LEVEL, profile_level);
|
||||||
|
+ }
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET, ctx->quality);
|
||||||
|
+
|
||||||
|
+ // Maximum Reference Frames
|
||||||
|
+ if (avctx->refs != -1) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_NUM_REFRAMES, avctx->refs);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Picture control properties
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_GOP_SIZE, avctx->gop_size);
|
||||||
|
+
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE, ctx->header_insertion_mode);
|
||||||
|
+
|
||||||
|
+ // Rate control
|
||||||
|
+ // autodetect rate control method
|
||||||
|
+ if (ctx->rate_control_mode == AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN) {
|
||||||
|
+ if (ctx->min_qp_i != -1 || ctx->max_qp_i != -1 ||
|
||||||
|
+ ctx->min_qp_p != -1 || ctx->max_qp_p != -1 ||
|
||||||
|
+ ctx->qp_i != -1 || ctx->qp_p != -1) {
|
||||||
|
+ ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CONSTANT_QP;
|
||||||
|
+ av_log(ctx, AV_LOG_DEBUG, "Rate control turned to CQP\n");
|
||||||
|
+ }
|
||||||
|
+ else if (avctx->rc_max_rate > 0) {
|
||||||
|
+ ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR;
|
||||||
|
+ av_log(ctx, AV_LOG_DEBUG, "Rate control turned to Peak VBR\n");
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR;
|
||||||
|
+ av_log(ctx, AV_LOG_DEBUG, "Rate control turned to CBR\n");
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD, ctx->rate_control_mode);
|
||||||
|
+ if (avctx->rc_buffer_size) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_VBV_BUFFER_SIZE, avctx->rc_buffer_size);
|
||||||
|
+
|
||||||
|
+ if (avctx->rc_initial_buffer_occupancy != 0) {
|
||||||
|
+ int amf_buffer_fullness = avctx->rc_initial_buffer_occupancy * 64 / avctx->rc_buffer_size;
|
||||||
|
+ if (amf_buffer_fullness > 64)
|
||||||
|
+ amf_buffer_fullness = 64;
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_INITIAL_VBV_BUFFER_FULLNESS, amf_buffer_fullness);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Pre-Pass, Pre-Analysis, Two-Pass
|
||||||
|
+ AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PRE_ANALYSIS_ENABLE, ctx->preanalysis);
|
||||||
|
+
|
||||||
|
+ // init dynamic rate control params
|
||||||
|
+ if (ctx->max_au_size)
|
||||||
|
+ ctx->enforce_hrd = 1;
|
||||||
|
+ AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_ENFORCE_HRD, ctx->enforce_hrd);
|
||||||
|
+ AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FILLER_DATA, ctx->filler_data);
|
||||||
|
+
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_TARGET_BITRATE, avctx->bit_rate);
|
||||||
|
+
|
||||||
|
+ if (ctx->rate_control_mode == AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PEAK_BITRATE, avctx->bit_rate);
|
||||||
|
+ }
|
||||||
|
+ if (avctx->rc_max_rate) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PEAK_BITRATE, avctx->rc_max_rate);
|
||||||
|
+ }
|
||||||
|
+ else if (ctx->rate_control_mode == AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR) {
|
||||||
|
+ av_log(ctx, AV_LOG_WARNING, "rate control mode is PEAK_CONSTRAINED_VBR but rc_max_rate is not set\n");
|
||||||
|
+ }
|
||||||
|
+ if (avctx->bit_rate > 0) {
|
||||||
|
+ ctx->rate_control_mode = AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR;
|
||||||
|
+ av_log(ctx, AV_LOG_DEBUG, "Rate control turned to CBR\n");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ switch (ctx->align)
|
||||||
|
+ {
|
||||||
|
+ case AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY:
|
||||||
|
+ if (avctx->width / 64 * 64 != avctx->width || avctx->height / 16 * 16 != avctx->height)
|
||||||
|
+ {
|
||||||
|
+ res = AMF_NOT_SUPPORTED;
|
||||||
|
+ av_log(ctx, AV_LOG_ERROR, "Resolution incorrect for alignment mode\n");
|
||||||
|
+ return AVERROR_EXIT;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+ case AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_1080P_CODED_1082:
|
||||||
|
+ if ((avctx->width / 64 * 64 == avctx->width && avctx->height / 16 * 16 == avctx->height) || (avctx->width == 1920 && avctx->height == 1080))
|
||||||
|
+ {
|
||||||
|
+ res = AMF_OK;
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ res = AMF_NOT_SUPPORTED;
|
||||||
|
+ av_log(ctx, AV_LOG_ERROR, "Resolution incorrect for alignment mode\n");
|
||||||
|
+ return AVERROR_EXIT;
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+ case AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS:
|
||||||
|
+ res = AMF_OK;
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ res = AMF_NOT_SUPPORTED;
|
||||||
|
+ av_log(ctx, AV_LOG_ERROR, "Invalid alignment mode\n");
|
||||||
|
+ return AVERROR_EXIT;
|
||||||
|
+ }
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE, ctx->align);
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ // init encoder
|
||||||
|
+ res = ctx->encoder->pVtbl->Init(ctx->encoder, ctx->format, avctx->width, avctx->height);
|
||||||
|
+ AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "encoder->Init() failed with error %d\n", res);
|
||||||
|
+
|
||||||
|
+ // init dynamic picture control params
|
||||||
|
+ if (ctx->min_qp_i != -1) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTRA, ctx->min_qp_i);
|
||||||
|
+ }
|
||||||
|
+ else if (avctx->qmin != -1) {
|
||||||
|
+ int qval = avctx->qmin > 255 ? 255 : avctx->qmin;
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTRA, qval);
|
||||||
|
+ }
|
||||||
|
+ if (ctx->max_qp_i != -1) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTRA, ctx->max_qp_i);
|
||||||
|
+ }
|
||||||
|
+ else if (avctx->qmax != -1) {
|
||||||
|
+ int qval = avctx->qmax > 255 ? 255 : avctx->qmax;
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTRA, qval);
|
||||||
|
+ }
|
||||||
|
+ if (ctx->min_qp_p != -1) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTER, ctx->min_qp_p);
|
||||||
|
+ }
|
||||||
|
+ else if (avctx->qmin != -1) {
|
||||||
|
+ int qval = avctx->qmin > 255 ? 255 : avctx->qmin;
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTER, qval);
|
||||||
|
+ }
|
||||||
|
+ if (ctx->max_qp_p != -1) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTER, ctx->max_qp_p);
|
||||||
|
+ }
|
||||||
|
+ else if (avctx->qmax != -1) {
|
||||||
|
+ int qval = avctx->qmax > 255 ? 255 : avctx->qmax;
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTER, qval);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (ctx->qp_p != -1) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTER, ctx->qp_p);
|
||||||
|
+ }
|
||||||
|
+ if (ctx->qp_i != -1) {
|
||||||
|
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTRA, ctx->qp_i);
|
||||||
|
+ }
|
||||||
|
+ AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_SKIP_FRAME, ctx->skip_frame);
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+ // fill extradata
|
||||||
|
+ res = AMFVariantInit(&var);
|
||||||
|
+ AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "AMFVariantInit() failed with error %d\n", res);
|
||||||
|
+
|
||||||
|
+ res = ctx->encoder->pVtbl->GetProperty(ctx->encoder, AMF_VIDEO_ENCODER_AV1_EXTRA_DATA, &var);
|
||||||
|
+ AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "GetProperty(AMF_VIDEO_ENCODER_EXTRADATA) failed with error %d\n", res);
|
||||||
|
+ AMF_RETURN_IF_FALSE(ctx, var.pInterface != NULL, AVERROR_BUG, "GetProperty(AMF_VIDEO_ENCODER_EXTRADATA) returned NULL\n");
|
||||||
|
+
|
||||||
|
+ guid = IID_AMFBuffer();
|
||||||
|
+
|
||||||
|
+ res = var.pInterface->pVtbl->QueryInterface(var.pInterface, &guid, (void**)&buffer); // query for buffer interface
|
||||||
|
+ if (res != AMF_OK) {
|
||||||
|
+ var.pInterface->pVtbl->Release(var.pInterface);
|
||||||
|
+ }
|
||||||
|
+ AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_BUG, "QueryInterface(IID_AMFBuffer) failed with error %d\n", res);
|
||||||
|
+
|
||||||
|
+ avctx->extradata_size = (int)buffer->pVtbl->GetSize(buffer);
|
||||||
|
+ avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
+ if (!avctx->extradata) {
|
||||||
|
+ buffer->pVtbl->Release(buffer);
|
||||||
|
+ var.pInterface->pVtbl->Release(var.pInterface);
|
||||||
|
+ return AVERROR(ENOMEM);
|
||||||
|
+ }
|
||||||
|
+ memcpy(avctx->extradata, buffer->pVtbl->GetNative(buffer), avctx->extradata_size);
|
||||||
|
+
|
||||||
|
+ buffer->pVtbl->Release(buffer);
|
||||||
|
+ var.pInterface->pVtbl->Release(var.pInterface);
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static const FFCodecDefault defaults[] = {
|
||||||
|
+ { "refs", "-1" },
|
||||||
|
+ { "aspect", "0" },
|
||||||
|
+ { "b", "2M" },
|
||||||
|
+ { "g", "250" },
|
||||||
|
+ { "qmin", "-1" },
|
||||||
|
+ { "qmax", "-1" },
|
||||||
|
+ { NULL },
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const AVClass av1_amf_class = {
|
||||||
|
+ .class_name = "av1_amf",
|
||||||
|
+ .item_name = av_default_item_name,
|
||||||
|
+ .option = options,
|
||||||
|
+ .version = LIBAVUTIL_VERSION_INT,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+const FFCodec ff_av1_amf_encoder = {
|
||||||
|
+ .p.name = "av1_amf",
|
||||||
|
+ .p.long_name = NULL_IF_CONFIG_SMALL("AMD AMF AV1 encoder"),
|
||||||
|
+ .p.type = AVMEDIA_TYPE_VIDEO,
|
||||||
|
+ .p.id = AV_CODEC_ID_AV1,
|
||||||
|
+ .init = amf_encode_init_av1,
|
||||||
|
+ FF_CODEC_RECEIVE_PACKET_CB(ff_amf_receive_packet),
|
||||||
|
+ .close = ff_amf_encode_close,
|
||||||
|
+ .priv_data_size = sizeof(AmfContext),
|
||||||
|
+ .p.priv_class = &av1_amf_class,
|
||||||
|
+ .defaults = defaults,
|
||||||
|
+ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
|
||||||
|
+ AV_CODEC_CAP_DR1,
|
||||||
|
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
|
+ .p.pix_fmts = ff_amf_pix_fmts,
|
||||||
|
+ .p.wrapper_name = "amf",
|
||||||
|
+ .hw_configs = ff_amfenc_hw_configs,
|
||||||
|
+};
|
||||||
|
\ No newline at end of file
|
306
amd-av1-headers.patch
Normal file
306
amd-av1-headers.patch
Normal file
@ -0,0 +1,306 @@
|
|||||||
|
diff --git a/amf/public/include/components/VideoEncoderAV1.h b/amf/public/include/components/VideoEncoderAV1.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..b672665
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/amf/public/include/components/VideoEncoderAV1.h
|
||||||
|
@@ -0,0 +1,300 @@
|
||||||
|
+//
|
||||||
|
+// Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All rights reserved.
|
||||||
|
+//
|
||||||
|
+// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
+// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
+// in the Software without restriction, including without limitation the rights
|
||||||
|
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
+// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
+// furnished to do so, subject to the following conditions:
|
||||||
|
+//
|
||||||
|
+// The above copyright notice and this permission notice shall be included in
|
||||||
|
+// all copies or substantial portions of the Software.
|
||||||
|
+//
|
||||||
|
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
+// THE SOFTWARE.
|
||||||
|
+//
|
||||||
|
+
|
||||||
|
+//-------------------------------------------------------------------------------------------------
|
||||||
|
+// VideoEncoderHW_AV1 interface declaration
|
||||||
|
+//-------------------------------------------------------------------------------------------------
|
||||||
|
+
|
||||||
|
+#ifndef AMF_VideoEncoderAV1_h
|
||||||
|
+#define AMF_VideoEncoderAV1_h
|
||||||
|
+#pragma once
|
||||||
|
+
|
||||||
|
+#include "Component.h"
|
||||||
|
+#include "ColorSpace.h"
|
||||||
|
+#include "PreAnalysis.h"
|
||||||
|
+
|
||||||
|
+#define AMFVideoEncoder_AV1 L"AMFVideoEncoderHW_AV1"
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_NONE = 0, // No encoding latency requirement. Encoder will balance encoding time and power consumption.
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_POWER_SAVING_REAL_TIME = 1, // Try the best to finish encoding a frame within 1/framerate sec. This mode may cause more power consumption
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_REAL_TIME = 2, // Try the best to finish encoding a frame within 1/(2 x framerate) sec. This mode will cause more power consumption than POWER_SAVING_REAL_TIME
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_LOWEST_LATENCY = 3 // Encoding as fast as possible. This mode causes highest power consumption.
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_USAGE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_USAGE_TRANSCODING = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_USAGE_LOW_LATENCY = 1
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_PROFILE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN = 1
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_LEVEL_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_2_0 = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_2_1 = 1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_2_2 = 2,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_2_3 = 3,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_3_0 = 4,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_3_1 = 5,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_3_2 = 6,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_3_3 = 7,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_4_0 = 8,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_4_1 = 9,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_4_2 = 10,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_4_3 = 11,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_5_0 = 12,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_5_1 = 13,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_5_2 = 14,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_5_3 = 15,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_6_0 = 16,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_6_1 = 17,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_6_2 = 18,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_6_3 = 19,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_7_0 = 20,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_7_1 = 21,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_7_2 = 22,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LEVEL_7_3 = 23
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_UNKNOWN = -1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CONSTANT_QP = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR = 1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR = 2,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_CBR = 3,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_QUALITY_VBR = 4,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_HIGH_QUALITY_VBR = 5,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_HIGH_QUALITY_CBR = 6
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY = 1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_1080P_CODED_1082 = 2,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_NO_RESTRICTIONS = 3
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_NONE = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_KEY = 1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_INTRA_ONLY = 2,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_SWITCH = 3,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_SHOW_EXISTING = 4
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_KEY = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_INTRA_ONLY = 1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_INTER = 2,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_SWITCH = 3,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_SHOW_EXISTING = 4
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_HIGH_QUALITY = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_QUALITY = 30,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_BALANCED = 70,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_SPEED = 100
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_NONE = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_GOP_ALIGNED = 1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_KEY_FRAME_ALIGNED = 2
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_NONE = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_FIXED_INTERVAL = 1
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_CDEF_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_CDEF_DISABLE = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_CDEF_ENABLE_DEFAULT = 1
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_DISABLE = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_ENABLE_DEFAULT = 1
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_AQ_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_AQ_MODE_NONE = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_AQ_MODE_CAQ = 1 // Content adaptive quantization mode
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__DISABLED = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__GOP_ALIGNED = 1,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__CONTINUOUS = 2
|
||||||
|
+};
|
||||||
|
+enum AMF_VIDEO_ENCODER_AV1_LTR_MODE_ENUM
|
||||||
|
+{
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LTR_MODE_RESET_UNUSED = 0,
|
||||||
|
+ AMF_VIDEO_ENCODER_AV1_LTR_MODE_KEEP_UNUSED = 1
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+// *** Static properties - can be set only before Init() ***
|
||||||
|
+
|
||||||
|
+// Encoder Engine Settings
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ENCODER_INSTANCE_INDEX L"Av1EncoderInstanceIndex" // amf_int64; default = 0; selected HW instance idx. The number of instances is queried by using AMF_VIDEO_ENCODER_AV1_CAP_NUM_OF_HW_INSTANCES
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE L"Av1EncodingLatencyMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE_ENUM); default = depends on USAGE; The encoding latency mode.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_QUERY_TIMEOUT L"Av1QueryTimeout" // amf_int64; default = 0 (no wait); timeout for QueryOutput call in ms.
|
||||||
|
+
|
||||||
|
+// Usage Settings
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_USAGE L"Av1Usage" // amf_int64(AMF_VIDEO_ENCODER_AV1_USAGE_ENUM); default = N/A; Encoder usage. fully configures parameter set.
|
||||||
|
+
|
||||||
|
+// Session Configuration
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FRAMESIZE L"Av1FrameSize" // AMFSize; default = 0,0; Frame size
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_COLOR_BIT_DEPTH L"Av1ColorBitDepth" // amf_int64(AMF_COLOR_BIT_DEPTH_ENUM); default = AMF_COLOR_BIT_DEPTH_8
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_PROFILE L"Av1Profile" // amf_int64(AMF_VIDEO_ENCODER_AV1_PROFILE_ENUM) ; default = depends on USAGE; the codec profile of the coded bitstream
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_LEVEL L"Av1Level" // amf_int64 (AMF_VIDEO_ENCODER_AV1_LEVEL_ENUM); default = depends on USAGE; the codec level of the coded bitstream
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_TILES_PER_FRAME L"Av1NumTilesPerFrame" // amf_int64; default = 1; Number of tiles Per Frame. This is treated as suggestion. The actual number of tiles might be different due to compliance or encoder limitation.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET L"Av1QualityPreset" // amf_int64(AMF_VIDEO_ENCODER_AV1_QUALITY_PRESET_ENUM); default = depends on USAGE; Quality Preset
|
||||||
|
+
|
||||||
|
+// Codec Configuration
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_SCREEN_CONTENT_TOOLS L"Av1ScreenContentTools" // bool; default = depends on USAGE; If true, allow enabling screen content tools by AMF_VIDEO_ENCODER_AV1_PALETTE_MODE and AMF_VIDEO_ENCODER_AV1_FORCE_INTEGER_MV; if false, all screen content tools are disabled.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ORDER_HINT L"Av1OrderHint" // bool; default = depends on USAGE; If true, code order hint; if false, don't code order hint
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FRAME_ID L"Av1FrameId" // bool; default = depends on USAGE; If true, code frame id; if false, don't code frame id
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_TILE_GROUP_OBU L"Av1TileGroupObu" // bool; default = depends on USAGE; If true, code FrameHeaderObu + TileGroupObu and each TileGroupObu contains one tile; if false, code FrameObu.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CDEF_MODE L"Av1CdefMode" // amd_int64(AMF_VIDEO_ENCODER_AV1_CDEF_MODE_ENUM); default = depends on USAGE; Cdef mode
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ERROR_RESILIENT_MODE L"Av1ErrorResilientMode" // bool; default = depends on USAGE; If true, enable error resilient mode; if false, disable error resilient mode
|
||||||
|
+
|
||||||
|
+// Rate Control and Quality Enhancement
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD L"Av1RateControlMethod" // amf_int64(AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_METHOD_ENUM); default = depends on USAGE; Rate Control Method
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_QVBR_QUALITY_LEVEL L"Av1QvbrQualityLevel" // amf_int64; default = 23; QVBR quality level; range = 1-51
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_INITIAL_VBV_BUFFER_FULLNESS L"Av1InitialVBVBufferFullness" // amf_int64; default = depends on USAGE; Initial VBV Buffer Fullness 0=0% 64=100%
|
||||||
|
+
|
||||||
|
+// Alignment Mode Configuration
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE L"Av1AlignmentMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_ENUM); default = AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_64X16_ONLY; Alignment Mode.
|
||||||
|
+
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_PRE_ANALYSIS_ENABLE L"Av1EnablePreAnalysis" // bool; default = depends on USAGE; If true, enables the pre-analysis module. Refer to AMF Video PreAnalysis API reference for more details. If false, disable the pre-analysis module.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_PREENCODE L"Av1RateControlPreEncode" // bool; default = depends on USAGE; If true, enables pre-encode assist in rate control; if false, disables pre-encode assist in rate control.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_HIGH_MOTION_QUALITY_BOOST L"Av1HighMotionQualityBoost" // bool; default = depends on USAGE; If true, enable high motion quality boost mode; if false, disable high motion quality boost mode.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_AQ_MODE L"Av1AQMode" // amd_int64(AMF_VIDEO_ENCODER_AV1_AQ_MODE_ENUM); default = depends on USAGE; AQ mode
|
||||||
|
+
|
||||||
|
+// Picture Management Configuration
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MAX_NUM_TEMPORAL_LAYERS L"Av1MaxNumOfTemporalLayers" // amf_int64; default = depends on USAGE; Max number of temporal layers might be enabled. The maximum value can be queried from AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_TEMPORAL_LAYERS
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MAX_LTR_FRAMES L"Av1MaxNumLTRFrames" // amf_int64; default = depends on USAGE; Max number of LTR frames. The maximum value can be queried from AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_LTR_FRAMES
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_LTR_MODE L"Av1LTRMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_LTR_MODE_ENUM); default = AMF_VIDEO_ENCODER_AV1_LTR_MODE_RESET_UNUSED; remove/keep unused LTRs (not specified in property AMF_VIDEO_ENCODER_AV1_FORCE_LTR_REFERENCE_BITFIELD)
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MAX_NUM_REFRAMES L"Av1MaxNumRefFrames" // amf_int64; default = 1; Maximum number of reference frames
|
||||||
|
+
|
||||||
|
+// color conversion
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_INPUT_HDR_METADATA L"Av1InHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL
|
||||||
|
+
|
||||||
|
+// Miscellaneous
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_EXTRA_DATA L"Av1ExtraData" // AMFInterface* - > AMFBuffer*; buffer to retrieve coded sequence header
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+// *** Dynamic properties - can be set anytime ***
|
||||||
|
+
|
||||||
|
+// Codec Configuration
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_PALETTE_MODE L"Av1PaletteMode" // bool; default = depends on USAGE; If true, enable palette mode; if false, disable palette mode. Valid only when AMF_VIDEO_ENCODER_AV1_SCREEN_CONTENT_TOOLS is true.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FORCE_INTEGER_MV L"Av1ForceIntegerMv" // bool; default = depends on USAGE; If true, enable force integer MV; if false, disable force integer MV. Valid only when AMF_VIDEO_ENCODER_AV1_SCREEN_CONTENT_TOOLS is true.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CDF_UPDATE L"Av1CdfUpdate" // bool; default = depends on USAGE; If true, enable CDF update; if false, disable CDF update.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE L"Av1CdfFrameEndUpdateMode" // amd_int64(AMF_VIDEO_ENCODER_AV1_CDF_FRAME_END_UPDATE_MODE_ENUM); default = depends on USAGE; CDF frame end update mode
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+// Rate Control and Quality Enhancement
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_VBV_BUFFER_SIZE L"Av1VBVBufferSize" // amf_int64; default = depends on USAGE; VBV Buffer Size in bits
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FRAMERATE L"Av1FrameRate" // AMFRate; default = depends on usage; Frame Rate
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ENFORCE_HRD L"Av1EnforceHRD" // bool; default = depends on USAGE; If true, enforce HRD; if false, HRD is not enforced.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FILLER_DATA L"Av1FillerData" // bool; default = depends on USAGE; If true, code filler data when needed; if false, don't code filler data.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_TARGET_BITRATE L"Av1TargetBitrate" // amf_int64; default = depends on USAGE; Target bit rate in bits
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_PEAK_BITRATE L"Av1PeakBitrate" // amf_int64; default = depends on USAGE; Peak bit rate in bits
|
||||||
|
+
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MAX_COMPRESSED_FRAME_SIZE L"Av1MaxCompressedFrameSize" // amf_int64; default = 0; Max compressed frame Size in bits. 0 - no limit
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTRA L"Av1MinQIndex_Intra" // amf_int64; default = depends on USAGE; Min QIndex for intra frames; range = 0-255
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTRA L"Av1MaxQIndex_Intra" // amf_int64; default = depends on USAGE; Max QIndex for intra frames; range = 0-255
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MIN_Q_INDEX_INTER L"Av1MinQIndex_Inter" // amf_int64; default = depends on USAGE; Min QIndex for inter frames; range = 0-255
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MAX_Q_INDEX_INTER L"Av1MaxQIndex_Inter" // amf_int64; default = depends on USAGE; Max QIndex for inter frames; range = 0-255
|
||||||
|
+
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTRA L"Av1QIndex_Intra" // amf_int64; default = depends on USAGE; intra-frame QIndex; range = 0-255
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_Q_INDEX_INTER L"Av1QIndex_Inter" // amf_int64; default = depends on USAGE; inter-frame QIndex; range = 0-255
|
||||||
|
+
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_RATE_CONTROL_SKIP_FRAME L"Av1RateControlSkipFrameEnable" // bool; default = depends on USAGE; If true, rate control may code skip frame when needed; if false, rate control will not code skip frame.
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+// Picture Management Configuration
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_GOP_SIZE L"Av1GOPSize" // amf_int64; default = depends on USAGE; GOP Size (distance between automatically inserted key frames). If 0, key frame will be inserted at first frame only. Note that GOP may be interrupted by AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE L"Av1HeaderInsertionMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_HEADER_INSERTION_MODE_ENUM); default = depends on USAGE; sequence header insertion mode
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE L"Av1SwitchFrameInsertionMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_ENUM); default = depends on USAGE; switch frame insertin mode
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INTERVAL L"Av1SwitchFrameInterval" // amf_int64; default = depends on USAGE; the interval between two inserted switch frames. Valid only when AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE is AMF_VIDEO_ENCODER_AV1_SWITCH_FRAME_INSERTION_MODE_FIXED_INTERVAL.
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_NUM_TEMPORAL_LAYERS L"Av1NumTemporalLayers" // amf_int64; default = depends on USAGE; Number of temporal layers. Can be changed at any time but the change is only applied when encoding next base layer frame.
|
||||||
|
+
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE L"Av1IntraRefreshMode" // amf_int64(AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE_ENUM); default AMF_VIDEO_ENCODER_AV1_INTRA_REFRESH_MODE__DISABLED
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_INTRAREFRESH_STRIPES L"Av1IntraRefreshNumOfStripes" // amf_int64; default = N/A; Valid only when intra refresh is enabled.
|
||||||
|
+
|
||||||
|
+// color conversion
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_INPUT_COLOR_PROFILE L"Av1InputColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_INPUT_TRANSFER_CHARACTERISTIC L"Av1InputColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 section 7.2 See VideoDecoderUVD.h for enum
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_INPUT_COLOR_PRIMARIES L"Av1InputColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum
|
||||||
|
+
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PROFILE L"Av1OutputColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_OUTPUT_TRANSFER_CHARACTERISTIC L"Av1OutputColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 ?7.2 See VideoDecoderUVD.h for enum
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PRIMARIES L"Av1OutputColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+// Frame encode parameters
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE L"Av1ForceFrameType" // amf_int64(AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_ENUM); default = AMF_VIDEO_ENCODER_AV1_FORCE_FRAME_TYPE_NONE; generate particular frame type
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FORCE_INSERT_SEQUENCE_HEADER L"Av1ForceInsertSequenceHeader" // bool; default = false; If true, force insert sequence header with current frame;
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_MARK_CURRENT_WITH_LTR_INDEX L"Av1MarkCurrentWithLTRIndex" // amf_int64; default = N/A; Mark current frame with LTR index
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_FORCE_LTR_REFERENCE_BITFIELD L"Av1ForceLTRReferenceBitfield" // amf_int64; default = 0; force LTR bit-field
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ROI_DATA L"Av1ROIData" // 2D AMFSurface, surface format: AMF_SURFACE_GRAY32
|
||||||
|
+
|
||||||
|
+// Encode output parameters
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE L"Av1OutputFrameType" // amf_int64(AMF_VIDEO_ENCODER_AV1_OUTPUT_FRAME_TYPE_ENUM); default = N/A
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_OUTPUT_MARKED_LTR_INDEX L"Av1MarkedLTRIndex" // amf_int64; default = N/A; Marked LTR index
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_OUTPUT_REFERENCED_LTR_INDEX_BITFIELD L"Av1ReferencedLTRIndexBitfield" // amf_int64; default = N/A; referenced LTR bit-field
|
||||||
|
+
|
||||||
|
+// AV1 Encoder capabilities - exposed in AMFCaps interface
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_NUM_OF_HW_INSTANCES L"Av1CapNumOfHwInstances" // amf_int64; default = N/A; number of HW encoder instances
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_THROUGHPUT L"Av1CapMaxThroughput" // amf_int64; default = N/A; MAX throughput for AV1 encoder in MB (16 x 16 pixel)
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_REQUESTED_THROUGHPUT L"Av1CapRequestedThroughput" // amf_int64; default = N/A; Currently total requested throughput for AV1 encode in MB (16 x 16 pixel)
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_COLOR_CONVERSION L"Av1CapColorConversion" // amf_int64(AMF_ACCELERATION_TYPE); default = N/A; type of supported color conversion. default AMF_ACCEL_GPU
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_PRE_ANALYSIS L"Av1PreAnalysis" // amf_bool - pre analysis module is available for AV1 UVE encoder, n/a for the other encoders
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_BITRATE L"Av1MaxBitrate" // amf_int64; default = N/A; Maximum bit rate in bits
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_PROFILE L"Av1MaxProfile" // amf_int64(AMF_VIDEO_ENCODER_AV1_PROFILE_ENUM); default = N/A; max value of code profile
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_LEVEL L"Av1MaxLevel" // amf_int64(AMF_VIDEO_ENCODER_AV1_LEVEL_ENUM); default = N/A; max value of codec level
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_TEMPORAL_LAYERS L"Av1CapMaxNumTemporalLayers" // amf_int64; default = N/A; The cap of maximum number of temporal layers
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_LTR_FRAMES L"Av1CapMaxNumLTRFrames" // amf_int64; default = N/A; The cap of maximum number of LTR frames. This value is calculated based on current value of AMF_VIDEO_ENCODER_AV1_MAX_NUM_TEMPORAL_LAYERS.
|
||||||
|
+
|
||||||
|
+#define AMF_VIDEO_ENCODER_AV1_ENABLE_SMART_ACCESS_VIDEO L"Av1EnableEncoderSmartAccessVideo" // amf_bool; default = false; true = enables smart access video feature
|
||||||
|
+
|
||||||
|
+#endif //#ifndef AMF_VideoEncoderAV1_h
|
20
hotfix.patch
20
hotfix.patch
@ -1,20 +0,0 @@
|
|||||||
diff --git a/ffmpeg b/ffmpeg
|
|
||||||
index 3721aae..336fe22 160000
|
|
||||||
--- a/ffmpeg
|
|
||||||
+++ b/ffmpeg
|
|
||||||
@@ -1 +1 @@
|
|
||||||
-Subproject commit 3721aaeaaae9f817abb843117ae8dae1dc280a7f
|
|
||||||
+Subproject commit 336fe225a6a0e12d2ba701c641df63d36151f6fb-dirty
|
|
||||||
diff --git a/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch b/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch
|
|
||||||
index d1a787a..6a53eb0 100644
|
|
||||||
--- a/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch
|
|
||||||
+++ b/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch
|
|
||||||
@@ -908,7 +908,7 @@ index 1e8ac56eed..500cf4c0bc 100644
|
|
||||||
+ break;
|
|
||||||
+ else if (sts != MFX_ERR_NONE) {
|
|
||||||
+ impl_idx++;
|
|
||||||
-+ continue;
|
|
||||||
++ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ sts = MFXCreateSession(loader, impl_idx, &session);
|
|
251
libfdkaac-dynlib-5.2.patch
Normal file
251
libfdkaac-dynlib-5.2.patch
Normal file
@ -0,0 +1,251 @@
|
|||||||
|
diff --git a/configure b/configure
|
||||||
|
index c157338b1f..8c1e88febe 100755
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -1787,7 +1787,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||||
|
|
||||||
|
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||||
|
decklink
|
||||||
|
- libfdk_aac
|
||||||
|
libtls
|
||||||
|
"
|
||||||
|
|
||||||
|
@@ -1886,6 +1885,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||||
|
openssl
|
||||||
|
pocketsphinx
|
||||||
|
vapoursynth
|
||||||
|
+ libfdk_aac
|
||||||
|
"
|
||||||
|
|
||||||
|
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
||||||
|
@@ -6576,9 +6576,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
|
||||||
|
enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
|
||||||
|
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
|
||||||
|
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
|
||||||
|
-enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
|
||||||
|
- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
|
||||||
|
- warn "using libfdk without pkg-config"; } }
|
||||||
|
+enabled libfdk_aac && require_headers fdk-aac/aacenc_lib.h
|
||||||
|
flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
|
||||||
|
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
|
||||||
|
enabled fontconfig && enable libfontconfig
|
||||||
|
diff --git a/libavcodec/libfdk-aac_internal.h b/libavcodec/libfdk-aac_internal.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..9bcfdb9aba
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/libavcodec/libfdk-aac_internal.h
|
||||||
|
@@ -0,0 +1,84 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (c) 2018 Gianluigi Tiesi
|
||||||
|
+ *
|
||||||
|
+ * This file is part of FFmpeg.
|
||||||
|
+ *
|
||||||
|
+ * FFmpeg is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation; either
|
||||||
|
+ * version 2.1 of the License, or (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * FFmpeg is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public
|
||||||
|
+ * License along with FFmpeg; if not, write to the Free Software
|
||||||
|
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#ifndef AVCODEC_LIBFDK_AAC_INTERNAL_H
|
||||||
|
+#define AVCODEC_LIBFDK_AAC_INTERNAL_H
|
||||||
|
+
|
||||||
|
+#ifdef _WIN32
|
||||||
|
+#include <windows.h>
|
||||||
|
+#define LIBNAME "libfdk-aac-2.dll"
|
||||||
|
+#define dlopen(fname, f) ((void *) LoadLibraryA(fname))
|
||||||
|
+#define dlclose(handle) FreeLibrary((HMODULE) handle)
|
||||||
|
+#define dlsym(handle, name) GetProcAddress((HMODULE) handle, name)
|
||||||
|
+#else
|
||||||
|
+#include <dlfcn.h>
|
||||||
|
+#define LIBNAME "libfdk-aac.so.2"
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#define DLSYM(x) \
|
||||||
|
+ do \
|
||||||
|
+ { \
|
||||||
|
+ s->pfn.x = ( imp_##x ) dlsym(s->hLib, AV_STRINGIFY(x)); \
|
||||||
|
+ if (!s->pfn.x ) \
|
||||||
|
+ { \
|
||||||
|
+ av_log(avctx, AV_LOG_ERROR, "Unable to find symbol " AV_STRINGIFY(x) " in dynamic " LIBNAME "\n"); \
|
||||||
|
+ return -1; \
|
||||||
|
+ } \
|
||||||
|
+ } while (0)
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+#include <fdk-aac/aacenc_lib.h>
|
||||||
|
+#include <fdk-aac/aacdecoder_lib.h>
|
||||||
|
+
|
||||||
|
+typedef AACENC_ERROR (*imp_aacEncOpen)(HANDLE_AACENCODER *phAacEncoder, const UINT encModules, const UINT maxChannels);
|
||||||
|
+typedef AACENC_ERROR (*imp_aacEncClose)(HANDLE_AACENCODER *phAacEncoder);
|
||||||
|
+typedef AACENC_ERROR (*imp_aacEncEncode)(const HANDLE_AACENCODER hAacEncoder, const AACENC_BufDesc *inBufDesc, const AACENC_BufDesc *outBufDesc, const AACENC_InArgs *inargs, AACENC_OutArgs *outargs);
|
||||||
|
+typedef AACENC_ERROR (*imp_aacEncInfo)(const HANDLE_AACENCODER hAacEncoder, AACENC_InfoStruct *pInfo);
|
||||||
|
+typedef AACENC_ERROR (*imp_aacEncoder_SetParam)(const HANDLE_AACENCODER hAacEncoder, const AACENC_PARAM param, const UINT value);
|
||||||
|
+
|
||||||
|
+typedef struct _aacEncLib {
|
||||||
|
+ imp_aacEncOpen aacEncOpen;
|
||||||
|
+ imp_aacEncClose aacEncClose;
|
||||||
|
+ imp_aacEncEncode aacEncEncode;
|
||||||
|
+ imp_aacEncInfo aacEncInfo;
|
||||||
|
+ imp_aacEncoder_SetParam aacEncoder_SetParam;
|
||||||
|
+} aacEncLib;
|
||||||
|
+
|
||||||
|
+typedef LINKSPEC_H HANDLE_AACDECODER (*imp_aacDecoder_Open)(TRANSPORT_TYPE transportFmt, UINT nrOfLayers);
|
||||||
|
+typedef LINKSPEC_H void (*imp_aacDecoder_Close)(HANDLE_AACDECODER self);
|
||||||
|
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_Fill)(HANDLE_AACDECODER self, UCHAR *pBuffer[], const UINT bufferSize[], UINT *bytesValid);
|
||||||
|
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_DecodeFrame)(HANDLE_AACDECODER self, INT_PCM *pTimeData, const INT timeDataSize, const UINT flags);
|
||||||
|
+typedef LINKSPEC_H CStreamInfo* (*imp_aacDecoder_GetStreamInfo)(HANDLE_AACDECODER self);
|
||||||
|
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_ConfigRaw)(HANDLE_AACDECODER self, UCHAR *conf[], const UINT length[]);
|
||||||
|
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_SetParam)(const HANDLE_AACDECODER self, const AACDEC_PARAM param, const INT value);
|
||||||
|
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_AncDataInit)(HANDLE_AACDECODER self, UCHAR *buffer, int size);
|
||||||
|
+
|
||||||
|
+typedef struct _aacDecLib {
|
||||||
|
+ imp_aacDecoder_Open aacDecoder_Open;
|
||||||
|
+ imp_aacDecoder_Close aacDecoder_Close;
|
||||||
|
+ imp_aacDecoder_Fill aacDecoder_Fill;
|
||||||
|
+ imp_aacDecoder_DecodeFrame aacDecoder_DecodeFrame;
|
||||||
|
+ imp_aacDecoder_ConfigRaw aacDecoder_ConfigRaw;
|
||||||
|
+ imp_aacDecoder_GetStreamInfo aacDecoder_GetStreamInfo;
|
||||||
|
+ imp_aacDecoder_SetParam aacDecoder_SetParam;
|
||||||
|
+ imp_aacDecoder_AncDataInit aacDecoder_AncDataInit;
|
||||||
|
+} aacDecLib;
|
||||||
|
+
|
||||||
|
+#endif /* AVCODEC_LIBFDK_AAC_INTERNAL_H */
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||||
|
index 8c1586e25e..9cf71838a9 100644
|
||||||
|
--- a/libavcodec/libfdk-aacdec.c
|
||||||
|
+++ b/libavcodec/libfdk-aacdec.c
|
||||||
|
@@ -25,6 +25,7 @@
|
||||||
|
#include "avcodec.h"
|
||||||
|
#include "codec_internal.h"
|
||||||
|
#include "decode.h"
|
||||||
|
+#include "libfdk-aac_internal.h"
|
||||||
|
|
||||||
|
#ifdef AACDECODER_LIB_VL0
|
||||||
|
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||||
|
@@ -48,6 +49,8 @@ enum ConcealMethod {
|
||||||
|
typedef struct FDKAACDecContext {
|
||||||
|
const AVClass *class;
|
||||||
|
HANDLE_AACDECODER handle;
|
||||||
|
+ void *hLib;
|
||||||
|
+ aacDecLib pfn;
|
||||||
|
uint8_t *decoder_buffer;
|
||||||
|
int decoder_buffer_size;
|
||||||
|
uint8_t *anc_buffer;
|
||||||
|
@@ -113,7 +116,7 @@ static const AVClass fdk_aac_dec_class = {
|
||||||
|
static int get_stream_info(AVCodecContext *avctx)
|
||||||
|
{
|
||||||
|
FDKAACDecContext *s = avctx->priv_data;
|
||||||
|
- CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle);
|
||||||
|
+ CStreamInfo *info = s->pfn.aacDecoder_GetStreamInfo(s->handle);
|
||||||
|
int channel_counts[0x24] = { 0 };
|
||||||
|
int i, ch_error = 0;
|
||||||
|
uint64_t ch_layout = 0;
|
||||||
|
@@ -231,8 +234,10 @@ static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
|
||||||
|
{
|
||||||
|
FDKAACDecContext *s = avctx->priv_data;
|
||||||
|
|
||||||
|
- if (s->handle)
|
||||||
|
- aacDecoder_Close(s->handle);
|
||||||
|
+ if (s->hLib && s->handle) {
|
||||||
|
+ s->pfn.aacDecoder_Close(s->handle);
|
||||||
|
+ dlclose(s->hLib);
|
||||||
|
+ }
|
||||||
|
av_freep(&s->decoder_buffer);
|
||||||
|
av_freep(&s->anc_buffer);
|
||||||
|
|
||||||
|
@@ -244,6 +249,28 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
|
||||||
|
FDKAACDecContext *s = avctx->priv_data;
|
||||||
|
AAC_DECODER_ERROR err;
|
||||||
|
|
||||||
|
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||||
|
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ DLSYM(aacDecoder_Open);
|
||||||
|
+#define aacDecoder_Open s->pfn.aacDecoder_Open
|
||||||
|
+ DLSYM(aacDecoder_Close);
|
||||||
|
+ DLSYM(aacDecoder_Fill);
|
||||||
|
+#define aacDecoder_Fill s->pfn.aacDecoder_Fill
|
||||||
|
+ DLSYM(aacDecoder_DecodeFrame);
|
||||||
|
+#define aacDecoder_DecodeFrame s->pfn.aacDecoder_DecodeFrame
|
||||||
|
+ DLSYM(aacDecoder_GetStreamInfo);
|
||||||
|
+#define aacDecoder_GetStreamInfo s->pfn.aacDecoder_GetStreamInfo
|
||||||
|
+ DLSYM(aacDecoder_ConfigRaw);
|
||||||
|
+#define aacDecoder_ConfigRaw s->pfn.aacDecoder_ConfigRaw
|
||||||
|
+ DLSYM(aacDecoder_SetParam);
|
||||||
|
+#define aacDecoder_SetParam s->pfn.aacDecoder_SetParam
|
||||||
|
+ DLSYM(aacDecoder_AncDataInit);
|
||||||
|
+#define aacDecoder_AncDataInit s->pfn.aacDecoder_AncDataInit
|
||||||
|
+
|
||||||
|
+
|
||||||
|
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
|
||||||
|
if (!s->handle) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
|
||||||
|
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
|
||||||
|
index fc2e71c51f..2083f38824 100644
|
||||||
|
--- a/libavcodec/libfdk-aacenc.c
|
||||||
|
+++ b/libavcodec/libfdk-aacenc.c
|
||||||
|
@@ -27,6 +27,7 @@
|
||||||
|
#include "codec_internal.h"
|
||||||
|
#include "encode.h"
|
||||||
|
#include "profiles.h"
|
||||||
|
+#include "libfdk-aac_internal.h"
|
||||||
|
|
||||||
|
#ifdef AACENCODER_LIB_VL0
|
||||||
|
#define FDKENC_VER_AT_LEAST(vl0, vl1) \
|
||||||
|
@@ -47,6 +48,8 @@ typedef struct AACContext {
|
||||||
|
int header_period;
|
||||||
|
int vbr;
|
||||||
|
|
||||||
|
+ void *hLib;
|
||||||
|
+ aacEncLib pfn;
|
||||||
|
AudioFrameQueue afq;
|
||||||
|
} AACContext;
|
||||||
|
|
||||||
|
@@ -111,8 +114,10 @@ static int aac_encode_close(AVCodecContext *avctx)
|
||||||
|
{
|
||||||
|
AACContext *s = avctx->priv_data;
|
||||||
|
|
||||||
|
- if (s->handle)
|
||||||
|
- aacEncClose(&s->handle);
|
||||||
|
+ if (s->hLib && s->handle) {
|
||||||
|
+ s->pfn.aacEncClose(&s->handle);
|
||||||
|
+ dlclose(s->hLib);
|
||||||
|
+ }
|
||||||
|
ff_af_queue_close(&s->afq);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
@@ -128,6 +133,22 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||||
|
int aot = FF_PROFILE_AAC_LOW + 1;
|
||||||
|
int sce = 0, cpe = 0;
|
||||||
|
|
||||||
|
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||||
|
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ DLSYM(aacEncOpen);
|
||||||
|
+#define aacEncOpen s->pfn.aacEncOpen
|
||||||
|
+ DLSYM(aacEncClose);
|
||||||
|
+ DLSYM(aacEncEncode);
|
||||||
|
+#define aacEncEncode s->pfn.aacEncEncode
|
||||||
|
+ DLSYM(aacEncInfo);
|
||||||
|
+#define aacEncInfo s->pfn.aacEncInfo
|
||||||
|
+ DLSYM(aacEncoder_SetParam);
|
||||||
|
+#define aacEncoder_SetParam s->pfn.aacEncoder_SetParam
|
||||||
|
+
|
||||||
|
+
|
||||||
|
if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||||
|
aac_get_error(err));
|
@ -1,24 +1,24 @@
|
|||||||
diff --git a/configure b/configure
|
diff --git a/configure b/configure
|
||||||
index 7a62f0c248..73078ffa60 100755
|
index b6616f00b6..d02f5099fe 100755
|
||||||
--- a/configure
|
--- a/configure
|
||||||
+++ b/configure
|
+++ b/configure
|
||||||
@@ -1783,7 +1783,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
@@ -1774,7 +1774,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||||
|
|
||||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||||
decklink
|
decklink
|
||||||
- libfdk_aac
|
- libfdk_aac
|
||||||
libtls
|
libtls
|
||||||
"
|
"
|
||||||
|
|
||||||
@@ -1880,6 +1879,7 @@ EXTERNAL_LIBRARY_LIST="
|
@@ -1873,6 +1872,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||||
openssl
|
openssl
|
||||||
pocketsphinx
|
pocketsphinx
|
||||||
vapoursynth
|
vapoursynth
|
||||||
+ libfdk_aac
|
+ libfdk_aac
|
||||||
"
|
"
|
||||||
|
|
||||||
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
||||||
@@ -6532,9 +6532,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
|
@@ -6581,9 +6581,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
|
||||||
enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
|
enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
|
||||||
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
|
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
|
||||||
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
|
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
|
||||||
@ -31,7 +31,7 @@ index 7a62f0c248..73078ffa60 100755
|
|||||||
enabled fontconfig && enable libfontconfig
|
enabled fontconfig && enable libfontconfig
|
||||||
diff --git a/libavcodec/libfdk-aac_internal.h b/libavcodec/libfdk-aac_internal.h
|
diff --git a/libavcodec/libfdk-aac_internal.h b/libavcodec/libfdk-aac_internal.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000..cd1e6e3340
|
index 0000000000..9bcfdb9aba
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libavcodec/libfdk-aac_internal.h
|
+++ b/libavcodec/libfdk-aac_internal.h
|
||||||
@@ -0,0 +1,84 @@
|
@@ -0,0 +1,84 @@
|
||||||
@ -119,28 +119,29 @@ index 0000000000..cd1e6e3340
|
|||||||
+} aacDecLib;
|
+} aacDecLib;
|
||||||
+
|
+
|
||||||
+#endif /* AVCODEC_LIBFDK_AAC_INTERNAL_H */
|
+#endif /* AVCODEC_LIBFDK_AAC_INTERNAL_H */
|
||||||
|
\ No newline at end of file
|
||||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||||
index ffa1fdcce3..b3ee1248ed 100644
|
index 8c1586e25e..25f68cdd10 100644
|
||||||
--- a/libavcodec/libfdk-aacdec.c
|
--- a/libavcodec/libfdk-aacdec.c
|
||||||
+++ b/libavcodec/libfdk-aacdec.c
|
+++ b/libavcodec/libfdk-aacdec.c
|
||||||
@@ -24,6 +24,7 @@
|
@@ -25,6 +25,7 @@
|
||||||
#include "libavutil/opt.h"
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "internal.h"
|
#include "codec_internal.h"
|
||||||
|
#include "decode.h"
|
||||||
+#include "libfdk-aac_internal.h"
|
+#include "libfdk-aac_internal.h"
|
||||||
|
|
||||||
#ifdef AACDECODER_LIB_VL0
|
#ifdef AACDECODER_LIB_VL0
|
||||||
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||||
@@ -47,6 +48,8 @@ enum ConcealMethod {
|
@@ -48,6 +49,8 @@ enum ConcealMethod {
|
||||||
typedef struct FDKAACDecContext {
|
typedef struct FDKAACDecContext {
|
||||||
const AVClass *class;
|
const AVClass *class;
|
||||||
HANDLE_AACDECODER handle;
|
HANDLE_AACDECODER handle;
|
||||||
+ void *hLib;
|
+ void *hLib;
|
||||||
+ aacDecLib pfn;
|
+ aacDecLib pfn;
|
||||||
uint8_t *decoder_buffer;
|
uint8_t *decoder_buffer;
|
||||||
int decoder_buffer_size;
|
int decoder_buffer_size;
|
||||||
uint8_t *anc_buffer;
|
uint8_t *anc_buffer;
|
||||||
@@ -101,7 +104,7 @@ static const AVClass fdk_aac_dec_class = {
|
@@ -113,7 +116,7 @@ static const AVClass fdk_aac_dec_class = {
|
||||||
static int get_stream_info(AVCodecContext *avctx)
|
static int get_stream_info(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
FDKAACDecContext *s = avctx->priv_data;
|
FDKAACDecContext *s = avctx->priv_data;
|
||||||
@ -149,10 +150,10 @@ index ffa1fdcce3..b3ee1248ed 100644
|
|||||||
int channel_counts[0x24] = { 0 };
|
int channel_counts[0x24] = { 0 };
|
||||||
int i, ch_error = 0;
|
int i, ch_error = 0;
|
||||||
uint64_t ch_layout = 0;
|
uint64_t ch_layout = 0;
|
||||||
@@ -216,8 +219,10 @@ static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
|
@@ -231,8 +234,10 @@ static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
FDKAACDecContext *s = avctx->priv_data;
|
FDKAACDecContext *s = avctx->priv_data;
|
||||||
|
|
||||||
- if (s->handle)
|
- if (s->handle)
|
||||||
- aacDecoder_Close(s->handle);
|
- aacDecoder_Close(s->handle);
|
||||||
+ if (s->hLib && s->handle) {
|
+ if (s->hLib && s->handle) {
|
||||||
@ -161,60 +162,60 @@ index ffa1fdcce3..b3ee1248ed 100644
|
|||||||
+ }
|
+ }
|
||||||
av_freep(&s->decoder_buffer);
|
av_freep(&s->decoder_buffer);
|
||||||
av_freep(&s->anc_buffer);
|
av_freep(&s->anc_buffer);
|
||||||
|
|
||||||
@@ -229,6 +234,27 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
|
@@ -244,6 +249,27 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
|
||||||
FDKAACDecContext *s = avctx->priv_data;
|
FDKAACDecContext *s = avctx->priv_data;
|
||||||
AAC_DECODER_ERROR err;
|
AAC_DECODER_ERROR err;
|
||||||
|
|
||||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||||
+ return -1;
|
+ return -1;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ DLSYM(aacDecoder_Open);
|
+ DLSYM(aacDecoder_Open);
|
||||||
+#define aacDecoder_Open s->pfn.aacDecoder_Open
|
+#define aacDecoder_Open s->pfn.aacDecoder_Open
|
||||||
+ DLSYM(aacDecoder_Close);
|
+ DLSYM(aacDecoder_Close);
|
||||||
+ DLSYM(aacDecoder_Fill);
|
+ DLSYM(aacDecoder_Fill);
|
||||||
+#define aacDecoder_Fill s->pfn.aacDecoder_Fill
|
+#define aacDecoder_Fill s->pfn.aacDecoder_Fill
|
||||||
+ DLSYM(aacDecoder_DecodeFrame);
|
+ DLSYM(aacDecoder_DecodeFrame);
|
||||||
+#define aacDecoder_DecodeFrame s->pfn.aacDecoder_DecodeFrame
|
+#define aacDecoder_DecodeFrame s->pfn.aacDecoder_DecodeFrame
|
||||||
+ DLSYM(aacDecoder_GetStreamInfo);
|
+ DLSYM(aacDecoder_GetStreamInfo);
|
||||||
+#define aacDecoder_GetStreamInfo s->pfn.aacDecoder_GetStreamInfo
|
+#define aacDecoder_GetStreamInfo s->pfn.aacDecoder_GetStreamInfo
|
||||||
+ DLSYM(aacDecoder_ConfigRaw);
|
+ DLSYM(aacDecoder_ConfigRaw);
|
||||||
+#define aacDecoder_ConfigRaw s->pfn.aacDecoder_ConfigRaw
|
+#define aacDecoder_ConfigRaw s->pfn.aacDecoder_ConfigRaw
|
||||||
+ DLSYM(aacDecoder_SetParam);
|
+ DLSYM(aacDecoder_SetParam);
|
||||||
+#define aacDecoder_SetParam s->pfn.aacDecoder_SetParam
|
+#define aacDecoder_SetParam s->pfn.aacDecoder_SetParam
|
||||||
+ DLSYM(aacDecoder_AncDataInit);
|
+ DLSYM(aacDecoder_AncDataInit);
|
||||||
+#define aacDecoder_AncDataInit s->pfn.aacDecoder_AncDataInit
|
+#define aacDecoder_AncDataInit s->pfn.aacDecoder_AncDataInit
|
||||||
+
|
+
|
||||||
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
|
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
|
||||||
if (!s->handle) {
|
if (!s->handle) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
|
av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
|
||||||
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
|
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
|
||||||
index 7ee2f13ac7..2a91d02c7f 100644
|
index 54549de473..9e93ce092c 100644
|
||||||
--- a/libavcodec/libfdk-aacenc.c
|
--- a/libavcodec/libfdk-aacenc.c
|
||||||
+++ b/libavcodec/libfdk-aacenc.c
|
+++ b/libavcodec/libfdk-aacenc.c
|
||||||
@@ -26,6 +26,7 @@
|
@@ -27,6 +27,7 @@
|
||||||
#include "audio_frame_queue.h"
|
#include "codec_internal.h"
|
||||||
#include "encode.h"
|
#include "encode.h"
|
||||||
#include "internal.h"
|
|
||||||
+#include "libfdk-aac_internal.h"
|
|
||||||
#include "profiles.h"
|
#include "profiles.h"
|
||||||
|
+#include "libfdk-aac_internal.h"
|
||||||
|
|
||||||
#ifdef AACENCODER_LIB_VL0
|
#ifdef AACENCODER_LIB_VL0
|
||||||
@@ -47,6 +48,8 @@ typedef struct AACContext {
|
#define FDKENC_VER_AT_LEAST(vl0, vl1) \
|
||||||
|
@@ -46,6 +47,8 @@ typedef struct AACContext {
|
||||||
|
int latm;
|
||||||
int header_period;
|
int header_period;
|
||||||
int vbr;
|
int vbr;
|
||||||
|
+ void *hLib;
|
||||||
+ void *hLib;
|
+ aacEncLib pfn;
|
||||||
+ aacEncLib pfn;
|
|
||||||
AudioFrameQueue afq;
|
AudioFrameQueue afq;
|
||||||
} AACContext;
|
} AACContext;
|
||||||
|
|
||||||
@@ -111,8 +114,10 @@ static int aac_encode_close(AVCodecContext *avctx)
|
@@ -111,8 +114,10 @@ static int aac_encode_close(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
AACContext *s = avctx->priv_data;
|
AACContext *s = avctx->priv_data;
|
||||||
|
|
||||||
- if (s->handle)
|
- if (s->handle)
|
||||||
- aacEncClose(&s->handle);
|
- aacEncClose(&s->handle);
|
||||||
+ if (s->hLib && s->handle) {
|
+ if (s->hLib && s->handle) {
|
||||||
@ -222,13 +223,13 @@ index 7ee2f13ac7..2a91d02c7f 100644
|
|||||||
+ dlclose(s->hLib);
|
+ dlclose(s->hLib);
|
||||||
+ }
|
+ }
|
||||||
ff_af_queue_close(&s->afq);
|
ff_af_queue_close(&s->afq);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -128,6 +133,21 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
@@ -128,6 +133,21 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||||
int aot = FF_PROFILE_AAC_LOW + 1;
|
int aot = FF_PROFILE_AAC_LOW + 1;
|
||||||
int sce = 0, cpe = 0;
|
int sce = 0, cpe = 0;
|
||||||
|
|
||||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||||
+ return -1;
|
+ return -1;
|
||||||
+ }
|
+ }
|
||||||
@ -243,6 +244,6 @@ index 7ee2f13ac7..2a91d02c7f 100644
|
|||||||
+ DLSYM(aacEncoder_SetParam);
|
+ DLSYM(aacEncoder_SetParam);
|
||||||
+#define aacEncoder_SetParam s->pfn.aacEncoder_SetParam
|
+#define aacEncoder_SetParam s->pfn.aacEncoder_SetParam
|
||||||
+
|
+
|
||||||
if ((err = aacEncOpen(&s->handle, 0, avctx->channels)) != AACENC_OK) {
|
if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||||
aac_get_error(err));
|
aac_get_error(err));
|
558
nvidia-av1-nvenc.patch
Normal file
558
nvidia-av1-nvenc.patch
Normal file
@ -0,0 +1,558 @@
|
|||||||
|
diff --git a/configure b/configure
|
||||||
|
index 957b7fe13e..75639477e7 100755
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -3181,6 +3181,8 @@ nvenc_deps_any="libdl LoadLibrary"
|
||||||
|
aac_mf_encoder_deps="mediafoundation"
|
||||||
|
ac3_mf_encoder_deps="mediafoundation"
|
||||||
|
av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
|
||||||
|
+av1_nvenc_encoder_deps="nvenc"
|
||||||
|
+av1_nvenc_encoder_select="atsc_a53"
|
||||||
|
h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
|
||||||
|
h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
|
||||||
|
h264_amf_encoder_deps="amf"
|
||||||
|
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
|
||||||
|
index 592d9347f6..ca35d72662 100644
|
||||||
|
--- a/libavcodec/Makefile
|
||||||
|
+++ b/libavcodec/Makefile
|
||||||
|
@@ -244,6 +244,7 @@ OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
|
||||||
|
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
|
||||||
|
OBJS-$(CONFIG_AV1_DECODER) += av1dec.o
|
||||||
|
OBJS-$(CONFIG_AV1_CUVID_DECODER) += cuviddec.o
|
||||||
|
+OBJS-$(CONFIG_AV1_NVENC_ENCODER) += nvenc_av1.o nvenc.o
|
||||||
|
OBJS-$(CONFIG_AVRN_DECODER) += avrndec.o
|
||||||
|
OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o
|
||||||
|
OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o
|
||||||
|
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
|
||||||
|
index cfeb01ac1c..62cc449591 100644
|
||||||
|
--- a/libavcodec/allcodecs.c
|
||||||
|
+++ b/libavcodec/allcodecs.c
|
||||||
|
@@ -827,6 +827,7 @@ extern const FFCodec ff_libaom_av1_decoder;
|
||||||
|
extern const FFCodec ff_av1_cuvid_decoder;
|
||||||
|
extern const FFCodec ff_av1_qsv_decoder;
|
||||||
|
extern const FFCodec ff_av1_amf_encoder;
|
||||||
|
+extern const FFCodec ff_av1_nvenc_encoder;
|
||||||
|
extern const FFCodec ff_libopenh264_encoder;
|
||||||
|
extern const FFCodec ff_libopenh264_decoder;
|
||||||
|
extern const FFCodec ff_h264_amf_encoder;
|
||||||
|
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
|
||||||
|
index 11bd21f365..fcdb6ae33a 100644
|
||||||
|
--- a/libavcodec/nvenc.c
|
||||||
|
+++ b/libavcodec/nvenc.c
|
||||||
|
@@ -65,6 +65,26 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
|
||||||
|
AV_PIX_FMT_NONE
|
||||||
|
};
|
||||||
|
|
||||||
|
+const enum AVPixelFormat ff_av1_nvenc_pix_fmts[] = {
|
||||||
|
+ AV_PIX_FMT_YUV420P,
|
||||||
|
+ AV_PIX_FMT_NV12,
|
||||||
|
+ AV_PIX_FMT_P010,
|
||||||
|
+ AV_PIX_FMT_P016, // Truncated to 10bits
|
||||||
|
+ AV_PIX_FMT_0RGB32,
|
||||||
|
+ AV_PIX_FMT_RGB32,
|
||||||
|
+ AV_PIX_FMT_0BGR32,
|
||||||
|
+ AV_PIX_FMT_BGR32,
|
||||||
|
+ AV_PIX_FMT_X2RGB10,
|
||||||
|
+ AV_PIX_FMT_X2BGR10,
|
||||||
|
+ AV_PIX_FMT_GBRP,
|
||||||
|
+ AV_PIX_FMT_GBRP16, // Truncated to 10bits
|
||||||
|
+ AV_PIX_FMT_CUDA,
|
||||||
|
+#if CONFIG_D3D11VA
|
||||||
|
+ AV_PIX_FMT_D3D11,
|
||||||
|
+#endif
|
||||||
|
+ AV_PIX_FMT_NONE
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = {
|
||||||
|
HW_CONFIG_ENCODER_FRAMES(CUDA, CUDA),
|
||||||
|
HW_CONFIG_ENCODER_DEVICE(NONE, CUDA),
|
||||||
|
@@ -222,7 +242,13 @@ static void nvenc_map_preset(NvencContext *ctx)
|
||||||
|
|
||||||
|
static void nvenc_print_driver_requirement(AVCodecContext *avctx, int level)
|
||||||
|
{
|
||||||
|
-#if NVENCAPI_CHECK_VERSION(11, 2)
|
||||||
|
+#if NVENCAPI_CHECK_VERSION(12, 0)
|
||||||
|
+# if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
+const char* minver = "520.0";
|
||||||
|
+# else
|
||||||
|
+const char* minver = "520.0";
|
||||||
|
+# endif
|
||||||
|
+#elif NVENCAPI_CHECK_VERSION(11, 2)
|
||||||
|
const char *minver = "(unknown)";
|
||||||
|
#elif NVENCAPI_CHECK_VERSION(11, 1)
|
||||||
|
# if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
@@ -658,6 +684,11 @@ static av_cold int nvenc_setup_device(AVCodecContext *avctx)
|
||||||
|
case AV_CODEC_ID_HEVC:
|
||||||
|
ctx->init_encode_params.encodeGUID = NV_ENC_CODEC_HEVC_GUID;
|
||||||
|
break;
|
||||||
|
+#ifdef NVENC_HAVE_AV1
|
||||||
|
+ case AV_CODEC_ID_AV1:
|
||||||
|
+ ctx->init_encode_params.encodeGUID = NV_ENC_CODEC_AV1_GUID;
|
||||||
|
+ break;
|
||||||
|
+#endif
|
||||||
|
default:
|
||||||
|
return AVERROR_BUG;
|
||||||
|
}
|
||||||
|
@@ -761,6 +792,10 @@ static av_cold void set_constqp(AVCodecContext *avctx)
|
||||||
|
{
|
||||||
|
NvencContext *ctx = avctx->priv_data;
|
||||||
|
NV_ENC_RC_PARAMS *rc = &ctx->encode_config.rcParams;
|
||||||
|
+ int qmax = 51;
|
||||||
|
+#ifdef NVENC_HAVE_AV1
|
||||||
|
+ qmax = avctx->codec->id != AV_CODEC_ID_AV1 ? 51 : 255;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
rc->rateControlMode = NV_ENC_PARAMS_RC_CONSTQP;
|
||||||
|
|
||||||
|
@@ -771,9 +806,9 @@ static av_cold void set_constqp(AVCodecContext *avctx)
|
||||||
|
rc->constQP.qpInterB = ctx->init_qp_b;
|
||||||
|
} else if (avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) {
|
||||||
|
rc->constQP.qpIntra = av_clip(
|
||||||
|
- rc->constQP.qpInterP * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, 51);
|
||||||
|
+ rc->constQP.qpInterP * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, qmax);
|
||||||
|
rc->constQP.qpInterB = av_clip(
|
||||||
|
- rc->constQP.qpInterP * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, 51);
|
||||||
|
+ rc->constQP.qpInterP * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, qmax);
|
||||||
|
} else {
|
||||||
|
rc->constQP.qpIntra = rc->constQP.qpInterP;
|
||||||
|
rc->constQP.qpInterB = rc->constQP.qpInterP;
|
||||||
|
@@ -781,9 +816,9 @@ static av_cold void set_constqp(AVCodecContext *avctx)
|
||||||
|
} else if (ctx->cqp >= 0) {
|
||||||
|
rc->constQP.qpInterP = rc->constQP.qpInterB = rc->constQP.qpIntra = ctx->cqp;
|
||||||
|
if (avctx->b_quant_factor != 0.0)
|
||||||
|
- rc->constQP.qpInterB = av_clip(ctx->cqp * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, 51);
|
||||||
|
+ rc->constQP.qpInterB = av_clip(ctx->cqp * fabs(avctx->b_quant_factor) + avctx->b_quant_offset + 0.5, 0, qmax);
|
||||||
|
if (avctx->i_quant_factor != 0.0)
|
||||||
|
- rc->constQP.qpIntra = av_clip(ctx->cqp * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, 51);
|
||||||
|
+ rc->constQP.qpIntra = av_clip(ctx->cqp * fabs(avctx->i_quant_factor) + avctx->i_quant_offset + 0.5, 0, qmax);
|
||||||
|
}
|
||||||
|
|
||||||
|
avctx->qmin = -1;
|
||||||
|
@@ -1199,7 +1234,8 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
|
||||||
|
h264->entropyCodingMode = ctx->coder;
|
||||||
|
|
||||||
|
#ifdef NVENC_HAVE_BFRAME_REF_MODE
|
||||||
|
- h264->useBFramesAsRef = ctx->b_ref_mode;
|
||||||
|
+ if (ctx->b_ref_mode >= 0)
|
||||||
|
+ h264->useBFramesAsRef = ctx->b_ref_mode;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES
|
||||||
|
@@ -1314,7 +1350,8 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
|
||||||
|
hevc->tier = ctx->tier;
|
||||||
|
|
||||||
|
#ifdef NVENC_HAVE_HEVC_BFRAME_REF_MODE
|
||||||
|
- hevc->useBFramesAsRef = ctx->b_ref_mode;
|
||||||
|
+ if (ctx->b_ref_mode >= 0)
|
||||||
|
+ hevc->useBFramesAsRef = ctx->b_ref_mode;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NVENC_HAVE_MULTIPLE_REF_FRAMES
|
||||||
|
@@ -1325,6 +1362,106 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifdef NVENC_HAVE_AV1
|
||||||
|
+static av_cold int nvenc_setup_av1_config(AVCodecContext* avctx)
|
||||||
|
+{
|
||||||
|
+ NvencContext* ctx = avctx->priv_data;
|
||||||
|
+ NV_ENC_CONFIG* cc = &ctx->encode_config;
|
||||||
|
+ NV_ENC_CONFIG_AV1* av1 = &cc->encodeCodecConfig.av1Config;
|
||||||
|
+
|
||||||
|
+ const AVPixFmtDescriptor* pixdesc = av_pix_fmt_desc_get(ctx->data_pix_fmt);
|
||||||
|
+
|
||||||
|
+ if ((pixdesc->flags & AV_PIX_FMT_FLAG_RGB) && !IS_GBRP(ctx->data_pix_fmt)) {
|
||||||
|
+ av1->matrixCoefficients = AVCOL_SPC_BT470BG;
|
||||||
|
+ av1->colorPrimaries = avctx->color_primaries;
|
||||||
|
+ av1->transferCharacteristics = avctx->color_trc;
|
||||||
|
+ av1->colorRange = 0;
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ av1->matrixCoefficients = IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace;
|
||||||
|
+ av1->colorPrimaries = avctx->color_primaries;
|
||||||
|
+ av1->transferCharacteristics = avctx->color_trc;
|
||||||
|
+ av1->colorRange = (avctx->color_range == AVCOL_RANGE_JPEG
|
||||||
|
+ || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (ctx->intra_refresh) {
|
||||||
|
+ av1->enableIntraRefresh = 1;
|
||||||
|
+ av1->intraRefreshPeriod = avctx->gop_size;
|
||||||
|
+ av1->intraRefreshCnt = avctx->gop_size - 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ av1->disableSeqHdr = 0;
|
||||||
|
+ av1->repeatSeqHdr = 1;
|
||||||
|
+
|
||||||
|
+ if (ctx->dpb_size >= 0) {
|
||||||
|
+ /* 0 means "let the hardware decide" */
|
||||||
|
+ av1->maxNumRefFramesInDPB = ctx->dpb_size;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (ctx->intra_refresh) {
|
||||||
|
+ av1->idrPeriod = NVENC_INFINITE_GOPLENGTH;
|
||||||
|
+ }
|
||||||
|
+ else if (avctx->gop_size >= 0) {
|
||||||
|
+ av1->idrPeriod = avctx->gop_size;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ av1->enableTimingInfo = 1;
|
||||||
|
+
|
||||||
|
+ switch (ctx->profile) {
|
||||||
|
+ case NV_ENC_AV1_PROFILE_MAIN:
|
||||||
|
+ cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID;
|
||||||
|
+ avctx->profile = FF_PROFILE_AV1_MAIN;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ av1->chromaFormatIDC = 1;
|
||||||
|
+
|
||||||
|
+ av1->inputPixelBitDepthMinus8 = IS_10BIT(ctx->data_pix_fmt) ? 2 : 0;
|
||||||
|
+ av1->pixelBitDepthMinus8 = ctx->highbitdepth ? 2 : av1->inputPixelBitDepthMinus8;
|
||||||
|
+
|
||||||
|
+ av1->level = ctx->level;
|
||||||
|
+
|
||||||
|
+ av1->tier = ctx->tier;
|
||||||
|
+
|
||||||
|
+ if (ctx->b_ref_mode >= 0)
|
||||||
|
+ av1->useBFramesAsRef = ctx->b_ref_mode;
|
||||||
|
+
|
||||||
|
+ av1->numFwdRefs = avctx->refs;
|
||||||
|
+ av1->numBwdRefs = avctx->refs;
|
||||||
|
+
|
||||||
|
+ if (ctx->highbitdepth)
|
||||||
|
+ av1->pixelBitDepthMinus8 = 2;
|
||||||
|
+
|
||||||
|
+ if (ctx->tilecolumns > 1 || ctx->tilerows > 1)
|
||||||
|
+ {
|
||||||
|
+ av1->enableCustomTileConfig = 1;
|
||||||
|
+ av1->numTileColumns = ctx->tilecolumns;
|
||||||
|
+ av1->numTileRows = ctx->tilerows;
|
||||||
|
+ int smb_w = (avctx->width + 63) >> 6;
|
||||||
|
+ int smb_h = (avctx->height + 63) >> 6;
|
||||||
|
+ int sum = 0;
|
||||||
|
+ for (int i = 0; i < av1->numTileColumns - 1; i++)
|
||||||
|
+ {
|
||||||
|
+ ctx->tileWidths[i] = (smb_w + av1->numTileColumns - 1) / av1->numTileColumns;
|
||||||
|
+ sum += ctx->tileWidths[i];
|
||||||
|
+ }
|
||||||
|
+ ctx->tileWidths[av1->numTileColumns - 1] = smb_w - sum;
|
||||||
|
+ sum = 0;
|
||||||
|
+ for (int i = 0; i < av1->numTileRows - 1; i++)
|
||||||
|
+ {
|
||||||
|
+ ctx->tileHeights[i] = (smb_h + av1->numTileRows - 1) / av1->numTileRows;
|
||||||
|
+ sum += ctx->tileHeights[i];
|
||||||
|
+ }
|
||||||
|
+ ctx->tileHeights[av1->numTileRows - 1] = smb_h - sum;
|
||||||
|
+ av1->tileWidths = ctx->tileWidths;
|
||||||
|
+ av1->tileHeights = ctx->tileHeights;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
static av_cold int nvenc_setup_codec_config(AVCodecContext *avctx)
|
||||||
|
{
|
||||||
|
switch (avctx->codec->id) {
|
||||||
|
@@ -1332,6 +1469,10 @@ static av_cold int nvenc_setup_codec_config(AVCodecContext *avctx)
|
||||||
|
return nvenc_setup_h264_config(avctx);
|
||||||
|
case AV_CODEC_ID_HEVC:
|
||||||
|
return nvenc_setup_hevc_config(avctx);
|
||||||
|
+#ifdef NVENC_HAVE_AV1
|
||||||
|
+ case AV_CODEC_ID_AV1:
|
||||||
|
+ return nvenc_setup_av1_config(avctx);
|
||||||
|
+#endif
|
||||||
|
/* Earlier switch/case will return if unknown codec is passed. */
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1344,12 +1485,22 @@ static void compute_dar(AVCodecContext *avctx, int *dw, int *dh) {
|
||||||
|
sw = avctx->width;
|
||||||
|
sh = avctx->height;
|
||||||
|
|
||||||
|
- if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
|
||||||
|
- sw *= avctx->sample_aspect_ratio.num;
|
||||||
|
- sh *= avctx->sample_aspect_ratio.den;
|
||||||
|
+ switch (avctx->codec->id) {
|
||||||
|
+ case AV_CODEC_ID_H264:
|
||||||
|
+ case AV_CODEC_ID_HEVC:
|
||||||
|
+ if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
|
||||||
|
+ sw *= avctx->sample_aspect_ratio.num;
|
||||||
|
+ sh *= avctx->sample_aspect_ratio.den;
|
||||||
|
+ }
|
||||||
|
+ av_reduce(dw, dh, sw, sh, 1024 * 1024);
|
||||||
|
+ break;
|
||||||
|
+#ifdef NVENC_HAVE_AV1
|
||||||
|
+ case AV_CODEC_ID_AV1:
|
||||||
|
+ *dw = sw;
|
||||||
|
+ *dh = sh;
|
||||||
|
+ break;
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- av_reduce(dw, dh, sw, sh, 1024 * 1024);
|
||||||
|
}
|
||||||
|
|
||||||
|
static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
|
||||||
|
@@ -2075,6 +2226,10 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
|
||||||
|
case AV_CODEC_ID_H265:
|
||||||
|
slice_mode_data = ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData;
|
||||||
|
break;
|
||||||
|
+#ifdef NVENC_HAVE_AV1
|
||||||
|
+ case AV_CODEC_ID_AV1:
|
||||||
|
+ break;
|
||||||
|
+#endif
|
||||||
|
default:
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Unknown codec name\n");
|
||||||
|
res = AVERROR(EINVAL);
|
||||||
|
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
|
||||||
|
index 9eb129952e..18d1e8381b 100644
|
||||||
|
--- a/libavcodec/nvenc.h
|
||||||
|
+++ b/libavcodec/nvenc.h
|
||||||
|
@@ -77,6 +77,11 @@ typedef void ID3D11Device;
|
||||||
|
#define NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+// SDK 12.0 compile time feature checks
|
||||||
|
+#if NVENCAPI_CHECK_VERSION(12, 0)
|
||||||
|
+#define NVENC_HAVE_AV1
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
typedef struct NvencSurface
|
||||||
|
{
|
||||||
|
NV_ENC_INPUT_PTR input_surface;
|
||||||
|
@@ -136,6 +141,13 @@ enum {
|
||||||
|
NV_ENC_HEVC_PROFILE_REXT,
|
||||||
|
};
|
||||||
|
|
||||||
|
+#ifdef NVENC_HAVE_AV1
|
||||||
|
+enum {
|
||||||
|
+ NV_ENC_AV1_PROFILE_MAIN,
|
||||||
|
+ NV_ENC_AV1_PROFILE_HIGH,
|
||||||
|
+};
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
enum {
|
||||||
|
NVENC_LOWLATENCY = 1,
|
||||||
|
NVENC_LOSSLESS = 2,
|
||||||
|
@@ -236,6 +248,11 @@ typedef struct NvencContext
|
||||||
|
int single_slice_intra_refresh;
|
||||||
|
int constrained_encoding;
|
||||||
|
int udu_sei;
|
||||||
|
+ int highbitdepth;
|
||||||
|
+ int tilecolumns;
|
||||||
|
+ int tilerows;
|
||||||
|
+ unsigned int tileWidths[256];
|
||||||
|
+ unsigned int tileHeights[256];
|
||||||
|
} NvencContext;
|
||||||
|
|
||||||
|
int ff_nvenc_encode_init(AVCodecContext *avctx);
|
||||||
|
@@ -247,6 +264,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt);
|
||||||
|
void ff_nvenc_encode_flush(AVCodecContext *avctx);
|
||||||
|
|
||||||
|
extern const enum AVPixelFormat ff_nvenc_pix_fmts[];
|
||||||
|
+extern const enum AVPixelFormat ff_av1_nvenc_pix_fmts[];
|
||||||
|
extern const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[];
|
||||||
|
|
||||||
|
#endif /* AVCODEC_NVENC_H */
|
||||||
|
diff --git a/libavcodec/nvenc_av1.c b/libavcodec/nvenc_av1.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..1f51ad057e
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/libavcodec/nvenc_av1.c
|
||||||
|
@@ -0,0 +1,169 @@
|
||||||
|
+/*
|
||||||
|
+ * This file is part of FFmpeg.
|
||||||
|
+ *
|
||||||
|
+ * FFmpeg is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU Lesser General Public
|
||||||
|
+ * License as published by the Free Software Foundation; either
|
||||||
|
+ * version 2.1 of the License, or (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * FFmpeg is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
+ * Lesser General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU Lesser General Public
|
||||||
|
+ * License along with FFmpeg; if not, write to the Free Software
|
||||||
|
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include "libavutil/internal.h"
|
||||||
|
+
|
||||||
|
+#include "avcodec.h"
|
||||||
|
+#include "codec_internal.h"
|
||||||
|
+
|
||||||
|
+#include "nvenc.h"
|
||||||
|
+
|
||||||
|
+#define OFFSET(x) offsetof(NvencContext, x)
|
||||||
|
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
||||||
|
+static const AVOption options[] = {
|
||||||
|
+ { "preset", "Set the encoding preset", OFFSET(preset), AV_OPT_TYPE_INT, { .i64 = PRESET_P4 }, PRESET_P1, PRESET_P7, VE, "preset" },
|
||||||
|
+ { "p1", "fastest (lowest quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P1 }, 0, 0, VE, "preset" },
|
||||||
|
+ { "p2", "faster (lower quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P2 }, 0, 0, VE, "preset" },
|
||||||
|
+ { "p3", "fast (low quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P3 }, 0, 0, VE, "preset" },
|
||||||
|
+ { "p4", "medium (default)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P4 }, 0, 0, VE, "preset" },
|
||||||
|
+ { "p5", "slow (good quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P5 }, 0, 0, VE, "preset" },
|
||||||
|
+ { "p6", "slower (better quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P6 }, 0, 0, VE, "preset" },
|
||||||
|
+ { "p7", "slowest (best quality)", 0, AV_OPT_TYPE_CONST, { .i64 = PRESET_P7 }, 0, 0, VE, "preset" },
|
||||||
|
+ { "tune", "Set the encoding tuning info", OFFSET(tuning_info), AV_OPT_TYPE_INT, { .i64 = NV_ENC_TUNING_INFO_HIGH_QUALITY }, NV_ENC_TUNING_INFO_HIGH_QUALITY, NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY, VE, "tune" },
|
||||||
|
+ { "hq", "High quality", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_HIGH_QUALITY }, 0, 0, VE, "tune" },
|
||||||
|
+ { "ll", "Low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOW_LATENCY }, 0, 0, VE, "tune" },
|
||||||
|
+ { "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, "tune" },
|
||||||
|
+ { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_AV1_PROFILE_MAIN }, NV_ENC_AV1_PROFILE_MAIN, NV_ENC_AV1_PROFILE_MAIN, VE, "profile" },
|
||||||
|
+ { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_AV1_PROFILE_MAIN }, 0, 0, VE, "profile" },
|
||||||
|
+ { "level", "Set the encoding level restriction", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = NV_ENC_LEVEL_AV1_AUTOSELECT }, NV_ENC_LEVEL_AV1_2, NV_ENC_LEVEL_AV1_AUTOSELECT, VE, "level" },
|
||||||
|
+ { "2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "2.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_2 }, 0, 0, VE, "level" },
|
||||||
|
+ { "2.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_21 }, 0, 0, VE, "level" },
|
||||||
|
+ { "3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_3 }, 0, 0, VE, "level" },
|
||||||
|
+ { "3.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_3 }, 0, 0, VE, "level" },
|
||||||
|
+ { "3.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_31 }, 0, 0, VE, "level" },
|
||||||
|
+ { "4", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_4 }, 0, 0, VE, "level" },
|
||||||
|
+ { "4.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_4 }, 0, 0, VE, "level" },
|
||||||
|
+ { "4.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_41 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_5 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_5 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_51 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_52 }, 0, 0, VE, "level" },
|
||||||
|
+ { "5.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_53 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_6 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.0", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_6 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.1", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_61 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.2", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_62 }, 0, 0, VE, "level" },
|
||||||
|
+ { "6.3", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_LEVEL_AV1_63 }, 0, 0, VE, "level" },
|
||||||
|
+ { "auto", "", 0, AV_OPT_TYPE_CONST, {.i64 = NV_ENC_LEVEL_AV1_AUTOSELECT },0, 0, VE, "level" },
|
||||||
|
+ { "rc", "Override the preset rate-control", OFFSET(rc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE, "rc" },
|
||||||
|
+ { "constqp", "Constant QP mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CONSTQP }, 0, 0, VE, "rc" },
|
||||||
|
+ { "vbr", "Variable bitrate mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_VBR }, 0, 0, VE, "rc" },
|
||||||
|
+ { "cbr", "Constant bitrate mode", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_PARAMS_RC_CBR }, 0, 0, VE, "rc" },
|
||||||
|
+ { "rc-lookahead", "Number of frames to look ahead for rate-control",
|
||||||
|
+ OFFSET(rc_lookahead), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
||||||
|
+ { "surfaces", "Number of concurrent surfaces", OFFSET(nb_surfaces), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_REGISTERED_FRAMES, VE },
|
||||||
|
+ { "cbr", "Use cbr encoding mode", OFFSET(cbr), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "2pass", "Use 2pass encoding mode", OFFSET(twopass), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VE },
|
||||||
|
+ { "gpu", "Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on.",
|
||||||
|
+ OFFSET(device), AV_OPT_TYPE_INT, { .i64 = ANY_DEVICE }, -2, INT_MAX, VE, "gpu" },
|
||||||
|
+ { "any", "Pick the first device available", 0, AV_OPT_TYPE_CONST, { .i64 = ANY_DEVICE }, 0, 0, VE, "gpu" },
|
||||||
|
+ { "list", "List the available devices", 0, AV_OPT_TYPE_CONST, { .i64 = LIST_DEVICES }, 0, 0, VE, "gpu" },
|
||||||
|
+ { "delay", "Delay frame output by the given amount of frames",
|
||||||
|
+ OFFSET(async_depth), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 0, INT_MAX, VE },
|
||||||
|
+ { "no-scenecut", "When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts",
|
||||||
|
+ OFFSET(no_scenecut), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "forced-idr", "If forcing keyframes, force them as IDR frames.",
|
||||||
|
+ OFFSET(forced_idr), AV_OPT_TYPE_BOOL, { .i64 = 0 }, -1, 1, VE },
|
||||||
|
+ { "b_adapt", "When lookahead is enabled, set this to 0 to disable adaptive B-frame decision",
|
||||||
|
+ OFFSET(b_adapt), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
|
||||||
|
+ { "spatial-aq", "set to 1 to enable Spatial AQ", OFFSET(aq), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "spatial_aq", "set to 1 to enable Spatial AQ", OFFSET(aq), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "temporal-aq", "set to 1 to enable Temporal AQ", OFFSET(temporal_aq), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "temporal_aq", "set to 1 to enable Temporal AQ", OFFSET(temporal_aq), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "zerolatency", "Set 1 to indicate zero latency operation (no reordering delay)",
|
||||||
|
+ OFFSET(zerolatency), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "nonref_p", "Set this to 1 to enable automatic insertion of non-reference P-frames",
|
||||||
|
+ OFFSET(nonref_p), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "strict_gop", "Set 1 to minimize GOP-to-GOP rate fluctuations",
|
||||||
|
+ OFFSET(strict_gop), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "aq-strength", "When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive)",
|
||||||
|
+ OFFSET(aq_strength), AV_OPT_TYPE_INT, { .i64 = 8 }, 1, 15, VE },
|
||||||
|
+ { "cq", "Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control",
|
||||||
|
+ OFFSET(quality), AV_OPT_TYPE_FLOAT, { .dbl = 0.}, 0., 51., VE },
|
||||||
|
+ { "init_qpP", "Initial QP value for P frame", OFFSET(init_qp_p), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "init_qpB", "Initial QP value for B frame", OFFSET(init_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "init_qpI", "Initial QP value for I frame", OFFSET(init_qp_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "qp", "Constant quantization parameter rate control method",
|
||||||
|
+ OFFSET(cqp), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
|
||||||
|
+ { "qp_cb_offset", "Quantization parameter offset for cb channel",
|
||||||
|
+ OFFSET(qp_cb_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, -12, 12, VE },
|
||||||
|
+ { "qp_cr_offset", "Quantization parameter offset for cr channel",
|
||||||
|
+ OFFSET(qp_cr_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, -12, 12, VE },
|
||||||
|
+ { "b_ref_mode", "Use B frames as references", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, NV_ENC_BFRAME_REF_MODE_MIDDLE, VE, "b_ref_mode" },
|
||||||
|
+ { "disabled", "B frames will not be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_DISABLED }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
+ { "each", "Each B frame will be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_EACH }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
+ { "middle", "Only (number of B frames)/2 will be used for reference", 0,AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_MIDDLE }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
+ { "dpb_size", "Specifies the DPB size used for encoding (0 means automatic)",
|
||||||
|
+ OFFSET(dpb_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
||||||
|
+ { "multipass", "Set the multipass encoding", OFFSET(multipass), AV_OPT_TYPE_INT, { .i64 = NV_ENC_MULTI_PASS_DISABLED }, NV_ENC_MULTI_PASS_DISABLED, NV_ENC_TWO_PASS_FULL_RESOLUTION, VE, "multipass" },
|
||||||
|
+ { "disabled", "Single Pass", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_MULTI_PASS_DISABLED }, 0, 0, VE, "multipass" },
|
||||||
|
+ { "qres", "Two Pass encoding is enabled where first Pass is quarter resolution",
|
||||||
|
+ 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TWO_PASS_QUARTER_RESOLUTION }, 0, 0, VE, "multipass" },
|
||||||
|
+ { "fullres", "Two Pass encoding is enabled where first Pass is full resolution",
|
||||||
|
+ 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TWO_PASS_FULL_RESOLUTION }, 0, 0, VE, "multipass" },
|
||||||
|
+ { "ldkfs", "Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR",
|
||||||
|
+ OFFSET(ldkfs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UCHAR_MAX, VE },
|
||||||
|
+ { "intra-refresh","Use Periodic Intra Refresh instead of IDR frames",
|
||||||
|
+ OFFSET(intra_refresh),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "highbitdepth", "set to 1 to enable 10 bit encodes for 8 bit input",
|
||||||
|
+ OFFSET(highbitdepth), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, VE },
|
||||||
|
+ { "tilecolumns", "tile columns", OFFSET(tilecolumns), AV_OPT_TYPE_INT, {.i64 = 1 }, 1, 256, VE },
|
||||||
|
+ { "tilerows", "tile rows", OFFSET(tilerows), AV_OPT_TYPE_INT, {.i64 = 1 }, 1, 256, VE },
|
||||||
|
+ { NULL }
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const FFCodecDefault defaults[] = {
|
||||||
|
+ { "b", "2M" },
|
||||||
|
+ { "qmin", "-1" },
|
||||||
|
+ { "qmax", "-1" },
|
||||||
|
+ { "qdiff", "-1" },
|
||||||
|
+ { "qblur", "-1" },
|
||||||
|
+ { "qcomp", "-1" },
|
||||||
|
+ { "g", "250" },
|
||||||
|
+ { "bf", "-1" },
|
||||||
|
+ { "refs", "0" },
|
||||||
|
+ { NULL },
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const AVClass av1_nvenc_class = {
|
||||||
|
+ .class_name = "av1_nvenc",
|
||||||
|
+ .item_name = av_default_item_name,
|
||||||
|
+ .option = options,
|
||||||
|
+ .version = LIBAVUTIL_VERSION_INT,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+const FFCodec ff_av1_nvenc_encoder = {
|
||||||
|
+ .p.name = "av1_nvenc",
|
||||||
|
+ .p.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC AV1 encoder"),
|
||||||
|
+ .p.type = AVMEDIA_TYPE_VIDEO,
|
||||||
|
+ .p.id = AV_CODEC_ID_AV1,
|
||||||
|
+ .init = ff_nvenc_encode_init,
|
||||||
|
+ FF_CODEC_RECEIVE_PACKET_CB(ff_nvenc_receive_packet),
|
||||||
|
+ .close = ff_nvenc_encode_close,
|
||||||
|
+ .flush = ff_nvenc_encode_flush,
|
||||||
|
+ .priv_data_size = sizeof(NvencContext),
|
||||||
|
+ .p.priv_class = &av1_nvenc_class,
|
||||||
|
+ .defaults = defaults,
|
||||||
|
+ .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
|
||||||
|
+ AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1,
|
||||||
|
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
|
+ .p.pix_fmts = ff_av1_nvenc_pix_fmts,
|
||||||
|
+ .p.wrapper_name = "nvenc",
|
||||||
|
+ .hw_configs = ff_nvenc_hw_configs,
|
||||||
|
+};
|
||||||
|
diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
|
||||||
|
index a178827291..347ba2a33c 100644
|
||||||
|
--- a/libavcodec/nvenc_h264.c
|
||||||
|
+++ b/libavcodec/nvenc_h264.c
|
||||||
|
@@ -166,7 +166,7 @@ static const AVOption options[] = {
|
||||||
|
{ "each", "Each B frame will be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_EACH }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
{ "middle", "Only (number of B frames)/2 will be used for reference", 0,AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_MIDDLE }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
#else
|
||||||
|
- { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE, "b_ref_mode" },
|
||||||
|
+ { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE, "b_ref_mode" },
|
||||||
|
{ "disabled", "", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
{ "each", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
{ "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
|
||||||
|
index ae4d73e497..1938de6b91 100644
|
||||||
|
--- a/libavcodec/nvenc_hevc.c
|
||||||
|
+++ b/libavcodec/nvenc_hevc.c
|
||||||
|
@@ -146,7 +146,7 @@ static const AVOption options[] = {
|
||||||
|
{ "each", "Each B frame will be used for reference", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_EACH }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
{ "middle", "Only (number of B frames)/2 will be used for reference", 0,AV_OPT_TYPE_CONST, { .i64 = NV_ENC_BFRAME_REF_MODE_MIDDLE }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
#else
|
||||||
|
- { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE, "b_ref_mode" },
|
||||||
|
+ { "b_ref_mode", "(not supported)", OFFSET(b_ref_mode), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE, "b_ref_mode" },
|
||||||
|
{ "disabled", "", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
{ "each", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "b_ref_mode" },
|
||||||
|
{ "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" },
|
Reference in New Issue
Block a user