Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit abd3860

Browse files
committed
Merge up to v0.8.4
2 parents d08a294 + 26e974c commit abd3860

24 files changed

+894
-33
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,36 @@ jobs:
2525
bash build-with-docker.sh
2626
- uses: actions/upload-artifact@master
2727
with:
28-
name: ffmpeg-core-linux
29-
path: wasm/dist
30-
macos-build:
31-
runs-on: macos-latest
32-
steps:
33-
- uses: actions/checkout@v2
34-
with:
35-
fetch-depth: 0
36-
submodules: recursive
37-
- name: Setup cache
38-
id: cache-system-libraries
39-
uses: actions/cache@v2
40-
with:
41-
path: ${{env.EM_CACHE_FOLDER}}
42-
key: ${{env.EM_VERSION}}-${{ runner.os }}
43-
- uses: mymindstorm/setup-emsdk@v6
44-
with:
45-
version: ${{env.EM_VERSION}}
46-
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
47-
- name: Build FFMpeg
48-
shell: bash
49-
run: |
50-
export PATH=$PATH:$PWD/emsdk-cache/emsdk-master/upstream/bin
51-
bash build.sh
52-
- uses: actions/upload-artifact@master
53-
with:
54-
name: ffmpeg-core-macos
28+
name: ffmpeg-core
5529
path: wasm/dist
30+
# Disable macos build due to there is no ldconfig command
31+
# during freetype2 build.
32+
# macos-build:
33+
# runs-on: macos-latest
34+
# steps:
35+
# - uses: actions/checkout@v2
36+
# with:
37+
# fetch-depth: 0
38+
# submodules: recursive
39+
# - name: Setup cache
40+
# id: cache-system-libraries
41+
# uses: actions/cache@v2
42+
# with:
43+
# path: ${{env.EM_CACHE_FOLDER}}
44+
# key: ${{env.EM_VERSION}}-${{ runner.os }}
45+
# - uses: mymindstorm/setup-emsdk@v6
46+
# with:
47+
# version: ${{env.EM_VERSION}}
48+
# actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
49+
# - name: Build FFMpeg
50+
# shell: bash
51+
# run: |
52+
# export PATH=$PATH:$PWD/emsdk-cache/emsdk-master/upstream/bin
53+
# bash build.sh
54+
# - uses: actions/upload-artifact@master
55+
# with:
56+
# name: ffmpeg-core-macos
57+
# path: wasm/dist
5658
# Not working with error messsage:
5759
# C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32\bin\ar.exe: libavfilter/vsink_null: No such file or directory
5860
# windows-build:

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@
3434
[submodule "third_party/zlib"]
3535
path = third_party/zlib
3636
url = https://github.com/ffmpegwasm/zlib
37+
[submodule "third_party/freetype2"]
38+
path = third_party/freetype2
39+
url = https://github.com/ffmpegwasm/freetype2
40+
[submodule "third_party/opus"]
41+
path = third_party/opus
42+
url = https://github.com/ffmpegwasm/opus

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,10 @@ $ npm test
7777
| fdk-aac | 2.0.1 | aac format |
7878
| ogg | 1.3.4 | required by vorbis |
7979
| vorbis | 1.3.6 | ogg format |
80+
| opus | 1.3.1 | opus format |
81+
82+
#### Others
83+
84+
| Library/Tool Name | Version | Remark |
85+
| ----------------- | ------- | ------ |
86+
| freetype2 | 2.10.4 | font file support |

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ $SCRIPT_ROOT/build-ogg.sh
2828
$SCRIPT_ROOT/build-vorbis.sh
2929
# build theora
3030
$SCRIPT_ROOT/build-theora.sh
31+
# build opus
32+
$SCRIPT_ROOT/build-opus.sh
33+
# build freetype2
34+
$SCRIPT_ROOT/build-freetype2.sh
3135
# build aom (disabled as it is extremely slow)
3236
$SCRIPT_ROOT/build-aom.sh
3337
# configure FFmpeg with Emscripten

third_party/freetype2

Submodule freetype2 added at 6a2b3e4

third_party/opus

Submodule opus added at e85ed77

wasm/build-scripts/build-ffmpeg.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ FLAGS=(
99
-I. -I./fftools -I$BUILD_DIR/include
1010
-Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -L$BUILD_DIR/lib
1111
-Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments
12-
-lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -lpostproc -lm -lx264 -lx265 -lvpx -lwavpack -lmp3lame -lfdk-aac -lvorbis -lvorbisenc -lvorbisfile -logg -ltheora -ltheoraenc -ltheoradec -lz -laom -pthread
12+
-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 -pthread
13+
-laom
1314
fftools/ffmpeg_opt.c fftools/ffmpeg_filter.c fftools/ffmpeg_hw.c fftools/cmdutils.c fftools/ffmpeg.c
1415
-o wasm/dist/ffmpeg-core.js
1516
-s USE_SDL=2 # use SDL2

wasm/build-scripts/build-freetype2.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
source $(dirname $0)/var.sh
5+
6+
LIB_PATH=third_party/freetype2
7+
CFLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
8+
CONF_FLAGS=(
9+
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
10+
--host=i686-gnu # use i686 linux
11+
--enable-shared=no # not to build shared library
12+
)
13+
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
14+
(cd $LIB_PATH && \
15+
emconfigure ./autogen.sh && \
16+
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
17+
emmake make -C $LIB_PATH clean
18+
emmake make -C $LIB_PATH install -j

wasm/build-scripts/build-opus.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
source $(dirname $0)/var.sh
5+
6+
LIB_PATH=third_party/opus
7+
CFLAGS="-s USE_PTHREADS=1 $OPTIM_FLAGS"
8+
CONF_FLAGS=(
9+
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
10+
--host=i686-gnu # use i686 linux
11+
--enable-shared=no # not to build shared library
12+
--disable-asm # not to use asm
13+
--disable-rtcd # not to detect cpu capabilities
14+
--disable-doc # not to build docs
15+
--disable-extra-programs # not to build demo and tests
16+
--disable-stack-protector
17+
)
18+
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
19+
(cd $LIB_PATH && \
20+
emconfigure ./autogen.sh && \
21+
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
22+
emmake make -C $LIB_PATH clean
23+
emmake make -C $LIB_PATH install -j

wasm/build-scripts/configure-ffmpeg.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ FLAGS=(
1616
--enable-libfdk-aac # enable libfdk-aac
1717
--enable-libtheora # enable libtheora
1818
--enable-libvorbis # enable libvorbis
19+
--enable-libfreetype # enable freetype
20+
--enable-libopus # enable opus
1921
--enable-libaom # enable libaom
2022
)
2123
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}"

0 commit comments

Comments
 (0)