Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
897200d1
Commit
897200d1
authored
Sep 01, 2020
by
Jerome Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build scripts
parent
81ca8d21
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
25 deletions
+76
-25
.gitignore
.gitignore
+2
-0
build-with-docker.sh
build-with-docker.sh
+6
-5
build.sh
build.sh
+9
-20
basic.html
wasm/basic.html
+10
-0
build-ffmpeg.sh
wasm/build-scripts/build-ffmpeg.sh
+16
-0
configure.sh
wasm/build-scripts/configure.sh
+28
-0
make.sh
wasm/build-scripts/make.sh
+5
-0
No files found.
.gitignore
View file @
897200d1
...
...
@@ -37,3 +37,5 @@
/src
/mapfile
/tools/python/__pycache__/
/wasm/cache
/wasm/dist
build-with-docker.sh
View file @
897200d1
#!/bin/bash -x
set
-eo
pipefail
EM_VERSION
=
1.39.18-upstream
FLAGS
=
""
# Attach TTY only when available, this is for running in Gihub Actions
if
[
-t
1
]
;
then
FLAGS
=
"-it"
;
fi
docker pull trzeci/emscripten:
$EM_VERSION
docker run
$FLAGS
\
docker run
\
--rm
\
-v
$PWD
:/src
\
-v
$PWD
/wasm/cache:/emsdk_portable/.data/cache/wasm
\
trzeci/emscripten:
$EM_VERSION
\
sh
-c
'bash ./build.sh'
sh
-c
'bash
-x
./build.sh'
build.sh
View file @
897200d1
#!/bin/bash -x
set
-eo
pipefail
ROOT
=
$(
dirname
$0
)
# verify Emscripten version
emcc
-v
# configure FFmpeg with Emscripten
FLAGS
=(
--disable-x86asm
--enable-cross-compile
# enable cross compile
--disable-inline-asm
# disable inline asm
# --disable-hwaccels # disable all hardware accelerations
# --disable-doc # disable document generation
--nm
=
"llvm-nm -g"
--ar
=
emar
--as
=
llvm-as
--ranlib
=
llvm-ranlib
--cc
=
emcc
--cxx
=
em++
--objcc
=
emcc
--dep-cc
=
emcc
)
emconfigure ./configure
"
${
FLAGS
[@]
}
"
# build FFmpeg.wasm
emmake make
-j
# $ROOT/wasm/build-scripts/configure.sh
# build dependencies
# $ROOT/wasm/build-scripts/make.sh
# build ffmpeg.wasm
$ROOT
/wasm/build-scripts/build-ffmpeg.sh
wasm/basic.html
0 → 100644
View file @
897200d1
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title></title>
<script
src=
"./dist/ffmpeg.js"
></script>
</head>
<body>
</body>
</html>
wasm/build-scripts/build-ffmpeg.sh
0 → 100755
View file @
897200d1
#!/bin/bash -x
set
-eo
pipefail
mkdir
-p
wasm/dist
ARGS
=(
-I
.
-I
./fftools
-Llibavcodec
-Llibavdevice
-Llibavfilter
-Llibavformat
-Llibavresample
-Llibavutil
-Llibpostproc
-Llibswscale
-Llibswresample
-Qunused-arguments
-o
wasm/dist/ffmpeg.js fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c
-lavdevice
-lavfilter
-lavformat
-lavcodec
-lswresample
-lswscale
-lavutil
-lm
-s
USE_SDL
=
2
# use SDL2
-s
USE_PTHREADS
=
1
# enable pthreads support
-s
INITIAL_MEMORY
=
33554432
# 33554432 bytes = 32 MB
)
emcc
"
${
ARGS
[@]
}
"
wasm/build-scripts/configure.sh
0 → 100755
View file @
897200d1
#!/bin/bash -x
set
-eo
pipefail
CFLAGS
=
"-s USE_PTHREADS"
LDFLAGS
=
"
$CFLAGS
-s INITIAL_MEMORY=33554432"
# 33554432 bytes = 32 MB
ARGS
=(
--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
--extra-cflags
=
"
$CFLAGS
"
--extra-cxxflags
=
"
$CFLAGS
"
--extra-ldflags
=
"
$LDFLAGS
"
--nm
=
"llvm-nm -g"
--ar
=
emar
--as
=
llvm-as
--ranlib
=
llvm-ranlib
--cc
=
emcc
--cxx
=
em++
--objcc
=
emcc
--dep-cc
=
emcc
)
emconfigure ./configure
"
${
ARGS
[@]
}
"
wasm/build-scripts/make.sh
0 → 100755
View file @
897200d1
#!/bin/bash -x
set
-eo
pipefail
emmake make
-j4
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment