Unverified Commit 7255c577 authored by Loe Lobo's avatar Loe Lobo Committed by GitHub

Enable libass support (#5)

* Enable libass

* Fixed PKG config path

* fixed libass static reference

* fixed libass static reference

* newline at end of file
parent 85f0e51d
......@@ -43,3 +43,12 @@
[submodule "third_party/libwebp"]
path = third_party/libwebp
url = https://github.com/ffmpegwasm/libwebp
[submodule "third_party/fribidi"]
path = third_party/fribidi
url = https://github.com/fribidi/fribidi.git
[submodule "third_party/harfbuzz"]
path = third_party/harfbuzz
url = https://github.com/harfbuzz/harfbuzz.git
[submodule "third_party/libass"]
path = third_party/libass
url = https://github.com/libass/libass.git
......@@ -34,6 +34,12 @@ $SCRIPT_ROOT/build-opus.sh
$SCRIPT_ROOT/build-freetype2.sh
# build libwebp
$SCRIPT_ROOT/build-libwebp.sh
# build fribidi
$SCRIPT_ROOT/build-fribidi.sh
# build harfbuzz
$SCRIPT_ROOT/build-harfbuzz.sh
# build libass
$SCRIPT_ROOT/build-libass.sh
# build aom (disabled as it is extremely slow)
# $SCRIPT_ROOT/build-aom.sh
# configure FFmpeg with Emscripten
......
Subproject commit 3585a81e625e5b35962bed11fdc99d54485048e0
Subproject commit 2fbd34f89a80fb25aa0f8edd1dbb692c66211842
Subproject commit d0634f4a669c86063e2765891bfdec17719f40c2
......@@ -7,9 +7,9 @@ mkdir -p wasm/dist
emmake make -j
FLAGS=(
-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 -Lharfbuzz -Llibass -Lfribidi -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 -lz -lfreetype -lopus -lwebp -pthread
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lharfbuzz -lfribidi -llibass -lx264 -lx265 -lvpx -lwavpack -lmp3lame -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -lfreetype -lopus -lwebp -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/fribidi
CFLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
CONF_FLAGS=(
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
--host=i686-gnu # use i686 linux
--enable-shared=no # not to build shared library
--enable-static
--disable-dependency-tracking
--disable-debug
--without-glib
--disable-docs
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
emmake make -C $LIB_PATH install -j1
#!/bin/bash
set -euo pipefail
source $(dirname $0)/var.sh
LIB_PATH=third_party/harfbuzz
CFLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
CONF_FLAGS=(
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
--host=i686-gnu # use i686 linux
--enable-shared=no # not to build shared library
--enable-static
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
emmake make -C $LIB_PATH install -j
#!/bin/bash
set -euo pipefail
source $(dirname $0)/var.sh
LIB_PATH=third_party/libass
LIBASS_PC_PATH="$BUILD_DIR/lib/pkgconfig"
CONF_FLAGS=(
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
--host=i686-gnu # use i686 linux
--disable-shared
--enable-static
--disable-asm # disable asm optimization
--disable-fontconfig
--disable-require-system-font-provider
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && ./autogen.sh && EM_PKG_CONFIG_PATH=$LIBASS_PC_PATH emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
emmake make -C $LIB_PATH install -j
......@@ -3,6 +3,7 @@
set -euo pipefail
source $(dirname $0)/var.sh
FFMPEG_WEBM_PC_PATH="$BUILD_DIR/lib/pkgconfig"
FLAGS=(
"${FFMPEG_CONFIG_FLAGS_BASE[@]}"
--enable-gpl # required by x264
......@@ -22,4 +23,4 @@ FLAGS=(
# --enable-libaom # enable libaom
)
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}"
emconfigure ./configure "${FLAGS[@]}"
EM_PKG_CONFIG_PATH=${FFMPEG_WEBM_PC_PATH} emconfigure ./configure "${FLAGS[@]}"
......@@ -58,6 +58,8 @@ FFMPEG_CONFIG_FLAGS_BASE=(
--cxx=em++
--objcc=emcc
--dep-cc=emcc
--enable-libass
--enable-filter=subtitles,overlay
)
echo "EMSDK=$EMSDK"
......
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