Commit acd70a80 authored by Jerome Wu's avatar Jerome Wu

Add WavPack build scripts

parent 64d3e62f
......@@ -8,7 +8,7 @@ on:
branches: [ n4.3.1-wasm ]
env:
EM_VERSION: 1.39.18
EM_VERSION: 2.0.8
EM_CACHE_FOLDER: 'emsdk-cache'
jobs:
......@@ -22,6 +22,9 @@ jobs:
shell: bash
run: |
bash build-with-docker.sh
- name: Run Tests
run: |
cd wasm && npm install && npm test
- uses: actions/upload-artifact@master
with:
name: ffmpeg-core-linux
......
......@@ -26,7 +26,16 @@ If nothing goes wrong, you can find JavaScript files in `wasm/dist`.
## Configuration
#### Base
- Emscripten: 2.0.8
- FFmpeg: 4.3.1
- x264: 0.160.x
- libvpx: 1.9.0
#### Video
- x264 (mp4): 0.160.x
- libvpx (webm): 1.9.0
#### Audio
- wavpack (wav): 5.3.0
......@@ -6,12 +6,16 @@ SCRIPT_ROOT=$(dirname $0)/wasm/build-scripts
# verify Emscripten version
emcc -v
# install dependencies
$SCRIPT_ROOT/install-deps.sh
# build x264
$SCRIPT_ROOT/build-x264.sh
# build x265 (WIP)
# $SCRIPT_ROOT/build-x265.sh
# build libvpx
$SCRIPT_ROOT/build-libvpx.sh
# build WavPack
$SCRIPT_ROOT/build-wavpack.sh
# configure FFmpeg with Emscripten
$SCRIPT_ROOT/configure-ffmpeg.sh
# build ffmpeg.wasm core
......
......@@ -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 -lvpx -pthread
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lvpx -lwavpack -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/WavPack
FLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
CONF_FLAGS=(
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
--host=x86-linux-gnu
--disable-asm # disable asm optimization
--disable-man
--disable-tests
--disable-apps
--disable-dsd
--enable-legacy
--disable-shared # enable building static library
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && CFLAGS=$FLAGS emconfigure ./autogen.sh "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
emmake make -C $LIB_PATH install -j
#!/bin/bash
missingCmds=()
for cmd in autoconf libtool
do
if ! command -v $cmd &> /dev/null
then
missingCmds+=("$cmd")
fi
done
if [ ${#missingCmds[@]} -ne 0 ];
then
echo "Install missing dependencies"
apt-get update
apt-get install -y ${missingCmds[@]}
fi
......@@ -44,6 +44,7 @@ FFMPEG_CONFIG_FLAGS_BASE=(
--enable-gpl # required by x264
--enable-libx264 # enable x264
--enable-libvpx # enable libvpx / webm
--enable-libwavpack # enable libwavpack
--disable-debug # disable debug info, required by closure
--disable-runtime-cpudetect # disable runtime cpu detect
--disable-autodetect # disable external libraries auto detect
......
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