Commit 47795206 authored by Jerome Wu's avatar Jerome Wu

Add zlib and its build scripts

parent 3011d509
......@@ -31,3 +31,6 @@
[submodule "third_party/aom"]
path = third_party/aom
url = https://github.com/ffmpegwasm/aom
[submodule "third_party/zlib"]
path = third_party/zlib
url = https://github.com/ffmpegwasm/zlib
......@@ -8,6 +8,8 @@ SCRIPT_ROOT=$(dirname $0)/wasm/build-scripts
emcc -v
# install dependencies
$SCRIPT_ROOT/install-deps.sh
# build zlib
$SCRIPT_ROOT/build-zlib.sh
# build x264
$SCRIPT_ROOT/build-x264.sh
# build x265
......
Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f
......@@ -9,7 +9,7 @@ FLAGS=(
-I. -I./fftools -I$BUILD_DIR/include
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -L$BUILD_DIR/lib
-Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lx265 -lvpx -lwavpack -lmp3lame -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -pthread
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lx265 -lvpx -lwavpack -lmp3lame -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -pthread
fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c
-o wasm/dist/ffmpeg-core.js
-s USE_SDL=2 # use SDL2
......
#!/bin/bash
set -euo pipefail
source $(dirname $0)/var.sh
LIB_PATH=third_party/zlib
CXXFLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
CM_FLAGS=(
-DCMAKE_INSTALL_PREFIX=$BUILD_DIR
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE
-DBUILD_SHARED_LIBS=OFF
)
echo "CM_FLAGS=${CONF_FLAGS[@]}"
cd $LIB_PATH
rm -rf build zconf.h
mkdir -p build
cd build
emmake cmake .. -DCMAKE_C_FLAGS="$CXXFLAGS" ${CM_FLAGS[@]}
emmake make clean
emmake make install
cd $ROOT_DIR
......@@ -7,6 +7,7 @@ FLAGS=(
"${FFMPEG_CONFIG_FLAGS_BASE[@]}"
--enable-gpl # required by x264
--enable-nonfree # required by fdk-aac
--enable-zlib # enable zlib
--enable-libx264 # enable x264
--enable-libx265 # enable x265
--enable-libvpx # enable libvpx / webm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment