Commit acd70a80 authored by Jerome Wu's avatar Jerome Wu

Add WavPack build scripts

parent 64d3e62f
...@@ -8,7 +8,7 @@ on: ...@@ -8,7 +8,7 @@ on:
branches: [ n4.3.1-wasm ] branches: [ n4.3.1-wasm ]
env: env:
EM_VERSION: 1.39.18 EM_VERSION: 2.0.8
EM_CACHE_FOLDER: 'emsdk-cache' EM_CACHE_FOLDER: 'emsdk-cache'
jobs: jobs:
...@@ -22,6 +22,9 @@ jobs: ...@@ -22,6 +22,9 @@ jobs:
shell: bash shell: bash
run: | run: |
bash build-with-docker.sh bash build-with-docker.sh
- name: Run Tests
run: |
cd wasm && npm install && npm test
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
with: with:
name: ffmpeg-core-linux name: ffmpeg-core-linux
......
...@@ -26,7 +26,16 @@ If nothing goes wrong, you can find JavaScript files in `wasm/dist`. ...@@ -26,7 +26,16 @@ If nothing goes wrong, you can find JavaScript files in `wasm/dist`.
## Configuration ## Configuration
#### Base
- Emscripten: 2.0.8 - Emscripten: 2.0.8
- FFmpeg: 4.3.1 - 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 ...@@ -6,12 +6,16 @@ SCRIPT_ROOT=$(dirname $0)/wasm/build-scripts
# verify Emscripten version # verify Emscripten version
emcc -v emcc -v
# install dependencies
$SCRIPT_ROOT/install-deps.sh
# build x264 # build x264
$SCRIPT_ROOT/build-x264.sh $SCRIPT_ROOT/build-x264.sh
# build x265 (WIP) # build x265 (WIP)
# $SCRIPT_ROOT/build-x265.sh # $SCRIPT_ROOT/build-x265.sh
# build libvpx # build libvpx
$SCRIPT_ROOT/build-libvpx.sh $SCRIPT_ROOT/build-libvpx.sh
# build WavPack
$SCRIPT_ROOT/build-wavpack.sh
# configure FFmpeg with Emscripten # configure FFmpeg with Emscripten
$SCRIPT_ROOT/configure-ffmpeg.sh $SCRIPT_ROOT/configure-ffmpeg.sh
# build ffmpeg.wasm core # build ffmpeg.wasm core
......
...@@ -9,7 +9,7 @@ FLAGS=( ...@@ -9,7 +9,7 @@ FLAGS=(
-I. -I./fftools -I$BUILD_DIR/include -I. -I./fftools -I$BUILD_DIR/include
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -L$BUILD_DIR/lib -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 -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 fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c
-o wasm/dist/ffmpeg-core.js -o wasm/dist/ffmpeg-core.js
-s USE_SDL=2 # use SDL2 -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=( ...@@ -44,6 +44,7 @@ FFMPEG_CONFIG_FLAGS_BASE=(
--enable-gpl # required by x264 --enable-gpl # required by x264
--enable-libx264 # enable x264 --enable-libx264 # enable x264
--enable-libvpx # enable libvpx / webm --enable-libvpx # enable libvpx / webm
--enable-libwavpack # enable libwavpack
--disable-debug # disable debug info, required by closure --disable-debug # disable debug info, required by closure
--disable-runtime-cpudetect # disable runtime cpu detect --disable-runtime-cpudetect # disable runtime cpu detect
--disable-autodetect # disable external libraries auto 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