Compare commits
201 Commits
20220325
...
20220728-c
Author | SHA1 | Date | |
---|---|---|---|
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 | |||
59dacbeb07 | |||
da225b24af | |||
5e09eb862a | |||
e8dfbd5ac8 | |||
a88383e546 | |||
24a6513793 | |||
3527b9abea | |||
b9e4fee2ac | |||
86d9ba2011 | |||
a5954a0e56 | |||
af32d05e64 | |||
15b0e11e31 | |||
7937ee0b73 | |||
03b0960c08 | |||
325c0f2c72 | |||
55882fc657 | |||
8314a4c7c2 | |||
64699c8a2e | |||
5f1c4ec9a2 | |||
1a8e9092ec | |||
9498189e65 | |||
1f3c7e6d57 | |||
1305f7ddcd | |||
779e91a3bf | |||
bc009b7637 | |||
31eb1e7b87 | |||
0a08bf5f80 | |||
6f78cf679d | |||
fe04466198 | |||
89b4c341ce | |||
3882ff91bc | |||
8a7bdc7ac4 | |||
8c6eddfa2e | |||
efff34e346 | |||
4160e3f737 | |||
a9b35cc1c0 | |||
d98946d3e0 | |||
10e5d3f04b | |||
cef5186411 | |||
347ab57c10 | |||
3ebc11408c | |||
e835ae2861 | |||
929c490792 | |||
0ba74560f2 | |||
f649035653 | |||
1355133686 | |||
3916f5661e | |||
2c02ee41d7 | |||
6feb014328 | |||
cce0b1ecea | |||
bfe07187a3 | |||
3997fc0f17 | |||
5620a8c9e5 | |||
bb582ebe7d | |||
6d37472afb | |||
4fcb2b40d3 | |||
bccfb18f53 | |||
5f2ebad096 | |||
fe7561200c | |||
e7c75df13f | |||
8b35b2e525 | |||
4d674f761b | |||
40fe90bc20 | |||
9a8f96b2ed | |||
a10a573f5c | |||
25fa76a356 | |||
c665db4759 | |||
d5bd6f9ad4 | |||
374b082a01 | |||
17a884d920 | |||
2833480ca2 | |||
e6c1284fbb | |||
9439e9cfa5 | |||
1dc6173424 | |||
7f66fd906e | |||
0b265803a0 | |||
94cf0e710c | |||
c03d0d47fa | |||
09c7ec1ae1 | |||
40e5b7394e | |||
72b1609469 | |||
f3ee3cb50c | |||
fc970ce5c9 | |||
28fd5b70cd | |||
f0119c54c9 |
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 ; 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
|
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
|
43
.github/actions/libsvtav1/action.yml
vendored
Normal file
43
.github/actions/libsvtav1/action.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
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
|
||||
- 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
|
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.0
|
||||
|
||||
ffmpeg-static-release:
|
||||
uses: ./.github/workflows/ffmpeg.yml
|
||||
with:
|
||||
system: windows-2022
|
||||
type: static
|
||||
config: release
|
||||
ffmpegRef: release/5.0
|
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 ../../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 --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
|
504
.github/workflows/ffmpeg-static.yml
vendored
504
.github/workflows/ffmpeg-static.yml
vendored
@ -1,504 +0,0 @@
|
||||
name: FFmpeg-Static
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
config:
|
||||
description: 'Configuration'
|
||||
required: true
|
||||
default: 'Debug'
|
||||
|
||||
env:
|
||||
vsPath: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
|
||||
msysConfig: debug
|
||||
winConfig: Debug
|
||||
cFlags: -MDd
|
||||
switches: "--enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libvpx --enable-libmp3lame --enable-libzimg --enable-libopus --enable-libogg --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libfdk-aac"
|
||||
NASM_EXECUTABLE: nasm
|
||||
|
||||
jobs:
|
||||
libogg:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
install: base-devel binutils autotools automake
|
||||
path-type: inherit
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: Build Ogg
|
||||
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'
|
||||
|
||||
libvorbis:
|
||||
runs-on: windows-2019
|
||||
needs: [libogg]
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
install: base-devel binutils autotools automake
|
||||
path-type: inherit
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- name: Set up GIT
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
- name: Checkout Vorbis
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: xiph/vorbis
|
||||
ref: master
|
||||
path: vorbis
|
||||
- name: Build Vorbis
|
||||
shell: cmd
|
||||
run: |
|
||||
dir /s build
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
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'
|
||||
|
||||
libvpl:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
install: base-devel binutils autotools automake
|
||||
path-type: inherit
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: Build oneVPL
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md temp build
|
||||
cd temp
|
||||
cmake.exe -G "Visual Studio 16 2019" ..\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 oneVPL.sln
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'rm -rf ../build/bin/cmake'
|
||||
|
||||
libsvtav1:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: Build SVT AV1
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md build build\include build\lib build\lib\pkgconfig
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd svtav1/Build/windows ; ./build.bat 2019 ${{ 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/'
|
||||
|
||||
libsnappy:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: 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 16 2019" .. -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/'
|
||||
|
||||
libvpx:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- name: Set up GIT
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
- name: Checkout LibVpx
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: webmproject/libvpx
|
||||
ref: master
|
||||
path: vpx
|
||||
- name: Build LibVpx
|
||||
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-vs16 --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'
|
||||
|
||||
libmp3lame:
|
||||
runs-on: windows-2019
|
||||
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@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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 svn://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'
|
||||
|
||||
libzimg:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: Build ZIMG
|
||||
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:WindowsTargetPlatformVersion=10.0.17134.0 /property:PlatformToolset=v142 /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'
|
||||
|
||||
libopus:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: Build OPUS
|
||||
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=v142 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@#$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'
|
||||
|
||||
libx264:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: Build X264
|
||||
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'
|
||||
|
||||
libfdkaac:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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: Build FDK AAC
|
||||
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=-MDd ./configure --prefix=$(realpath ../build) --disable-shared --disable-static ; make ; make install'
|
||||
|
||||
libx265-12:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- name: Set up MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
- name: Set up NASM
|
||||
uses: ilammy/setup-nasm@v1.2.1
|
||||
- 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: Build X265 (12 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 16 2019" ..\..\..\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 ..\..\..\..\build\lib\x265_12bit.lib
|
||||
|
||||
libx265-10:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- name: Set up MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
- name: Set up NASM
|
||||
uses: ilammy/setup-nasm@v1.2.1
|
||||
- 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: 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 16 2019" ..\..\..\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 ..\..\..\..\build\lib\x265_10bit.lib
|
||||
|
||||
libx265:
|
||||
runs-on: windows-2019
|
||||
needs: [libx265-12,libx265-10]
|
||||
steps:
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- name: Set up MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
- name: Set up NASM
|
||||
uses: ilammy/setup-nasm@v1.2.1
|
||||
- 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 dependant libs
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: build
|
||||
- name: Build X265
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md dist dist\include dist\lib dist\lib\pkgconfig
|
||||
cd x265/build/vc15-x86_64
|
||||
md work
|
||||
cd work
|
||||
cmake -G "Visual Studio 16 2019" ..\..\..\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 ..\..\..\..\build\lib
|
||||
"${{ env.vsPath }}VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\lib.exe" /ignore:4006 /ignore:4221 /OUT:x265.lib x265-static.lib x265_10bit.lib x265_12bit.lib
|
||||
copy ..\..\x265\source\x265.h ..\..\dist\include\
|
||||
rm build\lib\x265_10bit.lib build\lib\x265_12bit.lib
|
||||
|
||||
ffmpeg:
|
||||
runs-on: windows-2019
|
||||
needs: [libopus,libvpl,libsvtav1,libsnappy,libvpx,libmp3lame,libzimg,libvorbis,libx264,libx265,libfdkaac]
|
||||
steps:
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
key: ffmpeg-build
|
||||
path: build
|
||||
- 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
|
||||
- name: Checkout patches
|
||||
uses: actions/checkout@v3.0.0
|
||||
- name: Checkout FFmpeg
|
||||
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
|
||||
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 ../patches/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" --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
|
589
.github/workflows/ffmpeg.yml
vendored
589
.github/workflows/ffmpeg.yml
vendored
@ -1,517 +1,186 @@
|
||||
name: FFmpeg
|
||||
name: 'Build FFmpeg'
|
||||
|
||||
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
|
||||
description: Configuration
|
||||
required: true
|
||||
default: 'debug'
|
||||
description: 'Configuration'
|
||||
options:
|
||||
- Debug
|
||||
- Release
|
||||
- debug
|
||||
- release
|
||||
|
||||
ffmpegRef:
|
||||
type: string
|
||||
required: true
|
||||
default: 'release/5.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 (x86)\Microsoft Visual Studio\2019\Enterprise\
|
||||
switches: "--enable-libsvtav1 --enable-libsnappy --enable-libvpx --enable-libmp3lame --enable-libzimg --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libfdk-aac" #--enable-libvpl
|
||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||
COMPONENTS: "--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: Debug
|
||||
winConfig: debug
|
||||
cFlags: -MDd
|
||||
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:
|
||||
liboggvorbis:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
install: base-devel binutils autotools automake
|
||||
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: 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: Build Ogg
|
||||
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
|
||||
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-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libvpl
|
||||
with:
|
||||
install: base-devel binutils autotools automake
|
||||
path-type: inherit
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-ffmpeg-${{ env.msysConfig }}
|
||||
refId: master
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
liboggvorbis:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/liboggvorbis
|
||||
with:
|
||||
path: cache
|
||||
key: cache-key
|
||||
- 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: Build oneVPL
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md temp build dist
|
||||
cd temp
|
||||
cmake.exe -G "Visual Studio 16 2019" ..\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 oneVPL.sln
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ../build ; rm -rf bin/cmake ; tar czf ../dist/libvpl.tgz *'
|
||||
- name: Publish artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: libvpl
|
||||
path: dist/libvpl.tgz
|
||||
libogg_refId: v1.3.5
|
||||
libvorbis_refId: v1.3.7
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libsvtav1:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libsvtav1
|
||||
with:
|
||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||
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: 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: Build SVT AV1
|
||||
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 2019 ${{ 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
|
||||
refId: v1.1.0
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libsnappy:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libsnappy
|
||||
with:
|
||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||
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: 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: 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 16 2019" .. -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
|
||||
refId: 1.1.9
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libvpx:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libvpx
|
||||
with:
|
||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||
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: Set up GIT
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
- name: Checkout LibVpx
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: webmproject/libvpx
|
||||
ref: master
|
||||
path: vpx
|
||||
- name: Build LibVpx
|
||||
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-vs16 --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
|
||||
refId: v1.12.0
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libmp3lame:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libmp3lame
|
||||
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 svn://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
|
||||
refId: tags/RELEASE__3_100
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libzimg:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libzimg
|
||||
with:
|
||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||
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: 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: Build ZIMG
|
||||
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:WindowsTargetPlatformVersion=10.0.17134.0 /property:PlatformToolset=v142 /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
|
||||
refId: release-3.0.4
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libopus:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libopus
|
||||
with:
|
||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||
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: 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: Build OPUS
|
||||
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=v142 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-2019
|
||||
steps:
|
||||
- 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: Set up cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-ffmpeg-${{ env.msysConfig }}
|
||||
with:
|
||||
path: cache
|
||||
key: cache-key
|
||||
- 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: Build X264
|
||||
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
|
||||
refId: v1.3.1
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libfdkaac:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libfdkaac
|
||||
with:
|
||||
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||
path-type: inherit
|
||||
- name: Set up cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-ffmpeg-${{ env.msysConfig }}
|
||||
refId: v2.0.2
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libx264:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libx264
|
||||
with:
|
||||
path: cache
|
||||
key: cache-key
|
||||
- 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: Build FDK AAC
|
||||
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=-MDd ./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
|
||||
refId: stable
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libx265-12:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
- name: Set up NASM
|
||||
uses: ilammy/setup-nasm@v1.2.1
|
||||
- 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: Build X265 (12 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 16 2019" ..\..\..\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
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libx265-12
|
||||
with:
|
||||
name: x265_12bit
|
||||
path: dist/x265_12bit.lib
|
||||
refId: Release_3.5
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libx265-10:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- name: Set up MSBuild
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
- name: Set up NASM
|
||||
uses: ilammy/setup-nasm@v1.2.1
|
||||
- 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: 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 16 2019" ..\..\..\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
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libx265-10
|
||||
with:
|
||||
name: x265_10bit
|
||||
path: dist/x265_10bit.lib
|
||||
refId: Release_3.5
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libx265:
|
||||
runs-on: windows-2019
|
||||
runs-on: ${{ inputs.system }}
|
||||
needs: [libx265-12,libx265-10]
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libx265
|
||||
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: 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 dependant libs
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: build
|
||||
- name: Build X265
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md dist dist\include dist\lib dist\lib\pkgconfig
|
||||
cd x265/build/vc15-x86_64
|
||||
md work
|
||||
cd work
|
||||
cmake -G "Visual Studio 16 2019" ..\..\..\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\
|
||||
dir /s dist
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd dist ; tar czf ../libx265.tgz *'
|
||||
- name: Publish artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: libx265
|
||||
path: libx265.tgz
|
||||
refId: Release_3.5
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
ffmpeg:
|
||||
runs-on: windows-2019
|
||||
needs: [libopus,libvpl,libsvtav1,libsnappy,libvpx,libmp3lame,libzimg,liboggvorbis,libx264,libx265,libfdkaac]
|
||||
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
|
||||
@ -522,19 +191,21 @@ jobs:
|
||||
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: release/5.0
|
||||
ref: ${{ inputs.ffmpegRef }}
|
||||
path: ffmpeg
|
||||
- name: Checkout NvEnc
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: FFmpeg/nv-codec-headers
|
||||
ref: sdk/9.1
|
||||
ref: master
|
||||
path: nvenc
|
||||
- name: Checkout AMF
|
||||
uses: actions/checkout@v3.0.0
|
||||
@ -551,9 +222,9 @@ jobs:
|
||||
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 ../patches/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 *'
|
||||
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 ${{ env.variant }} --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-${{ inputs.type }}-${{ inputs.config }}.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
|
||||
name: FFmpeg ${{ inputs.system }} ${{ inputs.config }}${{ inputs.config }} package build
|
||||
path: dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz
|
||||
|
44
.gitmodules
vendored
44
.gitmodules
vendored
@ -1,44 +0,0 @@
|
||||
[submodule "repos/ffnvcodec"]
|
||||
path = repos/ffnvcodec
|
||||
url = https://github.com/FFmpeg/nv-codec-headers.git
|
||||
branch = sdk/9.1
|
||||
[submodule "repos/amf"]
|
||||
path = repos/amf
|
||||
url = https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git
|
||||
[submodule "repos/svt-av1"]
|
||||
path = repos/svt-av1
|
||||
url = https://github.com/AOMediaCodec/SVT-AV1
|
||||
[submodule "repos/libogg"]
|
||||
path = repos/libogg
|
||||
url = https://github.com/xiph/ogg.git
|
||||
[submodule "repos/libvorbis"]
|
||||
path = repos/libvorbis
|
||||
url = https://github.com/xiph/vorbis.git
|
||||
[submodule "repos/snappy"]
|
||||
path = repos/snappy
|
||||
url = https://github.com/google/snappy.git
|
||||
[submodule "repos/libvpx"]
|
||||
path = repos/libvpx
|
||||
url = https://github.com/webmproject/libvpx.git
|
||||
[submodule "repos/fdk-aac"]
|
||||
path = repos/fdk-aac
|
||||
url = https://github.com/mstorsjo/fdk-aac.git
|
||||
[submodule "repos/zimg"]
|
||||
path = repos/zimg
|
||||
url = https://github.com/sekrit-twc/zimg.git
|
||||
[submodule "repos/x264"]
|
||||
path = repos/x264
|
||||
url = https://code.videolan.org/videolan/x264.git
|
||||
[submodule "repos/opus"]
|
||||
path = repos/opus
|
||||
url = https://github.com/xiph/opus.git
|
||||
[submodule "repos/x265"]
|
||||
path = repos/x265
|
||||
url = https://github.com/videolan/x265.git
|
||||
[submodule "repos/ffmpeg"]
|
||||
path = repos/ffmpeg
|
||||
url = https://github.com/FFmpeg/FFmpeg.git
|
||||
branch = release/5.0
|
||||
[submodule "repos/oneVPL"]
|
||||
path = repos/oneVPL
|
||||
url = https://github.com/oneapi-src/oneVPL.git
|
@ -1,8 +1,8 @@
|
||||
diff --git a/configure b/configure
|
||||
index 7a62f0c248..e4b5dae609 100755
|
||||
index 77facac8c9..ab117fba2c 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1783,7 +1783,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
@@ -1785,7 +1785,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
|
||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||
decklink
|
||||
@ -10,7 +10,7 @@ index 7a62f0c248..e4b5dae609 100755
|
||||
libtls
|
||||
"
|
||||
|
||||
@@ -1880,6 +1879,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
@@ -1882,6 +1881,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
openssl
|
||||
pocketsphinx
|
||||
vapoursynth
|
||||
@ -18,7 +18,7 @@ index 7a62f0c248..e4b5dae609 100755
|
||||
"
|
||||
|
||||
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
||||
@@ -6532,9 +6532,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
|
||||
@@ -6524,9 +6524,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
|
||||
@ -29,11 +29,138 @@ index 7a62f0c248..e4b5dae609 100755
|
||||
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
|
||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||
index e9096a08e6..cc4d79c651 100644
|
||||
--- a/libavcodec/libfdk-aacdec.c
|
||||
+++ b/libavcodec/libfdk-aacdec.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "codec_internal.h"
|
||||
#include "internal.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,27 @@ 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 d004ae00c3..902dddb365 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,21 @@ 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));
|
||||
diff --git a/libfdk-aac_internal.h b/libfdk-aac_internal.h
|
||||
new file mode 100644
|
||||
index 0000000000..9bcfdb9aba
|
||||
--- /dev/null
|
||||
+++ b/libavcodec/libfdk-aac_internal.h
|
||||
+++ b/libfdk-aac_internal.h
|
||||
@@ -0,0 +1,84 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Gianluigi Tiesi
|
||||
@ -120,130 +247,3 @@ index 0000000000..9bcfdb9aba
|
||||
+
|
||||
+#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 ffa1fdcce3..ebf6350b41 100644
|
||||
--- a/libavcodec/libfdk-aacdec.c
|
||||
+++ b/libavcodec/libfdk-aacdec.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACDECODER_LIB_VL0
|
||||
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -47,6 +48,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;
|
||||
@@ -101,7 +104,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;
|
||||
@@ -216,8 +219,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);
|
||||
|
||||
@@ -229,6 +234,27 @@ 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 7ee2f13ac7..ff604671a6 100644
|
||||
--- a/libavcodec/libfdk-aacenc.c
|
||||
+++ b/libavcodec/libfdk-aacenc.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "audio_frame_queue.h"
|
||||
#include "encode.h"
|
||||
#include "internal.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
#include "profiles.h"
|
||||
|
||||
#ifdef AACENCODER_LIB_VL0
|
||||
@@ -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,21 @@ 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->channels)) != AACENC_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||
aac_get_error(err));
|
24
README.md
24
README.md
@ -1,23 +1,3 @@
|
||||
# voukoder-ffmpeg-buildscript
|
||||
# voukoder-ffmpeg
|
||||
|
||||
Builds static libraries of ffmeg and external libraries (x264 8bit, x265 8,10 and 12bit) to be used in the voukoder project.
|
||||
|
||||
## Install msys2
|
||||
- Get the 64bit version of msys2 from msys2.org
|
||||
- Install it
|
||||
|
||||
## Start msys2
|
||||
- Open a command prompt
|
||||
- Run "vcvarsall.bat amd64" in "c:\program files (x86)\microsoft visual studio\2017\community\VC\Auxiliary\Build"
|
||||
- Run msys2 with "msys2_shell.cmd -mingw64 -full-path"
|
||||
|
||||
## Install development tools
|
||||
- Install CMakeGui in Windows to have the VisualStudio templates ready
|
||||
- Install "pacman -S base-devel binutils git make pkg-config subversion zip" in msys2
|
||||
- Install nasm to /usr/bin/nasm.exe
|
||||
- Install cmake gui
|
||||
- Add cmake path to path variable
|
||||
|
||||
## Starting the build
|
||||
- Have the build.sh file at i.e. "/home/daniel/ffmpeg/build.sh"
|
||||
- Start the build by either "./build.sh debug" or "./build.sh release"
|
||||
Provides a FFmpeg static libs to be used with Voukoder. They are being built using a GitHub action worflow.
|
||||
|
302
build.sh
302
build.sh
@ -1,302 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
COMPONENTS=""
|
||||
|
||||
if [ "$MODE" == "debug" ]; then
|
||||
MSBUILD_CONFIG=Debug
|
||||
CFLAGS=-MDd
|
||||
elif [ "$MODE" == "release" ]; then
|
||||
MSBUILD_CONFIG=Release
|
||||
CFLAGS=-MD
|
||||
else
|
||||
echo "Please supply build mode [debug|release]!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function build {
|
||||
cd $repos/$1
|
||||
#if [ -f autogen.sh ]; then
|
||||
# ./autogen.sh
|
||||
#fi
|
||||
autoreconf -i
|
||||
CC=cl CXX=cl CXXFLAGS=$CFLAGS ./configure --prefix=$BUILD $2
|
||||
make -j $NUMBER_OF_PROCESSORS
|
||||
make install
|
||||
}
|
||||
|
||||
function build_nvenc {
|
||||
echo "################################################################################"
|
||||
echo "## NVENC ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/ffnvcodec
|
||||
make PREFIX=$BUILD install
|
||||
add_comp nvenc
|
||||
}
|
||||
|
||||
function build_amf {
|
||||
echo "################################################################################"
|
||||
echo "## AMF ##"
|
||||
echo "################################################################################"
|
||||
cp -a $repos/amf/amf/public/include $BUILD/include/AMF
|
||||
add_comp amf
|
||||
}
|
||||
|
||||
function build_mfx {
|
||||
echo "################################################################################"
|
||||
echo "## LIBMFX ##"
|
||||
echo "################################################################################"
|
||||
cp -r "C:\Program Files (x86)\IntelSWTools\Intel(R) Media SDK 2021 R1\Software Development Kit\include" $BUILD/include/mfx
|
||||
cp "C:\Program Files (x86)\IntelSWTools\Intel(R) Media SDK 2021 R1\Software Development Kit\lib\x64\libmfx_vs2015.lib" $BUILD/lib/libmfx.lib
|
||||
printf "prefix=$BUILD\nexec_prefix=\${prefix}\nincludedir=\${prefix}/include\nlibdir=\${exec_prefix}/lib\nName: libmfx\nDescription: Intel Media SDK Dispatched static library\nVersion: 1.34\nLibs: -L\${libdir} -llibmfx -ladvapi32 -lole32 -luuid\nCflags: -I\${includedir}\n" > $BUILD/lib/pkgconfig/libmfx.pc
|
||||
|
||||
#git clone -q https://github.com/lu-zero/mfx_dispatch.git $SRC/libmfx
|
||||
#cd $SRC/libmfx
|
||||
#if [[ ! -f "configure" ]]; then
|
||||
# autoreconf -fiv || exit 1
|
||||
#fi
|
||||
#build libmfx
|
||||
#sed -i 's/-lstdc++/-ladvapi32/g' $BUILD/lib/pkgconfig/libmfx.pc
|
||||
add_comp libmfx
|
||||
}
|
||||
|
||||
function build_svt {
|
||||
echo "################################################################################"
|
||||
echo "## LIBSVTAV1 ##"
|
||||
echo "################################################################################"
|
||||
# HEVC
|
||||
#git clone -q https://github.com/OpenVisualCloud/SVT-HEVC.git $SRC/svt-hevc
|
||||
#cd $SRC/svt-hevc/Build/windows
|
||||
#cmake .. -G"Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=$BUILD -DCMAKE_CONFIGURATION_TYPES=$MSBUILD_CONFIG
|
||||
#MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration=$MSBUILD_CONFIG /property:ConfigurationType=StaticLibrary /property:TargetExt=.lib svt-hevc.sln
|
||||
#cp -r ../Source/API $BUILD/include/svt-hevc ; cp ../Bin/$MSBUILD_CONFIG/SvtHevcEnc.lib $BUILD/lib/ ; cp SvtHevcEnc.pc $BUILD/lib/pkgconfig/
|
||||
#add_comp libsvthevc
|
||||
#
|
||||
# AV1
|
||||
#git clone -q --depth 1 https://github.com/AOMediaCodec/SVT-AV1 $SRC/svt-av1
|
||||
cd $repos/svt-av1/Build/windows
|
||||
./build.bat 2017 $MODE static
|
||||
cp -r ../../Source/API $BUILD/include/svt-av1 ; cp ../../Bin/$MSBUILD_CONFIG/SvtAv1Enc.lib $BUILD/lib/ ; cp SvtAv1Enc.pc $BUILD/lib/pkgconfig/
|
||||
add_comp libsvtav1
|
||||
cd ../../../..
|
||||
#
|
||||
# VP9
|
||||
#git clone -q https://github.com/OpenVisualCloud/SVT-VP9.git $SRC/svt-vp9
|
||||
#cd $SRC/svt-vp9/Build/windows
|
||||
#cmake .. -G"Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=$BUILD -DCMAKE_CONFIGURATION_TYPES=$MSBUILD_CONFIG
|
||||
#MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration=$MSBUILD_CONFIG /property:ConfigurationType=StaticLibrary /property:TargetExt=".lib" svt-vp9.sln
|
||||
#cp -r ../Source/API $BUILD/include/svt-vp9 ; cp ../Bin/$MSBUILD_CONFIG/SvtVp9Enc.lib $BUILD/lib/ ; cp SvtVp9Enc.pc $BUILD/lib/pkgconfig/
|
||||
#sed -i 's/ -lpthread//g' $BUILD/lib/pkgconfig/SvtVp9Enc.pc
|
||||
#sed -i 's/ -lm//g' $BUILD/lib/pkgconfig/SvtVp9Enc.pc
|
||||
#add_comp libsvtvp9
|
||||
}
|
||||
|
||||
function build_ogg {
|
||||
echo "################################################################################"
|
||||
echo "## LIBOGG ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/libogg
|
||||
build libogg "--disable-shared"
|
||||
}
|
||||
|
||||
function build_vorbis {
|
||||
echo "################################################################################"
|
||||
echo "## LIBVORBIS ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/libvorbis
|
||||
build libvorbis "--disable-shared"
|
||||
sed -i '/^Libs\.private.*/d' $BUILD/lib/pkgconfig/vorbis.pc # don't need m.lib on windows
|
||||
add_comp libvorbis
|
||||
}
|
||||
|
||||
function build_snappy {
|
||||
echo "################################################################################"
|
||||
echo "## LIBSNAPPY ##"
|
||||
echo "################################################################################"
|
||||
#git clone -q -b 1.1.8 https://github.com/google/snappy.git $SRC/snappy
|
||||
cd $repos/snappy
|
||||
rm -rf work
|
||||
mkdir work
|
||||
cd work
|
||||
cmake -G "Visual Studio 15 Win64" .. -DCMAKE_INSTALL_PREFIX=$BUILD -DBUILD_SHARED_LIBS=OFF -DSNAPPY_BUILD_TESTS=OFF
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" Snappy.sln
|
||||
cp $MSBUILD_CONFIG/snappy.lib $BUILD/lib/snappy.lib
|
||||
cp ../snappy.h ../snappy-c.h $BUILD/include/
|
||||
add_comp libsnappy
|
||||
}
|
||||
|
||||
function build_libvpx {
|
||||
echo "################################################################################"
|
||||
echo "## LIBVPX ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/libvpx
|
||||
./configure --prefix=$BUILD --target=x86_64-win64-vs15 --enable-vp9-highbitdepth --disable-shared --disable-examples --disable-tools --disable-docs --disable-libyuv --disable-unit_tests --disable-postproc
|
||||
make -j $NUMBER_OF_PROCESSORS
|
||||
make install
|
||||
mv $BUILD/lib/x64/vpxmd.lib $BUILD/lib/vpx.lib
|
||||
rm -rf $BUILD/lib/x64
|
||||
add_comp libvpx
|
||||
}
|
||||
|
||||
function build_libfdkaac {
|
||||
echo "################################################################################"
|
||||
echo "## LIBFDK_AAC ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/fdk-aac
|
||||
build fdk-aac "--disable-static --disable-shared"
|
||||
add_comp libfdk-aac
|
||||
cd $repos/ffmpeg
|
||||
patch -N -p1 -i ../../patches/0003-dynamic-loading-of-shared-fdk-aac-library-5.0.patch
|
||||
}
|
||||
|
||||
function build_lame {
|
||||
echo "################################################################################"
|
||||
echo "## LIBLAME ##"
|
||||
echo "################################################################################"
|
||||
svn co svn://svn.code.sf.net/p/lame/svn/trunk/lame@6474 $repos/lame
|
||||
cd $repos/lame
|
||||
build lame "--enable-nasm --disable-frontend --disable-shared --enable-static"
|
||||
add_comp libmp3lame
|
||||
}
|
||||
|
||||
function build_zimg {
|
||||
echo "################################################################################"
|
||||
echo "## ZIMG ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/zimg
|
||||
./autogen.sh
|
||||
./configure --prefix=$BUILD
|
||||
cd _msvc/zimg
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" /property:ConfigurationType=StaticLibrary /property:WindowsTargetPlatformVersion=10.0.17134.0 /property:PlatformToolset=v141 /property:Platform=x64 /property:WholeProgramOptimization=false zimg.vcxproj
|
||||
cp x64/$MSBUILD_CONFIG/z.lib $BUILD/lib/zimg.lib
|
||||
cd ../..
|
||||
cp $repos/zimg/src/zimg/api/zimg.h $BUILD/include/zimg.h
|
||||
cp zimg.pc $BUILD/lib/pkgconfig/zimg.pc
|
||||
add_comp libzimg
|
||||
}
|
||||
|
||||
function build_x264 {
|
||||
echo "################################################################################"
|
||||
echo "## LIBX264 ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/x264
|
||||
sed -i 's/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g' ../ffmpeg/libavcodec/libx264.c
|
||||
#git checkout b5bc5d69c580429ff716bafcd43655e855c31b02
|
||||
#f9af2a0f71d0fca7c1cafa7657f03a302da0ca1c
|
||||
CC=cl ./configure --prefix=$BUILD --disable-cli --enable-static --enable-pic --libdir=$BUILD/lib
|
||||
make -j $NUMBER_OF_PROCESSORS
|
||||
make install-lib-static
|
||||
add_comp libx264
|
||||
}
|
||||
|
||||
function build_opus {
|
||||
echo "################################################################################"
|
||||
echo "## LIBOPUS ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/opus/win32/VS2015
|
||||
echo \nConverting project file ...
|
||||
sed -i 's/v140/v141/g' opus.vcxproj
|
||||
echo Building project 'opus' ...
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" /property:Platform=x64 opus.vcxproj
|
||||
echo Done.
|
||||
cp x64/$MSBUILD_CONFIG/opus.lib $BUILD/lib/opus.lib
|
||||
cp -r $repos/opus/include $BUILD/include/opus
|
||||
cp $repos/opus/opus.pc.in $BUILD/lib/pkgconfig/opus.pc
|
||||
sed -i "s#@prefix@#$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
|
||||
add_comp libopus
|
||||
}
|
||||
|
||||
function build_x265 {
|
||||
echo "################################################################################"
|
||||
echo "## LIBX265 ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/x265/build/vc15-x86_64
|
||||
rm -rf work*
|
||||
mkdir work work10 work12
|
||||
# 12bit
|
||||
cd work12
|
||||
echo "## 12 BIT"
|
||||
cmake -G "Visual Studio 15 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" x265-static.vcxproj
|
||||
cp $MSBUILD_CONFIG/x265-static.lib ../work/x265_12bit.lib
|
||||
# 10bit
|
||||
echo "## 10 BIT"
|
||||
cd ../work10
|
||||
cmake -G "Visual Studio 15 Win64" ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" x265-static.vcxproj
|
||||
cp $MSBUILD_CONFIG/x265-static.lib ../work/x265_10bit.lib
|
||||
# 8bit - main
|
||||
echo "## 8 BIT"
|
||||
cd ../work
|
||||
cmake -G "Visual Studio 15 Win64" ../../../source -DCMAKE_INSTALL_PREFIX=$BUILD -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DEXTRA_LIB="x265_10bit.lib;x265_12bit.lib" -DLINKED_10BIT=ON -DLINKED_12BIT=ON
|
||||
#-DSTATIC_LINK_CRT=ON
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" x265-static.vcxproj
|
||||
cp $MSBUILD_CONFIG/x265-static.lib ./x265_main.lib
|
||||
LIB.EXE /ignore:4006 /ignore:4221 /OUT:x265.lib x265_main.lib x265_10bit.lib x265_12bit.lib
|
||||
cp x265.lib $BUILD/lib/x265.lib
|
||||
cp x265.pc $BUILD/lib/pkgconfig/x265.pc
|
||||
cp x265_config.h $BUILD/include/
|
||||
cp ../../../source/x265.h $BUILD/include/
|
||||
add_comp libx265
|
||||
}
|
||||
|
||||
export -f build_nvenc && export -f build_amf && export -f build_mfx && export -f build_svt && export -f build_ogg && export -f build_vorbis && export -f build_snappy && export -f build_libvpx && export -f build_libfdkaac && export -f build_lame && export -f build_zimg && export -f build_x264 && export -f build_x265
|
||||
|
||||
function add_comp {
|
||||
COMPONENTS="$COMPONENTS --enable-$1"
|
||||
}
|
||||
|
||||
rm -rf src build
|
||||
mkdir src build build/include build/lib build/lib/pkgconfig
|
||||
|
||||
BUILD=`realpath build`
|
||||
SRC=`realpath src`
|
||||
repos=$(realpath repos)
|
||||
|
||||
parallel -j3 ::: build_nvenc build_amf build_svt build_ogg
|
||||
|
||||
#build_nvenc
|
||||
#build_amf
|
||||
#build_mfx
|
||||
#build_svt
|
||||
#build_ogg
|
||||
#build_opus
|
||||
#build_vorbis
|
||||
#build_snappy
|
||||
#build_libvpx
|
||||
#build_libfdkaac
|
||||
#build_lame
|
||||
#build_zimg
|
||||
#build_x264
|
||||
#build_x265
|
||||
|
||||
echo "################################################################################"
|
||||
echo "## FFMPEG ##"
|
||||
echo "################################################################################"
|
||||
cd $repos/ffmpeg
|
||||
PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --toolchain=msvc --extra-cflags="$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 $COMPONENTS
|
||||
sed -i 's/\x81/ue/g' config.h
|
||||
make -j $NUMBER_OF_PROCESSORS
|
||||
make install
|
||||
cd -
|
||||
|
||||
# rename *.a to *.lib
|
||||
cd $BUILD/lib
|
||||
for file in *.a; do
|
||||
mv "$file" "`basename "$file" .a`.lib"
|
||||
done
|
||||
|
||||
# clean up
|
||||
rm -rf $BUILD/lib/fdk-aac.lib $BUILD/lib/*.la
|
||||
|
||||
# Create archives
|
||||
cd - ; cd $BUILD
|
||||
mkdir ../dist 2>/dev/null
|
||||
tar czf ../dist/ffmpeg-win64-static-$MODE.tar.gz *
|
||||
cd - ; cd repos/ffmpeg
|
||||
tar czf ../../dist/ffmpeg-win64-static-src-$MODE.tar.gz *
|
||||
|
220
build2.sh
220
build2.sh
@ -1,220 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
COMPONENTS=""
|
||||
|
||||
if [ "$MODE" == "debug" ]; then
|
||||
MSBUILD_CONFIG=Debug
|
||||
CFLAGS=-MDd
|
||||
elif [ "$MODE" == "release" ]; then
|
||||
MSBUILD_CONFIG=Release
|
||||
CFLAGS=-MD
|
||||
else
|
||||
echo "Please supply build mode [debug|release]!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function build {
|
||||
cd $SRC/$1
|
||||
if [ -f autogen.sh ]; then
|
||||
./autogen.sh
|
||||
fi
|
||||
CC=cl CXXFLAGS=$CFLAGS ./configure --prefix=$BUILD $2
|
||||
make -j $NUMBER_OF_PROCESSORS
|
||||
make install
|
||||
}
|
||||
|
||||
function build_nvenc {
|
||||
git clone -q -b sdk/11.0 https://github.com/FFmpeg/nv-codec-headers.git $SRC/ffnvcodec
|
||||
cd $SRC/ffnvcodec
|
||||
make PREFIX=$BUILD install
|
||||
add_comp nvenc
|
||||
}
|
||||
|
||||
function build_amf {
|
||||
git clone -q https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git $SRC/amf
|
||||
cp -a $SRC/amf/amf/public/include $BUILD/include/AMF
|
||||
add_comp amf
|
||||
}
|
||||
|
||||
function build_mfx {
|
||||
cp -r "C:\Program Files (x86)\IntelSWTools\Intel(R) Media SDK 2021 R1\Software Development Kit\include" $BUILD/include/mfx
|
||||
cp "C:\Program Files (x86)\IntelSWTools\Intel(R) Media SDK 2021 R1\Software Development Kit\lib\x64\libmfx_vs2015.lib" $BUILD/lib/libmfx.lib
|
||||
printf "prefix=$BUILD\nexec_prefix=\${prefix}\nincludedir=\${prefix}/include\nlibdir=\${exec_prefix}/lib\nName: libmfx\nDescription: Intel Media SDK Dispatched static library\nVersion: 1.34\nLibs: -L\${libdir} -llibmfx -ladvapi32 -lole32 -luuid\nCflags: -I\${includedir}\n" > $BUILD/lib/pkgconfig/libmfx.pc
|
||||
|
||||
#git clone -q https://github.com/lu-zero/mfx_dispatch.git $SRC/libmfx
|
||||
#cd $SRC/libmfx
|
||||
#if [[ ! -f "configure" ]]; then
|
||||
# autoreconf -fiv || exit 1
|
||||
#fi
|
||||
#build libmfx
|
||||
#sed -i 's/-lstdc++/-ladvapi32/g' $BUILD/lib/pkgconfig/libmfx.pc
|
||||
|
||||
add_comp libmfx
|
||||
}
|
||||
|
||||
function build_aom {
|
||||
git clone -q -b v3.1.2 https://aomedia.googlesource.com/aom $SRC/libaom
|
||||
cd $SRC/libaom
|
||||
rm -rf work
|
||||
mkdir work
|
||||
cd work
|
||||
cmake -G "Visual Studio 15 2017" .. -T host=x64 -A x64 -DCONFIG_AV1_DECODER=0 -DENABLE_{DOCS,TOOLS,TESTS,EXAMPLES}=OFF -DCMAKE_INSTALL_PREFIX=$BUILD
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" AOM.sln
|
||||
cp $MSBUILD_CONFIG/aom.lib $BUILD/lib/aom.lib
|
||||
cp -r ../aom $BUILD/include/aom
|
||||
printf "prefix=$BUILD\nexec_prefix=\${prefix}\nincludedir=\${prefix}/include\nlibdir=\${exec_prefix}/lib\nName: aom\nDescription: Alliance for Open Media AV1 codec library v3.1.2\nVersion: 3.1.2\nRequires:\nConflicts:\nLibs: -L\${libdir} -laom\nCflags: -I\${includedir}\n" > $BUILD/lib/pkgconfig/aom.pc
|
||||
#cmake -DAOM_CONFIG_DIR=. -DAOM_ROOT=.. -DCMAKE_INSTALL_PREFIX=@prefix@ -DCMAKE_PROJECT_NAME=aom -DCONFIG_MULTITHREAD=true -DHAVE_PTHREAD_H=false -P "../build/cmake/pkg_config.cmake"
|
||||
#sed -i "s#@prefix@#$BUILD#g" aom.pc
|
||||
#sed -i '/^Libs\.private.*/d' aom.pc
|
||||
#sed -i 's/-lm//' aom.pc
|
||||
#cp aom.pc $BUILD/lib/pkgconfig/aom.pc
|
||||
add_comp libaom
|
||||
}
|
||||
|
||||
function build_svt {
|
||||
# HEVC
|
||||
#git clone -q https://github.com/OpenVisualCloud/SVT-HEVC.git $SRC/svt-hevc
|
||||
#cd $SRC/svt-hevc/Build/windows
|
||||
#cmake .. -G"Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=$BUILD -DCMAKE_CONFIGURATION_TYPES=$MSBUILD_CONFIG
|
||||
#MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration=$MSBUILD_CONFIG /property:ConfigurationType=StaticLibrary /property:TargetExt=.lib svt-hevc.sln
|
||||
#cp -r ../Source/API $BUILD/include/svt-hevc ; cp ../Bin/$MSBUILD_CONFIG/SvtHevcEnc.lib $BUILD/lib/ ; cp SvtHevcEnc.pc $BUILD/lib/pkgconfig/
|
||||
#add_comp libsvthevc
|
||||
#
|
||||
# AV1
|
||||
git clone -q --depth 1 https://github.com/AOMediaCodec/SVT-AV1 $SRC/svt-av1
|
||||
cd $SRC/svt-av1/Build/windows
|
||||
./build.bat 2017 $MODE static
|
||||
cp -r ../../Source/API $BUILD/include/svt-av1 ; cp ../../Bin/$MSBUILD_CONFIG/SvtAv1Enc.lib $BUILD/lib/ ; cp SvtAv1Enc.pc $BUILD/lib/pkgconfig/
|
||||
add_comp libsvtav1
|
||||
#
|
||||
# VP9
|
||||
#git clone -q https://github.com/OpenVisualCloud/SVT-VP9.git $SRC/svt-vp9
|
||||
#cd $SRC/svt-vp9/Build/windows
|
||||
#cmake .. -G"Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=$BUILD -DCMAKE_CONFIGURATION_TYPES=$MSBUILD_CONFIG
|
||||
#MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration=$MSBUILD_CONFIG /property:ConfigurationType=StaticLibrary /property:TargetExt=".lib" svt-vp9.sln
|
||||
#cp -r ../Source/API $BUILD/include/svt-vp9 ; cp ../Bin/$MSBUILD_CONFIG/SvtVp9Enc.lib $BUILD/lib/ ; cp SvtVp9Enc.pc $BUILD/lib/pkgconfig/
|
||||
#sed -i 's/ -lpthread//g' $BUILD/lib/pkgconfig/SvtVp9Enc.pc
|
||||
#sed -i 's/ -lm//g' $BUILD/lib/pkgconfig/SvtVp9Enc.pc
|
||||
#add_comp libsvtvp9
|
||||
}
|
||||
|
||||
function build_ogg {
|
||||
git clone -q https://github.com/xiph/ogg.git $SRC/libogg
|
||||
cd $SRC/libogg
|
||||
build libogg "--disable-shared"
|
||||
}
|
||||
|
||||
function build_vorbis {
|
||||
git clone -q https://github.com/xiph/vorbis.git $SRC/libvorbis
|
||||
cd $SRC/libvorbis
|
||||
build libvorbis "--disable-shared"
|
||||
sed -i '/^Libs\.private.*/d' $BUILD/lib/pkgconfig/vorbis.pc # don't need m.lib on windows
|
||||
add_comp libvorbis
|
||||
}
|
||||
|
||||
function build_snappy {
|
||||
git clone -q -b 1.1.8 https://github.com/google/snappy.git $SRC/snappy
|
||||
cd $SRC/snappy
|
||||
rm -rf work
|
||||
mkdir work
|
||||
cd work
|
||||
cmake -G "Visual Studio 15 Win64" .. -DCMAKE_INSTALL_PREFIX=$BUILD -DBUILD_SHARED_LIBS=OFF -DSNAPPY_BUILD_TESTS=OFF
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" Snappy.sln
|
||||
cp $MSBUILD_CONFIG/snappy.lib $BUILD/lib/snappy.lib
|
||||
cp ../snappy.h ../snappy-c.h $BUILD/include/
|
||||
add_comp libsnappy
|
||||
}
|
||||
|
||||
function build_libvpx {
|
||||
git clone -q https://github.com/webmproject/libvpx.git $SRC/libvpx
|
||||
cd $SRC/libvpx
|
||||
./configure --prefix=$BUILD --target=x86_64-win64-vs15 --enable-vp9-highbitdepth --disable-shared --disable-examples --disable-tools --disable-docs --disable-libyuv --disable-unit_tests --disable-postproc
|
||||
make -j $NUMBER_OF_PROCESSORS
|
||||
make install
|
||||
mv $BUILD/lib/x64/vpxmd.lib $BUILD/lib/vpx.lib
|
||||
rm -rf $BUILD/lib/x64
|
||||
add_comp libvpx
|
||||
}
|
||||
|
||||
function build_lame {
|
||||
svn co svn://svn.code.sf.net/p/lame/svn/trunk/lame@6474 $SRC/lame
|
||||
cd $SRC/lame
|
||||
build lame "--enable-nasm --disable-frontend --disable-shared --enable-static"
|
||||
add_comp libmp3lame
|
||||
}
|
||||
|
||||
function build_zimg {
|
||||
git clone -q https://github.com/sekrit-twc/zimg.git $SRC/zimg
|
||||
cd $SRC/zimg
|
||||
git checkout release-2.9.2
|
||||
./autogen.sh
|
||||
./configure --prefix=$BUILD
|
||||
cd _msvc/zimg
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" /property:ConfigurationType=StaticLibrary /property:WindowsTargetPlatformVersion=10.0.17134.0 /property:PlatformToolset=v141 /property:Platform=x64 /property:WholeProgramOptimization=false zimg.vcxproj
|
||||
cp x64/$MSBUILD_CONFIG/z.lib $BUILD/lib/zimg.lib
|
||||
cd ../..
|
||||
cp $SRC/zimg/src/zimg/api/zimg.h $BUILD/include/zimg.h
|
||||
cp zimg.pc $BUILD/lib/pkgconfig/zimg.pc
|
||||
add_comp libzimg
|
||||
}
|
||||
|
||||
function build_opus {
|
||||
git clone -q https://github.com/xiph/opus.git $SRC/opus
|
||||
cd $SRC/opus/win32/VS2015
|
||||
echo \nConverting project file ...
|
||||
sed -i 's/v140/v141/g' opus.vcxproj
|
||||
echo Building project 'opus' ...
|
||||
MSBuild.exe /maxcpucount:$NUMBER_OF_PROCESSORS /property:Configuration="$MSBUILD_CONFIG" /property:Platform=x64 opus.vcxproj
|
||||
echo Done.
|
||||
cp x64/$MSBUILD_CONFIG/opus.lib $BUILD/lib/opus.lib
|
||||
cp -r $SRC/opus/include $BUILD/include/opus
|
||||
cp $SRC/opus/opus.pc.in $BUILD/lib/pkgconfig/opus.pc
|
||||
sed -i "s#@prefix@#$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
|
||||
add_comp libopus
|
||||
}
|
||||
|
||||
function add_comp {
|
||||
COMPONENTS="$COMPONENTS --enable-$1"
|
||||
}
|
||||
|
||||
rm -rf src build
|
||||
mkdir src build build/include build/lib build/lib/pkgconfig
|
||||
|
||||
BUILD=`realpath build`
|
||||
SRC=`realpath src`
|
||||
|
||||
git clone -q -b release/5.0 https://github.com/FFmpeg/FFmpeg.git $SRC/ffmpeg
|
||||
|
||||
#build_aom
|
||||
build_nvenc
|
||||
build_amf
|
||||
build_mfx
|
||||
#build_svt
|
||||
#build_ogg
|
||||
#build_vorbis
|
||||
#build_snappy
|
||||
#build_libvpx
|
||||
#build_lame
|
||||
#build_zimg
|
||||
#build_opus
|
||||
|
||||
cd $SRC/ffmpeg
|
||||
PKG_CONFIG_PATH=$BUILD/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --toolchain=msvc --extra-cflags="$CFLAGS -I$BUILD/include" --extra-ldflags="-LIBPATH:$BUILD/lib" --prefix=$BUILD --enable-shared --disable-static --arch=x86_64 --disable-doc --enable-runtime-cpudetect --enable-w32threads --build-suffix=-voukoderpro $COMPONENTS
|
||||
sed -i 's/\x81/ue/g' config.h
|
||||
make -j$(nproc)
|
||||
make install
|
||||
|
||||
# clean up
|
||||
rm -rf $BUILD/lib/fdk-aac.lib $BUILD/lib/*.la
|
||||
|
||||
# Create archives
|
||||
cd $BUILD
|
||||
mkdir ../dist 2>/dev/null
|
||||
tar czf ../dist/ffmpeg-win64-static-$MODE.tar.gz *
|
||||
cd $SRC/ffmpeg
|
||||
tar czf ../../dist/ffmpeg-win64-static-src-$MODE.tar.gz *
|
20
hotfix.patch
Normal file
20
hotfix.patch
Normal file
@ -0,0 +1,20 @@
|
||||
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);
|
@ -1,550 +0,0 @@
|
||||
diff --git a/configure b/configure
|
||||
index 48e8536..fa6a7f9 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -213,6 +213,7 @@ External library support:
|
||||
--enable-libschroedinger Dirac video encoding/decoding
|
||||
--enable-libsnappy snappy compression
|
||||
--enable-libspeex Speex audio encoding/decoding
|
||||
+ --enable-libsvtav1 enable AV1 encoding via svt [no]
|
||||
--enable-libsrt Haivision SRT protocol
|
||||
--enable-libtheora Theora video encoding/decoding
|
||||
--enable-libtwolame MP2 audio encoding
|
||||
@@ -1376,6 +1377,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
libschroedinger
|
||||
libsnappy
|
||||
libspeex
|
||||
+ libsvtav1
|
||||
libsrt
|
||||
libtheora
|
||||
libtwolame
|
||||
@@ -2404,6 +2406,7 @@ libschroedinger_encoder_deps="libschroedinger"
|
||||
libspeex_decoder_deps="libspeex"
|
||||
libspeex_encoder_deps="libspeex"
|
||||
libspeex_encoder_select="audio_frame_queue"
|
||||
+libsvt_av1_encoder_deps="libsvtav1"
|
||||
libtheora_encoder_deps="libtheora"
|
||||
libtwolame_encoder_deps="libtwolame"
|
||||
libvo_aacenc_encoder_deps="libvo_aacenc"
|
||||
@@ -4692,6 +4695,7 @@ enabled libschroedinger && require_pkg_config libschroedinger schroedinger-1.0
|
||||
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy
|
||||
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
|
||||
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
|
||||
+enabled libsvtav1 && require_pkg_config libsvtav1 SvtAv1Enc EbSvtAv1Enc.h eb_init_handle
|
||||
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
|
||||
enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame
|
||||
enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
|
||||
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
|
||||
index ea0c9dc..7f66c2f 100644
|
||||
--- a/libavcodec/Makefile
|
||||
+++ b/libavcodec/Makefile
|
||||
@@ -718,6 +718,7 @@ OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
|
||||
libschroedinger.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||
+OBJS-$(CONFIG_LIBSVT_AV1_ENCODER) += libsvt_av1.o
|
||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
|
||||
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
|
||||
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
|
||||
index 4aee657..486405a 100644
|
||||
--- a/libavcodec/allcodecs.c
|
||||
+++ b/libavcodec/allcodecs.c
|
||||
@@ -436,6 +436,7 @@ void avcodec_register_all(void)
|
||||
REGISTER_ENCDEC (LIBSCHROEDINGER, libschroedinger);
|
||||
REGISTER_ENCDEC (LIBSPEEX, libspeex);
|
||||
REGISTER_ENCODER(LIBTHEORA, libtheora);
|
||||
+ REGISTER_ENCODER(LIBSVT_AV1, libsvt_av1);
|
||||
REGISTER_ENCODER(LIBTWOLAME, libtwolame);
|
||||
REGISTER_ENCODER(LIBVO_AACENC, libvo_aacenc);
|
||||
REGISTER_ENCODER(LIBVO_AMRWBENC, libvo_amrwbenc);
|
||||
new file mode 100644
|
||||
index 0000000..8f0e5a6
|
||||
--- /dev/null
|
||||
+++ b/libavcodec/libsvt_av1.c
|
||||
@@ -0,0 +1,483 @@
|
||||
+/*
|
||||
+* Scalable Video Technology for AV1 encoder library plugin
|
||||
+*
|
||||
+* Copyright (c) 2018 Intel Corporation
|
||||
+*
|
||||
+* 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 this program; if not, write to the Free Software
|
||||
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+*/
|
||||
+
|
||||
+#include <stdint.h>
|
||||
+#include "EbSvtAv1ErrorCodes.h"
|
||||
+#include "EbSvtAv1Enc.h"
|
||||
+
|
||||
+#include "libavutil/common.h"
|
||||
+#include "libavutil/frame.h"
|
||||
+#include "libavutil/opt.h"
|
||||
+
|
||||
+#include "internal.h"
|
||||
+#include "avcodec.h"
|
||||
+
|
||||
+typedef enum eos_status {
|
||||
+ EOS_NOT_REACHED = 0,
|
||||
+ EOS_SENT,
|
||||
+ EOS_RECEIVED
|
||||
+}EOS_STATUS;
|
||||
+
|
||||
+typedef struct SvtContext {
|
||||
+ AVClass *class;
|
||||
+
|
||||
+ EbSvtAv1EncConfiguration enc_params;
|
||||
+ EbComponentType *svt_handle;
|
||||
+
|
||||
+ EbBufferHeaderType *in_buf;
|
||||
+ int raw_size;
|
||||
+
|
||||
+ EOS_STATUS eos_flag;
|
||||
+
|
||||
+ // User options.
|
||||
+ int hierarchical_level;
|
||||
+ int la_depth;
|
||||
+ int enc_mode;
|
||||
+ int rc_mode;
|
||||
+ int scd;
|
||||
+ int qp;
|
||||
+
|
||||
+ int forced_idr;
|
||||
+
|
||||
+ int aud;
|
||||
+
|
||||
+ int tier;
|
||||
+ int level;
|
||||
+
|
||||
+ int base_layer_switch_mode;
|
||||
+} SvtContext;
|
||||
+
|
||||
+static int error_mapping(EbErrorType svt_ret)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
+ switch (svt_ret) {
|
||||
+ case EB_ErrorInsufficientResources:
|
||||
+ err = AVERROR(ENOMEM);
|
||||
+ break;
|
||||
+
|
||||
+ case EB_ErrorUndefined:
|
||||
+ case EB_ErrorInvalidComponent:
|
||||
+ case EB_ErrorBadParameter:
|
||||
+ err = AVERROR(EINVAL);
|
||||
+ break;
|
||||
+
|
||||
+ case EB_ErrorDestroyThreadFailed:
|
||||
+ case EB_ErrorSemaphoreUnresponsive:
|
||||
+ case EB_ErrorDestroySemaphoreFailed:
|
||||
+ case EB_ErrorCreateMutexFailed:
|
||||
+ case EB_ErrorMutexUnresponsive:
|
||||
+ case EB_ErrorDestroyMutexFailed:
|
||||
+ err = AVERROR_EXTERNAL;
|
||||
+ break;
|
||||
+
|
||||
+ case EB_NoErrorEmptyQueue:
|
||||
+ err = AVERROR(EAGAIN);
|
||||
+
|
||||
+ case EB_ErrorNone:
|
||||
+ err = 0;
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ err = AVERROR_UNKNOWN;
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static void free_buffer(SvtContext *svt_enc)
|
||||
+{
|
||||
+ if (svt_enc->in_buf) {
|
||||
+ EbSvtIOFormat *in_data = (EbSvtIOFormat *)svt_enc->in_buf->p_buffer;
|
||||
+ av_freep(&in_data);
|
||||
+ av_freep(&svt_enc->in_buf);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc)
|
||||
+{
|
||||
+ const int pack_mode_10bit =
|
||||
+ (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0;
|
||||
+ const size_t luma_size_8bit =
|
||||
+ config->source_width * config->source_height * (1 << pack_mode_10bit);
|
||||
+ const size_t luma_size_10bit =
|
||||
+ (config->encoder_bit_depth > 8 && pack_mode_10bit == 0) ? luma_size_8bit : 0;
|
||||
+
|
||||
+ EbSvtIOFormat *in_data;
|
||||
+
|
||||
+ svt_enc->raw_size = (luma_size_8bit + luma_size_10bit) * 3 / 2;
|
||||
+
|
||||
+ // allocate buffer for in and out
|
||||
+ svt_enc->in_buf = av_mallocz(sizeof(*svt_enc->in_buf));
|
||||
+ if (!svt_enc->in_buf)
|
||||
+ goto failed;
|
||||
+
|
||||
+ in_data = av_mallocz(sizeof(*in_data));
|
||||
+ if (!in_data)
|
||||
+ goto failed;
|
||||
+ svt_enc->in_buf->p_buffer = (unsigned char *)in_data;
|
||||
+
|
||||
+ svt_enc->in_buf->size = sizeof(*svt_enc->in_buf);
|
||||
+ svt_enc->in_buf->p_app_private = NULL;
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+failed:
|
||||
+ free_buffer(svt_enc);
|
||||
+ return AVERROR(ENOMEM);
|
||||
+}
|
||||
+
|
||||
+static int config_enc_params(EbSvtAv1EncConfiguration *param,
|
||||
+ AVCodecContext *avctx)
|
||||
+{
|
||||
+ SvtContext *svt_enc = avctx->priv_data;
|
||||
+ int ret;
|
||||
+
|
||||
+ param->source_width = avctx->width;
|
||||
+ param->source_height = avctx->height;
|
||||
+
|
||||
+ if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10) {
|
||||
+ av_log(avctx, AV_LOG_DEBUG, "Set 10 bits depth input\n");
|
||||
+ param->encoder_bit_depth = 10;
|
||||
+ } else {
|
||||
+ av_log(avctx, AV_LOG_DEBUG, "Set 8 bits depth input\n");
|
||||
+ param->encoder_bit_depth = 8;
|
||||
+ }
|
||||
+
|
||||
+ param->encoder_color_format = EB_YUV420;
|
||||
+
|
||||
+ // Update param from options
|
||||
+ param->hierarchical_levels = svt_enc->hierarchical_level;
|
||||
+ param->enc_mode = svt_enc->enc_mode;
|
||||
+ param->tier = svt_enc->tier;
|
||||
+ param->level = svt_enc->level;
|
||||
+ param->rate_control_mode = svt_enc->rc_mode;
|
||||
+ param->scene_change_detection = svt_enc->scd;
|
||||
+ param->base_layer_switch_mode = svt_enc->base_layer_switch_mode;
|
||||
+ param->qp = svt_enc->qp;
|
||||
+
|
||||
+
|
||||
+ param->target_bit_rate = avctx->bit_rate;
|
||||
+ if (avctx->gop_size > 0)
|
||||
+ param->intra_period_length = avctx->gop_size - 1;
|
||||
+
|
||||
+ if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
|
||||
+ param->frame_rate_numerator = avctx->framerate.num;
|
||||
+ param->frame_rate_denominator = avctx->framerate.den * avctx->ticks_per_frame;
|
||||
+ } else {
|
||||
+ param->frame_rate_numerator = avctx->time_base.den;
|
||||
+ param->frame_rate_denominator = avctx->time_base.num * avctx->ticks_per_frame;
|
||||
+ }
|
||||
+
|
||||
+ if (param->rate_control_mode) {
|
||||
+ param->max_qp_allowed = avctx->qmax;
|
||||
+ param->min_qp_allowed = avctx->qmin;
|
||||
+ }
|
||||
+
|
||||
+ param->intra_refresh_type = svt_enc->forced_idr + 1;
|
||||
+
|
||||
+ if (svt_enc->la_depth != -1)
|
||||
+ param->look_ahead_distance = svt_enc->la_depth;
|
||||
+
|
||||
+ ret = alloc_buffer(param, svt_enc);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void read_in_data(EbSvtAv1EncConfiguration *config,
|
||||
+ const AVFrame *frame,
|
||||
+ EbBufferHeaderType *headerPtr)
|
||||
+{
|
||||
+ uint8_t is16bit = config->encoder_bit_depth > 8;
|
||||
+ uint64_t luma_size =
|
||||
+ (uint64_t)config->source_width * config->source_height<< is16bit;
|
||||
+ EbSvtIOFormat *in_data = (EbSvtIOFormat *)headerPtr->p_buffer;
|
||||
+
|
||||
+ // support yuv420p and yuv420p010
|
||||
+ in_data->luma = frame->data[0];
|
||||
+ in_data->cb = frame->data[1];
|
||||
+ in_data->cr = frame->data[2];
|
||||
+
|
||||
+ // stride info
|
||||
+ in_data->y_stride = frame->linesize[0] >> is16bit;
|
||||
+ in_data->cb_stride = frame->linesize[1] >> is16bit;
|
||||
+ in_data->cr_stride = frame->linesize[2] >> is16bit;
|
||||
+
|
||||
+ headerPtr->n_filled_len += luma_size * 3/2u;
|
||||
+}
|
||||
+
|
||||
+static av_cold int eb_enc_init(AVCodecContext *avctx)
|
||||
+{
|
||||
+ SvtContext *svt_enc = avctx->priv_data;
|
||||
+ EbErrorType svt_ret;
|
||||
+
|
||||
+ svt_enc->eos_flag = EOS_NOT_REACHED;
|
||||
+
|
||||
+ svt_ret = eb_init_handle(&svt_enc->svt_handle, svt_enc, &svt_enc->enc_params);
|
||||
+ if (svt_ret != EB_ErrorNone) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Error init encoder handle\n");
|
||||
+ goto failed;
|
||||
+ }
|
||||
+
|
||||
+ svt_ret = config_enc_params(&svt_enc->enc_params, avctx);
|
||||
+ if (svt_ret != EB_ErrorNone) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Error configure encoder parameters\n");
|
||||
+ goto failed_init_handle;
|
||||
+ }
|
||||
+
|
||||
+ svt_ret = eb_svt_enc_set_parameter(svt_enc->svt_handle, &svt_enc->enc_params);
|
||||
+ if (svt_ret != EB_ErrorNone) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Error setting encoder parameters\n");
|
||||
+ goto failed_init_handle;
|
||||
+ }
|
||||
+
|
||||
+ svt_ret = eb_init_encoder(svt_enc->svt_handle);
|
||||
+ if (svt_ret != EB_ErrorNone) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Error init encoder\n");
|
||||
+ goto failed_init_handle;
|
||||
+ }
|
||||
+
|
||||
+ if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
|
||||
+ EbBufferHeaderType *headerPtr = NULL;
|
||||
+
|
||||
+ svt_ret = eb_svt_enc_stream_header(svt_enc->svt_handle, &headerPtr);
|
||||
+ if (svt_ret != EB_ErrorNone) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Error when build stream header.\n");
|
||||
+ goto failed_init_enc;
|
||||
+ }
|
||||
+
|
||||
+ avctx->extradata_size = headerPtr->n_filled_len;
|
||||
+ avctx->extradata = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
+ if (!avctx->extradata) {
|
||||
+ av_log(avctx, AV_LOG_ERROR,
|
||||
+ "Cannot allocate AV1 header of size %d.\n", avctx->extradata_size);
|
||||
+ svt_ret = EB_ErrorInsufficientResources;
|
||||
+ goto failed_init_enc;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(avctx->extradata, headerPtr->p_buffer, avctx->extradata_size);
|
||||
+
|
||||
+ svt_ret = eb_svt_release_enc_stream_header(headerPtr);
|
||||
+ if (svt_ret != EB_ErrorNone) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Error when destroy stream header.\n");
|
||||
+ goto failed_init_enc;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+failed_init_enc:
|
||||
+ eb_deinit_encoder(svt_enc->svt_handle);
|
||||
+failed_init_handle:
|
||||
+ eb_deinit_handle(svt_enc->svt_handle);
|
||||
+failed:
|
||||
+ free_buffer(svt_enc);
|
||||
+ return error_mapping(svt_ret);
|
||||
+}
|
||||
+
|
||||
+static int eb_send_frame(AVCodecContext *avctx, const AVFrame *frame)
|
||||
+{
|
||||
+ SvtContext *svt_enc = avctx->priv_data;
|
||||
+ EbBufferHeaderType *headerPtr = svt_enc->in_buf;
|
||||
+
|
||||
+ if (!frame) {
|
||||
+ EbBufferHeaderType headerPtrLast;
|
||||
+ headerPtrLast.n_alloc_len = 0;
|
||||
+ headerPtrLast.n_filled_len = 0;
|
||||
+ headerPtrLast.n_tick_count = 0;
|
||||
+ headerPtrLast.p_app_private = NULL;
|
||||
+ headerPtrLast.p_buffer = NULL;
|
||||
+ headerPtrLast.flags = EB_BUFFERFLAG_EOS;
|
||||
+
|
||||
+ eb_svt_enc_send_picture(svt_enc->svt_handle, &headerPtrLast);
|
||||
+ svt_enc->eos_flag = EOS_SENT;
|
||||
+ av_log(avctx, AV_LOG_DEBUG, "Finish sending frames!!!\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ read_in_data(&svt_enc->enc_params, frame, headerPtr);
|
||||
+
|
||||
+ headerPtr->flags = 0;
|
||||
+ headerPtr->p_app_private = NULL;
|
||||
+ headerPtr->pts = frame->pts;
|
||||
+
|
||||
+ eb_svt_enc_send_picture(svt_enc->svt_handle, headerPtr);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int eb_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
|
||||
+{
|
||||
+ SvtContext *svt_enc = avctx->priv_data;
|
||||
+ EbBufferHeaderType *headerPtr;
|
||||
+ EbErrorType svt_ret;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (svt_enc->eos_flag == EOS_RECEIVED)
|
||||
+ return AVERROR_EOF;
|
||||
+
|
||||
+ if ((ret = ff_alloc_packet2(avctx, pkt, svt_enc->raw_size, 0)) < 0) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Failed to allocate output packet.\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ svt_ret = eb_svt_get_packet(svt_enc->svt_handle, &headerPtr, svt_enc->eos_flag);
|
||||
+ if (svt_ret == EB_NoErrorEmptyQueue)
|
||||
+ return AVERROR(EAGAIN);
|
||||
+
|
||||
+ memcpy(pkt->data, headerPtr->p_buffer, headerPtr->n_filled_len);
|
||||
+ pkt->size = headerPtr->n_filled_len;
|
||||
+ pkt->pts = headerPtr->pts;
|
||||
+ pkt->dts = headerPtr->dts;
|
||||
+ if (headerPtr->pic_type == EB_AV1_KEY_PICTURE)
|
||||
+ pkt->flags |= AV_PKT_FLAG_KEY;
|
||||
+ if (headerPtr->pic_type == EB_AV1_NON_REF_PICTURE)
|
||||
+ pkt->flags |= AV_PKT_FLAG_DISPOSABLE;
|
||||
+
|
||||
+ if (headerPtr->flags & EB_BUFFERFLAG_EOS)
|
||||
+ svt_enc->eos_flag = EOS_RECEIVED;
|
||||
+
|
||||
+ eb_svt_release_out_buffer(&headerPtr);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static av_cold int eb_enc_close(AVCodecContext *avctx)
|
||||
+{
|
||||
+ SvtContext *svt_enc = avctx->priv_data;
|
||||
+
|
||||
+ eb_deinit_encoder(svt_enc->svt_handle);
|
||||
+ eb_deinit_handle(svt_enc->svt_handle);
|
||||
+
|
||||
+ free_buffer(svt_enc);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#define OFFSET(x) offsetof(SvtContext, x)
|
||||
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
||||
+static const AVOption options[] = {
|
||||
+ { "aud", "Include AUD", OFFSET(aud),
|
||||
+ AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||
+
|
||||
+ { "hielevel", "Hierarchical prediction levels setting", OFFSET(hierarchical_level),
|
||||
+ AV_OPT_TYPE_INT, { .i64 = 4 }, 3, 4, VE , "hielevel"},
|
||||
+ { "flat", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "hielevel" },
|
||||
+ { "2level", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "hielevel" },
|
||||
+ { "3level", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, INT_MIN, INT_MAX, VE, "hielevel" },
|
||||
+ { "4level", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 4 }, INT_MIN, INT_MAX, VE, "hielevel" },
|
||||
+
|
||||
+ { "la_depth", "Look ahead distance [0, 256]", OFFSET(la_depth),
|
||||
+ AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 256, VE },
|
||||
+
|
||||
+ { "preset", "Encoding preset [0, 7]",
|
||||
+ OFFSET(enc_mode), AV_OPT_TYPE_INT, { .i64 = MAX_ENC_PRESET }, 0, MAX_ENC_PRESET, VE },
|
||||
+
|
||||
+ { "tier", "Set tier (general_tier_flag)", OFFSET(tier),
|
||||
+ AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "tier" },
|
||||
+ { "main", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, VE, "tier" },
|
||||
+ { "high", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "tier" },
|
||||
+
|
||||
+ { "level", "Set level (level_idc)", OFFSET(level),
|
||||
+ AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 0x1f, VE, "level" },
|
||||
+
|
||||
+#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
|
||||
+ { .i64 = value }, 0, 0, VE, "level"
|
||||
+ { LEVEL("2.0", 20) },
|
||||
+ { LEVEL("2.1", 21) },
|
||||
+ { LEVEL("2.2", 22) },
|
||||
+ { LEVEL("2.3", 23) },
|
||||
+ { LEVEL("3.0", 30) },
|
||||
+ { LEVEL("3.1", 31) },
|
||||
+ { LEVEL("3.2", 32) },
|
||||
+ { LEVEL("3.3", 33) },
|
||||
+ { LEVEL("4.0", 40) },
|
||||
+ { LEVEL("4.1", 41) },
|
||||
+ { LEVEL("4.2", 42) },
|
||||
+ { LEVEL("4.3", 43) },
|
||||
+ { LEVEL("5.0", 50) },
|
||||
+ { LEVEL("5.1", 51) },
|
||||
+ { LEVEL("5.2", 52) },
|
||||
+ { LEVEL("5.3", 53) },
|
||||
+ { LEVEL("6.0", 60) },
|
||||
+ { LEVEL("6.1", 61) },
|
||||
+ { LEVEL("6.2", 62) },
|
||||
+ { LEVEL("6.3", 63) },
|
||||
+ { LEVEL("7.0", 70) },
|
||||
+ { LEVEL("7.1", 71) },
|
||||
+ { LEVEL("7.2", 72) },
|
||||
+ { LEVEL("7.3", 73) },
|
||||
+#undef LEVEL
|
||||
+
|
||||
+ { "rc", "Bit rate control mode", OFFSET(rc_mode),
|
||||
+ AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE , "rc"},
|
||||
+ { "cqp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "rc" },
|
||||
+ { "vbr", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "rc" },
|
||||
+
|
||||
+ { "qp", "QP value for intra frames", OFFSET(qp),
|
||||
+ AV_OPT_TYPE_INT, { .i64 = 50 }, 0, 63, VE },
|
||||
+
|
||||
+ { "sc_detection", "Scene change detection", OFFSET(scd),
|
||||
+ AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||
+
|
||||
+ { "bl_mode", "Random Access Prediction Structure type setting", OFFSET(base_layer_switch_mode),
|
||||
+ 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 }, 0, 1, VE },
|
||||
+
|
||||
+ {NULL},
|
||||
+};
|
||||
+
|
||||
+static const AVClass class = {
|
||||
+ .class_name = "libsvt_av1",
|
||||
+ .item_name = av_default_item_name,
|
||||
+ .option = options,
|
||||
+ .version = LIBAVUTIL_VERSION_INT,
|
||||
+};
|
||||
+
|
||||
+static const AVCodecDefault eb_enc_defaults[] = {
|
||||
+ { "b", "7M" },
|
||||
+ { "g", "-2" },
|
||||
+ { "qmin", "0" },
|
||||
+ { "qmax", "63" },
|
||||
+ { NULL },
|
||||
+};
|
||||
+
|
||||
+AVCodec ff_libsvt_av1_encoder = {
|
||||
+ .name = "libsvt_av1",
|
||||
+ .long_name = NULL_IF_CONFIG_SMALL("SVT-AV1(Scalable Video Technology for AV1) encoder"),
|
||||
+ .priv_data_size = sizeof(SvtContext),
|
||||
+ .type = AVMEDIA_TYPE_VIDEO,
|
||||
+ .id = AV_CODEC_ID_AV1,
|
||||
+ .init = eb_enc_init,
|
||||
+ .send_frame = eb_send_frame,
|
||||
+ .receive_packet = eb_receive_packet,
|
||||
+ .close = eb_enc_close,
|
||||
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
|
||||
+ .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
|
||||
+ AV_PIX_FMT_YUV420P10,
|
||||
+ AV_PIX_FMT_NONE },
|
||||
+ .priv_class = &class,
|
||||
+ .defaults = eb_enc_defaults,
|
||||
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||
+ .wrapper_name = "libsvt_av1",
|
||||
+};
|
||||
--
|
||||
1.8.3.1
|
@ -1,264 +0,0 @@
|
||||
From de345e50f1b2d8b79c72db747c66a6bdcc646914 Mon Sep 17 00:00:00 2001
|
||||
From: Gianluigi Tiesi <sherpya@netfarm.it>
|
||||
Date: Sun, 4 Dec 2016 01:28:51 +0100
|
||||
Subject: [PATCH 3/8] dynamic loading of shared fdk-aac library
|
||||
|
||||
---
|
||||
configure | 6 +--
|
||||
libavcodec/libfdk-aac_internal.h | 84 ++++++++++++++++++++++++++++++++
|
||||
libavcodec/libfdk-aacdec.c | 32 ++++++++++--
|
||||
libavcodec/libfdk-aacenc.c | 25 +++++++++-
|
||||
4 files changed, 138 insertions(+), 9 deletions(-)
|
||||
create mode 100644 libavcodec/libfdk-aac_internal.h
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 69fc11fcba..d381419123 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1726,7 +1726,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
|
||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||
decklink
|
||||
- libfdk_aac
|
||||
openssl
|
||||
libtls
|
||||
"
|
||||
@@ -1816,6 +1815,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
opengl
|
||||
pocketsphinx
|
||||
vapoursynth
|
||||
+ libfdk_aac
|
||||
"
|
||||
|
||||
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
||||
@@ -6246,9 +6246,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.4.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..cd1e6e3340
|
||||
--- /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 */
|
||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||
index 1abe1d8438..ef7728c368 100644
|
||||
--- a/libavcodec/libfdk-aacdec.c
|
||||
+++ b/libavcodec/libfdk-aacdec.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACDECODER_LIB_VL0
|
||||
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -47,6 +48,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;
|
||||
@@ -99,7 +102,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;
|
||||
@@ -211,8 +214,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);
|
||||
|
||||
@@ -224,6 +229,27 @@ 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 5620bb5951..c4519b6b74 100644
|
||||
--- a/libavcodec/libfdk-aacenc.c
|
||||
+++ b/libavcodec/libfdk-aacenc.c
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "audio_frame_queue.h"
|
||||
#include "internal.h"
|
||||
|
||||
+#include "libfdk-aac_internal.h"
|
||||
+
|
||||
#ifdef AACENCODER_LIB_VL0
|
||||
#define FDKENC_VER_AT_LEAST(vl0, vl1) \
|
||||
((AACENCODER_LIB_VL0 > vl0) || \
|
||||
@@ -45,6 +47,8 @@ typedef struct AACContext {
|
||||
int header_period;
|
||||
int vbr;
|
||||
|
||||
+ void *hLib;
|
||||
+ aacEncLib pfn;
|
||||
AudioFrameQueue afq;
|
||||
} AACContext;
|
||||
|
||||
@@ -108,8 +112,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);
|
||||
+ }
|
||||
av_freep(&avctx->extradata);
|
||||
ff_af_queue_close(&s->afq);
|
||||
|
||||
@@ -126,6 +132,21 @@ 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->channels)) != AACENC_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||
aac_get_error(err));
|
||||
--
|
||||
2.24.0
|
@ -1,249 +0,0 @@
|
||||
diff --git a/configure b/configure
|
||||
index 82367fd30d..a67cb46861 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1762,7 +1762,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
|
||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||
decklink
|
||||
- libfdk_aac
|
||||
openssl
|
||||
libtls
|
||||
"
|
||||
@@ -1857,6 +1856,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
opengl
|
||||
pocketsphinx
|
||||
vapoursynth
|
||||
+ libfdk_aac
|
||||
"
|
||||
|
||||
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
||||
@@ -6386,9 +6386,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..cd1e6e3340
|
||||
--- /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 */
|
||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||
index ffa1fdcce3..b3ee1248ed 100644
|
||||
--- a/libavcodec/libfdk-aacdec.c
|
||||
+++ b/libavcodec/libfdk-aacdec.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACDECODER_LIB_VL0
|
||||
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -47,6 +48,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;
|
||||
@@ -101,7 +104,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;
|
||||
@@ -216,8 +219,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);
|
||||
|
||||
@@ -229,6 +234,27 @@ 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 a7144e95dd..cfbfdea417 100644
|
||||
--- a/libavcodec/libfdk-aacenc.c
|
||||
+++ b/libavcodec/libfdk-aacenc.c
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "internal.h"
|
||||
#include "profiles.h"
|
||||
|
||||
+#include "libfdk-aac_internal.h"
|
||||
+
|
||||
#ifdef AACENCODER_LIB_VL0
|
||||
#define FDKENC_VER_AT_LEAST(vl0, vl1) \
|
||||
((AACENCODER_LIB_VL0 > vl0) || \
|
||||
@@ -46,6 +48,8 @@ typedef struct AACContext {
|
||||
int header_period;
|
||||
int vbr;
|
||||
|
||||
+ void *hLib;
|
||||
+ aacEncLib pfn;
|
||||
AudioFrameQueue afq;
|
||||
} AACContext;
|
||||
|
||||
@@ -110,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;
|
||||
@@ -127,6 +133,21 @@ 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->channels)) != AACENC_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||
aac_get_error(err));
|
Reference in New Issue
Block a user