Skip to content

Commit

Permalink
Provide Dockerfile, build fixes
Browse files Browse the repository at this point in the history
Fixes Kagami#44
  • Loading branch information
Kagami authored and a committed Apr 19, 2020
1 parent 56d57d8 commit fdc588c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/node_modules/
/ffmpeg*.js
/*.wasm
/ffmpeg*.wasm
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:rolling

RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|mirror://mirrors.ubuntu.com/mirrors.txt|g' /etc/apt/sources.list \
&& apt-get update && apt-get install -y git python build-essential automake libtool pkg-config && apt-get clean \
&& cd /root && git clone https://github.com/emscripten-core/emsdk.git \
&& cd /root/emsdk && ./emsdk install latest && ./emsdk activate latest \
&& sed -i 's|\]$|],"getrusage":["memset"]|' /root/emsdk/upstream/emscripten/src/deps_info.json
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ build/x264/dist/lib/libx264.so:
--enable-shared \
--disable-opencl \
--disable-thread \
--disable-interlaced \
--bit-depth=8 \
--chroma-format=420 \
--disable-asm \
\
--disable-avs \
Expand Down Expand Up @@ -165,10 +168,9 @@ FFMPEG_COMMON_ARGS = \
--enable-ffmpeg \
--enable-avcodec \
--enable-avformat \
--enable-avutil \
--enable-avfilter \
--enable-swresample \
--enable-swscale \
--enable-avfilter \
--disable-network \
--disable-d3d11va \
--disable-dxva2 \
Expand Down
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,39 @@ ffmpeg({
```

## Build instructions
Tips, use a [docker](https://www.docker.com/) container (basic ubuntu is good)

It's recommended to use [Docker](https://www.docker.com/) to build ffmpeg.js.

1. Clone ffmpeg.js repository with submodules:
```bash
git clone https://github.com/Kagami/ffmpeg.js.git --recurse-submodules
```

2. Modify Makefile and/or patches if you wish to make a custom build.

3. Build everything:
```bash
docker run --rm -it -v /path/to/ffmpeg.js:/mnt kagamihi/ffmpeg.js
# cp -a /mnt/{.git,build,Makefile} /opt && cd /opt && . /root/emsdk/emsdk_env.sh && make && cp ffmpeg*js /mnt
```

That's it. ffmpeg.js modules should appear in your repository clone.
## Build without Docker
Ubuntu example:
```bash
apt-get update
apt-get -y install python python3-distutils git automake libtool build-essential
apt-get update && apt-get install -y git python build-essential automake libtool pkg-config
cd /root # or /home/whatever
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
cd /root
git clone https://github.com/emscripten-core/emsdk.git && cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
source emsdk_env.sh
cd /root # or /home/whatever
git clone https://github.com/Kagami/ffmpeg.js.git --recurse-submodules
cd ffmpeg.js
cd /root
git clone https://github.com/Kagami/ffmpeg.js.git --recurse-submodules && cd ffmpeg.js
make
```
Expand Down

0 comments on commit fdc588c

Please sign in to comment.