You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
759 B

2 years ago
rm -rf dist/libffmpeg_$1.wasm dist/libffmpeg_$1.js
export TOTAL_MEMORY=67108864
export EXPORTED_FUNCTIONS="[ \
'_openDecoder', \
'_flushDecoder', \
'_closeDecoder', \
'_decodeData', \
'_main'
]"
echo "Running Emscripten..."
emcc decode_video.c ffmpeg/lib/libavcodec.a ffmpeg/lib/libavutil.a ffmpeg/lib/libswscale.a \
-O2 \
-I "ffmpeg/include" \
-s WASM=1 \
-s TOTAL_MEMORY=${TOTAL_MEMORY} \
-s EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS}" \
-s EXPORTED_RUNTIME_METHODS="['addFunction']" \
-s RESERVED_FUNCTION_POINTERS=18 \
2 years ago
-s FORCE_FILESYSTEM=1 \
-o dist/libffmpeg_$1.js
echo "Finished Build"
rm test/libffmpeg_$1.wasm
rm test/libffmpeg_$1.js
cp dist/libffmpeg_$1.wasm ./test/
cp dist/libffmpeg_$1.js ./test/