Commit 4c5b5c51 authored by Jerome Wu's avatar Jerome Wu

Add ffmpeg mp4 scale only build script

parent 96f478ae
...@@ -16,6 +16,7 @@ FLAGS=( ...@@ -16,6 +16,7 @@ FLAGS=(
-s USE_PTHREADS=1 # enable pthreads support -s USE_PTHREADS=1 # enable pthreads support
-s PROXY_TO_PTHREAD=1 # detach main() from browser/UI main thread -s PROXY_TO_PTHREAD=1 # detach main() from browser/UI main thread
-s INVOKE_RUN=0 # not to run the main() in the beginning -s INVOKE_RUN=0 # not to run the main() in the beginning
-s EXIT_RUNTIME=1 # exit runtime after execution
-s MODULARIZE=1 # use modularized version to be more flexible -s MODULARIZE=1 # use modularized version to be more flexible
-s EXPORT_NAME="createFFmpegCore" # assign export name for browser -s EXPORT_NAME="createFFmpegCore" # assign export name for browser
-s EXPORTED_FUNCTIONS="[_main, _proxy_main]" # export main and proxy_main funcs -s EXPORTED_FUNCTIONS="[_main, _proxy_main]" # export main and proxy_main funcs
......
#!/bin/bash
set -euo pipefail
source $(dirname $0)/var.sh
FLAGS=(
"${FFMPEG_CONFIG_FLAGS_BASE[@]}"
--disable-all
--enable-avcodec
--enable-avformat
--enable-avfilter
--enable-swresample
--enable-swscale
--enable-decoder=h264
--enable-encoder=rawvideo,libx264
--enable-parser=h264
--enable-protocol=file
--enable-demuxer=mov
--enable-muxer=rawvideo,mp4
--enable-filter=scale,format
)
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}"
emconfigure ./configure "${FLAGS[@]}"
...@@ -3,33 +3,8 @@ ...@@ -3,33 +3,8 @@
set -euo pipefail set -euo pipefail
source $(dirname $0)/var.sh source $(dirname $0)/var.sh
CFLAGS="-s USE_PTHREADS=1 -I$BUILD_DIR/include $OPTIM_FLAGS"
LDFLAGS="$CFLAGS -L$BUILD_DIR/lib"
FLAGS=( FLAGS=(
--target-os=none # use none to prevent any os specific configurations "${FFMPEG_CONFIG_FLAGS_BASE[@]}"
--arch=x86_32 # use x86_32 to achieve minimal architectural optimization
--enable-cross-compile # enable cross compile
--disable-x86asm # disable x86 asm
--disable-inline-asm # disable inline asm
--disable-stripping # disable stripping
--disable-programs # disable programs build (incl. ffplay, ffprobe & ffmpeg)
--disable-doc # disable doc
--enable-gpl # required by x264
--enable-libx264 # enable x264
--disable-debug # disable debug info, required by closure
--disable-runtime-cpudetect # disable runtime cpu detect
--disable-autodetect # disable external libraries auto detect
--extra-cflags="$CFLAGS"
--extra-cxxflags="$CFLAGS"
--extra-ldflags="$LDFLAGS"
--nm="llvm-nm -g"
--ar=emar
--as=llvm-as
--ranlib=emranlib
--cc=emcc
--cxx=em++
--objcc=emcc
--dep-cc=emcc
) )
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}" echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}"
emconfigure ./configure "${FLAGS[@]}" emconfigure ./configure "${FLAGS[@]}"
...@@ -10,9 +10,6 @@ OPTIM_FLAGS=( ...@@ -10,9 +10,6 @@ OPTIM_FLAGS=(
-O3 -O3
) )
# Directory to install headers and libraries
BUILD_DIR=$PWD/build
if [[ "$OSTYPE" == "linux-gnu"* ]]; then if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Use closure complier only in linux environment # Use closure complier only in linux environment
OPTIM_FLAGS=( OPTIM_FLAGS=(
...@@ -24,5 +21,37 @@ fi ...@@ -24,5 +21,37 @@ fi
# Convert array to string # Convert array to string
OPTIM_FLAGS="${OPTIM_FLAGS[@]}" OPTIM_FLAGS="${OPTIM_FLAGS[@]}"
# Directory to install headers and libraries
BUILD_DIR=$PWD/build
CFLAGS="-s USE_PTHREADS=1 -I$BUILD_DIR/include $OPTIM_FLAGS"
LDFLAGS="$CFLAGS -L$BUILD_DIR/lib"
FFMPEG_CONFIG_FLAGS_BASE=(
--target-os=none # use none to prevent any os specific configurations
--arch=x86_32 # use x86_32 to achieve minimal architectural optimization
--enable-cross-compile # enable cross compile
--disable-x86asm # disable x86 asm
--disable-inline-asm # disable inline asm
--disable-stripping # disable stripping
--disable-programs # disable programs build (incl. ffplay, ffprobe & ffmpeg)
--disable-doc # disable doc
--enable-gpl # required by x264
--enable-libx264 # enable x264
--disable-debug # disable debug info, required by closure
--disable-runtime-cpudetect # disable runtime cpu detect
--disable-autodetect # disable external libraries auto detect
--extra-cflags="$CFLAGS"
--extra-cxxflags="$CFLAGS"
--extra-ldflags="$LDFLAGS"
--nm="llvm-nm -g"
--ar=emar
--as=llvm-as
--ranlib=emranlib
--cc=emcc
--cxx=em++
--objcc=emcc
--dep-cc=emcc
)
echo "OPTIM_FLAGS=$OPTIM_FLAGS" echo "OPTIM_FLAGS=$OPTIM_FLAGS"
echo "BUILD_DIR=$BUILD_DIR" echo "BUILD_DIR=$BUILD_DIR"
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