This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
forked from FFmpeg/FFmpeg
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "Upgrade to emscripten v2.0.24" Because of confusing due to API changes. * Build some "core" variations. * add png-to-mp4 * add test for limited-function core Co-authored-by: jeromewu <jeromewus@gmail.com>
- Loading branch information
1 parent
e87c5e2
commit 9e96b1c
Showing
19 changed files
with
151 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
source $(dirname $0)/var.sh | ||
|
||
if [[ "$FFMPEG_ST" != "yes" ]]; then | ||
mkdir -p wasm/packages/core.png-to-mp4/dist | ||
EXPORTED_FUNCTIONS="[_main, _proxy_main]" | ||
EXTRA_FLAGS=( | ||
-pthread | ||
-s USE_PTHREADS=1 # enable pthreads support | ||
-s PROXY_TO_PTHREAD=1 # detach main() from browser/UI main thread | ||
-o wasm/packages/core.png-to-mp4/dist/ffmpeg-core.js | ||
) | ||
else | ||
mkdir -p wasm/packages/core-st.png-to-mp4/dist | ||
EXPORTED_FUNCTIONS="[_main]" | ||
EXTRA_FLAGS=( | ||
-o wasm/packages/core-st.png-to-mp4/dist/ffmpeg-core.js | ||
) | ||
fi | ||
|
||
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 -lz | ||
fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c | ||
-s USE_SDL=2 # use SDL2 | ||
-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 EXPORT_NAME="createFFmpegCore" # assign export name for browser | ||
-s EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS" # export main and proxy_main funcs | ||
-s EXTRA_EXPORTED_RUNTIME_METHODS="[FS, cwrap, ccall, setValue, writeAsciiToMemory]" # export preamble funcs | ||
-s INITIAL_MEMORY=1073741824 # 1073741824 bytes = 1 GB | ||
--post-js wasm/src/post.js | ||
--pre-js wasm/src/pre.js | ||
$OPTIM_FLAGS | ||
${EXTRA_FLAGS[@]} | ||
) | ||
echo "FFMPEG_EM_FLAGS=${FLAGS[@]}" | ||
emmake make -j | ||
emcc "${FLAGS[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
source $(dirname $0)/var.sh | ||
|
||
FLAGS=( | ||
"${FFMPEG_CONFIG_FLAGS_BASE[@]}" | ||
--disable-all | ||
--enable-gpl # required by x264 | ||
--enable-libx264 # enable x264 | ||
--enable-zlib # enable zlib | ||
--enable-avcodec | ||
--enable-avformat | ||
--enable-avfilter | ||
--enable-swresample | ||
--enable-swscale | ||
--enable-decoder=png | ||
--enable-encoder=png,libx264 | ||
--enable-parser=h264,png | ||
--enable-protocol=file | ||
--enable-demuxer=image2 | ||
--enable-muxer=mp4 | ||
--enable-filter=scale,format,null | ||
|
||
) | ||
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}" | ||
emconfigure ./configure "${FLAGS[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
require('./transcode-base')('mt'); | ||
const base = require('./transcode-base'); | ||
base('mt','core'); | ||
base('mt','core.mp4-scale',(name) => name == 'mp4 scale'); | ||
base('mt','core.png-to-mp4',(name) => name == 'png to mp4'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
require('./transcode-base')('st'); | ||
const base = require('./transcode-base'); | ||
base('st','core-st'); | ||
base('st','core-st.mp4-scale',(name) => name == 'mp4 scale'); | ||
base('st','core-st.png-to-mp4',(name) => name == 'png to mp4'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters