-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
180 lines (169 loc) · 6.38 KB
/
Dockerfile
File metadata and controls
180 lines (169 loc) · 6.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
FROM ubuntu:22.04
ENV SHELL="/bin/bash"
RUN sed -Ei 's/http:\/\/[archive|security]+.ubuntu.com/http:\/\/mirror.docker.ru/gm' /etc/apt/sources.list
RUN sed -Ei 's/# deb-src/deb-src/gm' /etc/apt/sources.list
ENV PATH="/usr/bin:/usr/local/bin:$PATH"
ENV LD_LIBRARY_PATH="/lib:/lib64:/usr/lib:/usr/local/lib:/usr/lib/x86_64-linux-gnu:/usr/local/lib/x86_64-linux-gnu:/usr/local/include"
ENV PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig"
ENV DEBIAN_FRONTEND="noninteractive"
ENV CC="clang-15" \
CXX="clang++-15" \
CPP="clang-15" \
LLVM="-15" \
LD="ld.lld-15" \
CFLAGS="-march=native -O2" \
LDFLAGS="-flto -fuse-linker-plugin"
RUN mkdir /ffmpeg_sources /ffmpeg_build
WORKDIR /ffmpeg_sources
RUN apt-get update && apt-get install -y git wget lsb-release software-properties-common && wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc && wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
RUN apt-get update -qq && apt-get upgrade -y && apt-get -y install \
autoconf \
automake \
build-essential \
cmake \
libtool \
yasm \
xxd \
openssl \
libass-dev \
libfreetype6-dev \
libgnutls28-dev \
libpthreadpool-dev \
libpthread-stubs0-dev \
libssl-dev \
libmp3lame-dev \
libsdl2-dev \
libopengl-dev \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libdrm-dev \
liblzma-dev \
libxcb-xfixes0-dev \
libv4l-dev \
libjpeg-dev \
librtmp-dev \
libgcrypt20-dev \
libiec61883-dev \
libdc1394-dev \
libavc1394-dev \
pkg-config \
texinfo \
libtls-dev \
libxxhash-dev \
zlib1g-dev \
libopenjp2-7-dev \
libpostproc-dev \
libunwind-dev \
nasm diffutils \
libxml2-dev \
libcodec2-dev \
libmysofa-dev \
libopenal-dev \
libtheora-dev \
libvidstab-dev \
libwebp-dev \
liblcms2-dev \
libfdk-aac-dev \
python3.10-venv \
python3-pip \
libnuma-dev \
libopus-dev \
libopusfile-dev \
libdav1d-dev \
libunistring-dev \
libvulkan-dev \
vulkan-sdk \
clang-15 \
llvm-15 \
lld-15
RUN python3 -m pip install -U meson ninja && ldconfig
# ARG OPUS_VERSION="1.5.2"
# RUN wget "https://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz" -O - | tar xz
# RUN cd opus* && meson setup \
# --buildtype=custom \
# --default-library=static \
# -Dextra-programs=disabled \
# -Ddebug=false \
# -Dtests=disabled \
# -Db_staticpic=true \
# -Dfixed-point=true \
# -Db_asneeded=true \
# -Db_pie=true \
# -Ddocs=disabled \
# -Dfixed-point=false \
# --wipe build && meson install -C build && ldconfig
RUN git clone --depth 1 https://code.videolan.org/videolan/x264.git && cd x264 && ./configure --enable-static --enable-pic --disable-asm && make -j8 && make install
RUN git clone --branch master https://bitbucket.org/multicoreware/x265_git.git && cd x265_git/build/linux && cmake -G "Ninja" -DENABLE_SHARED=off ../../source && ninja install
RUN git clone https://gitlab.com/AOMediaCodec/SVT-AV1.git && cd SVT-AV1/Build/linux && ./build.sh --release --jobs=$(nproc) --enable-lto --native --enable-avx512 --install -x
RUN git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && cd libvpx && ./configure --enable-install-srcs --enable-codec-srcs --enable-static --enable-pic --enable-vp9-highbitdepth --enable-better-hw-compatibility --disable-docs --disable-examples --disable-unit-tests --as=nasm --target=x86_64-linux-gcc && make -j8 && make install
ARG AMF_VERSION="v1.4.34"
RUN git clone --depth 1 --branch ${AMF_VERSION} https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git && mkdir -p /usr/local/include/AMF && cp -r AMF/amf/public/include/* /usr/local/include/AMF
# ARG VMAF_TAG=master
# RUN git clone --branch ${VMAF_TAG} https://github.com/Netflix/vmaf.git && cd vmaf && make deps && .venv/bin/meson setup libvmaf/build libvmaf --buildtype release -Denable_avx512=true -Denable_float=true --default-library=static && .venv/bin/ninja -vC libvmaf/build install
# RUN git clone https://github.com/google/shaderc && cd shaderc && ./utils/git-sync-deps && mkdir build && cd build && cmake -GNinja -DENABLE_SHARED=off -DCMAKE_CXX_FLAGS="-flto" -DCMAKE_BUILD_TYPE=Release .. && ninja -j 16
# ARG LIBPLACEBO_TAG="v5.264.1"
# RUN git clone --recursive --branch ${LIBPLACEBO_TAG} https://code.videolan.org/videolan/libplacebo && cd libplacebo && meson setup build --buildtype=release --default-library=static --wipe && ninja -j 16 -Cbuild install
ARG FFMPEG_TAG=master
RUN git clone --depth=1 --branch ${FFMPEG_TAG} https://github.com/FFmpeg/FFmpeg.git && cd FFmpeg && ldconfig
WORKDIR /ffmpeg_sources/FFmpeg
# # --enable-libvmaf --ld="g++-12" \
# --enable-libplacebo \
# --extra-ldflags='-flto -fuse-linker-plugin -fuse-ld=lld-18' \
# --enable-cross-compile \
# --enable-libplacebo \
RUN ./configure \
--target-os="linux" \
--arch="x86_64" \
--prefix="/usr/local" \
--pkg-config-flags="--static" \
--extra-libs="-lm -lpthread" \
--extra-ldflags="-flto -fuse-linker-plugin -fuse-ld=lld-15" \
--extra-cflags='-march=native -O2' \
--extra-cxxflags='-march=native -O2' \
--toolchain="hardened" \
--cc="clang-15" \
--cxx="clang++-15" \
--enable-lto=full \
--enable-static \
--enable-thumb \
--enable-pic \
--enable-pthreads \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--enable-amf \
--enable-libfdk-aac \
--enable-libopenjpeg \
--enable-openssl \
--enable-libass \
--enable-libtls \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libdav1d \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-libsvtav1 \
--enable-vulkan \
--enable-libglslang \
--enable-libdrm \
--enable-opengl \
--enable-libv4l2 \
--enable-gmp \
--enable-gcrypt \
--enable-libpulse \
--enable-libdc1394 \
--enable-libiec61883 \
--enable-libxcb \
--enable-libxcb-shm \
--enable-libxcb-xfixes \
--enable-libxcb-shape \
--disable-shared \
--disable-debug \
--disable-doc
CMD make -j$(nproc) && mv -v ffmpeg ffplay ffprobe -t /ffmpeg_build/