Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 0b6750d

Browse files
committed
Add zlib
1 parent ff2f578 commit 0b6750d

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "third_party/x264"]
22
path = third_party/x264
33
url = https://github.com/ffmpegjs/x264
4+
[submodule "third_party/zlib"]
5+
path = third_party/zlib
6+
url = https://github.com/madler/zlib.git

build-js.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@
33
set -e -o pipefail
44

55
NPROC=$(grep -c ^processor /proc/cpuinfo)
6-
BUILD_DIR=$PWD/build
6+
ROOT_DIR=$PWD
7+
BUILD_DIR=$ROOT_DIR/build
8+
9+
build_zlib() {
10+
cd third_party/zlib
11+
rm -rf build zconf.h
12+
mkdir build
13+
cd build
14+
emmake cmake .. \
15+
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR}
16+
emmake make install -j${NPROC}
17+
cd ${ROOT_DIR}
18+
}
719

820
build_x264() {
921
cd third_party/x264
@@ -12,7 +24,7 @@ build_x264() {
1224
--disable-thread \
1325
--prefix=$BUILD_DIR
1426
emmake make install-lib-static -j${NPROC}
15-
cd -
27+
cd ${ROOT_DIR}
1628
}
1729

1830
configure_ffmpeg() {
@@ -49,7 +61,7 @@ build_ffmpegjs() {
4961
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Llibpostproc -L${BUILD_DIR}/lib \
5062
-Qunused-arguments -Oz \
5163
-o dist/ffmpeg-core.js fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c \
52-
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 \
64+
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lz \
5365
--closure 1 \
5466
--pre-js javascript/prepend.js \
5567
-s USE_SDL=2 \
@@ -62,6 +74,7 @@ build_ffmpegjs() {
6274
}
6375

6476
main() {
77+
build_zlib
6578
build_x264
6679
configure_ffmpeg
6780
make_ffmpeg

build-with-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ check_command() {
1414
}
1515

1616
build() {
17-
docker run \
17+
docker run -it \
1818
-v ${PWD}:/src \
1919
trzeci/emscripten:${EMSCRIPTEN_VERSION} \
2020
sh -c "bash ./${TARGET}-js.sh"

dist/ffmpeg-core.js

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

third_party/zlib

Submodule zlib added at cacf7f1

0 commit comments

Comments
 (0)