Skip to content

Commit 559f30d

Browse files
authored
chore: roll ffmpeg binaries to r1001 (#3824)
This patch: - updates FFMPEG to r1001 - updates README.md with a brief description of binaries build process
1 parent 3124a1b commit 559f30d

File tree

4 files changed

+3
-214
lines changed

4 files changed

+3
-214
lines changed

third_party/ffmpeg/README.md

Lines changed: 3 additions & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -1,216 +1,5 @@
1-
# Binary Files
1+
# FFMPEG
22

3-
<!-- GEN:toc-top-level -->
4-
- [Building `ffmpeg-mac`](#building-ffmpeg-mac)
5-
- [Building `ffmpeg-win64.exe`](#building-ffmpeg-win64exe)
6-
- [Building `ffmpeg-win32.exe`](#building-ffmpeg-win32exe)
7-
<!-- GEN:stop -->
8-
9-
## Building `ffmpeg-mac`
10-
11-
> FFMPEG: [`n4.3.1`](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.3.1)
12-
> libvpx: [`v1.9.0`](https://github.com/webmproject/libvpx/releases/tag/v1.9.0)
13-
14-
I mostly followed steps at https://trac.ffmpeg.org/wiki/CompilationGuide/macOS
15-
16-
1. Clone repo & checkout release tag (we're building release v4.3.1)
17-
18-
```sh
19-
~$ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
20-
~$ cd ffmpeg
21-
~/ffmpeg$ git checkout n4.3.1
22-
```
23-
24-
2. Install brew dependencies
25-
26-
```sh
27-
~/ffmpeg$ brew install automake fdk-aac git lame libass libtool libvorbis libvpx \
28-
opus sdl shtool texi2html theora wget x264 x265 xvid nasm
29-
```
30-
31-
3. Prepare output folders
32-
33-
```sh
34-
~/ffmpeg$ mkdir -p output/bin
35-
```
36-
37-
4. Configure with vpx
38-
39-
```sh
40-
~/ffmpeg$ ./configure --prefix=$PWD/output \
41-
--pkg-config-flags="--static" \
42-
--bindir=$PWD/output/bin \
43-
--disable-everything \
44-
--enable-ffmpeg \
45-
--enable-protocol=pipe \
46-
--enable-protocol=file \
47-
--enable-parser=mjpeg \
48-
--enable-decoder=mjpeg \
49-
--enable-demuxer=image2pipe \
50-
--enable-filter=pad \
51-
--enable-filter=crop \
52-
--enable-filter=scale \
53-
--enable-muxer=webm \
54-
--enable-encoder=libvpx_vp8 \
55-
--enable-libvpx \
56-
--enable-static
57-
```
58-
59-
5. Make & install to the `output/bin`
60-
61-
```sh
62-
~/ffmpeg$ make && make install
63-
```
64-
65-
## Building `ffmpeg-win64.exe`
66-
67-
> FFMPEG: [`n4.3.1`](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.3.1)
68-
> libvpx: [`d1a7897`](https://github.com/webmproject/libvpx/commit/d1a78971ebcfd728c9c73b0cfbee69f470d4dc72)
69-
70-
1. Install `MSYS2` from `https://www.msys2.org` and install to `c:\msys64`
71-
72-
2. Launch `c:\msys64\mingw64` to launch a shell with a proper environment.
73-
74-
3. `MSYS2` uses `pacman` to install dependencies. Run the following commands to update & install packages:
75-
76-
```sh
77-
$ pacman -Syu
78-
$ pacman -Su
79-
$ pacman -S make pkgconf diffutils yasm
80-
$ pacman -S mingw-w64-x86_64-nasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2
81-
```
82-
83-
notes:
84-
- `yasm` is needed for `libvpx`
85-
- the rest is a general compilation toolchain
86-
87-
4. Clone `libvpx` of proper version, compile manually and install to a well-known location (prefix):
88-
89-
```sh
90-
$ cd /c/
91-
$ git clone https://chromium.googlesource.com/webm/libvpx
92-
$ cd libvpx
93-
$ git checkout d1a78971ebcfd728c9c73b0cfbee69f470d4dc72
94-
$ ./configure --prefix=/eee64 --target=x86_64-win64-gcc --enable-static --disable-shared --disable-docs --disable-tools --disable-unit-tests --disable-examples
95-
$ make && make install
96-
```
97-
98-
Note: `libvpx` has a useful readme: https://chromium.googlesource.com/webm/libvpx/+/master/README
99-
100-
5. Once `libvpx` is compiled, compile `ffmpeg` using the just-compiled `libvpx`:
101-
102-
```sh
103-
$ cd /c/
104-
$ git clone git://source.ffmpeg.org/ffmpeg.git
105-
$ cd ffmpeg
106-
$ git checkout n4.3.1
107-
$ ./configure --extra-cflags="-I/eee64/include" \
108-
--extra-ldflags="-L/eee64/lib -static" \
109-
--prefix=/eee64 \
110-
--pkg-config-flags="--static" \
111-
--bindir=$PWD/output/bin \
112-
--disable-everything \
113-
--enable-ffmpeg \
114-
--enable-protocol=pipe \
115-
--enable-protocol=file \
116-
--enable-parser=mjpeg \
117-
--enable-decoder=mjpeg \
118-
--enable-demuxer=image2pipe \
119-
--enable-filter=pad \
120-
--enable-filter=crop \
121-
--enable-filter=scale \
122-
--enable-muxer=webm \
123-
--enable-libvpx \
124-
--enable-static \
125-
--enable-encoder=libvpx_vp8 \
126-
--disable-pthreads \
127-
--disable-zlib \
128-
--disable-iconv \
129-
--disable-bzlib \
130-
--disable-w32threads
131-
$ make && make install
132-
```
133-
134-
note: the following resources helped me to deal with some dynamic dependencies in the resulting `ffmpeg.exe`:
135-
- https://stackoverflow.com/questions/13768515/how-to-do-static-linking-of-libwinpthread-1-dll-in-mingw
136-
137-
## Building `ffmpeg-win32.exe`
138-
139-
> FFMPEG: [`n4.3.1`](https://github.com/FFmpeg/FFmpeg/releases/tag/n4.3.1)
140-
> libvpx: [`d1a7897`](https://github.com/webmproject/libvpx/commit/d1a78971ebcfd728c9c73b0cfbee69f470d4dc72)
141-
142-
> NOTE: these steps assume that `ffmpeg-win64.exe` was just built on the machine.
143-
144-
1. Launch `c:\msys64\mingw32` to launch a shell with a proper environment. Not sure if this is required or everything could be done from `mingw64` - but it worked.
145-
146-
2. Update libraries for mingw32
147-
148-
```sh
149-
$ pacman -Syu
150-
$ pacman -Su
151-
```
152-
153-
3. Uninstall the `x86_64` compilers that we installed to build win64 version:
154-
155-
```sh
156-
$ pacman -R mingw-w64-x86_64-nasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2
157-
```
158-
159-
4. Install the i686 compilers instead of their x86_64 counterparts:
160-
161-
```sh
162-
$ pacman -S mingw-w64-i686-nasm mingw-w64-i686-gcc mingw-w64-i686-SDL2
163-
```
164-
165-
5. Remove all old source folders - we'll re-clone everything later for simplicity
166-
167-
```sh
168-
$ rm -rf /c/ffmpeg && rm -rf /c/libvpx
169-
```
170-
171-
6. Clone & compile libvpx. Notice a change: `--target=x86-win32-gcc`
172-
173-
```sh
174-
$ cd /c/
175-
$ git clone https://chromium.googlesource.com/webm/libvpx
176-
$ cd libvpx
177-
$ ./configure --prefix=/eee32 --target=x86-win32-gcc --enable-static --disable-shared --disable-docs --disable-tools --disable-unit-tests --disable-examples
178-
$ make && make install
179-
```
180-
181-
7. Clone & compile ffmpeg
182-
183-
```sh
184-
$ cd /c/
185-
$ git clone git://source.ffmpeg.org/ffmpeg.git
186-
$ cd ffmpeg
187-
$ git checkout n4.3.1
188-
$ ./configure --extra-cflags="-I/eee32/include" \
189-
--extra-ldflags="-L/eee32/lib -static" \
190-
--prefix=/eee32 \
191-
--pkg-config-flags="--static" \
192-
--bindir=$PWD/output/bin \
193-
--disable-everything \
194-
--enable-ffmpeg \
195-
--enable-protocol=pipe \
196-
--enable-protocol=file \
197-
--enable-parser=mjpeg \
198-
--enable-decoder=mjpeg \
199-
--enable-demuxer=image2pipe \
200-
--enable-filter=pad \
201-
--enable-filter=crop \
202-
--enable-filter=scale \
203-
--enable-muxer=webm \
204-
--enable-libvpx \
205-
--enable-static \
206-
--enable-encoder=libvpx_vp8 \
207-
--disable-pthreads \
208-
--disable-zlib \
209-
--disable-iconv \
210-
--disable-bzlib \
211-
--disable-w32threads
212-
$ make && make install
213-
```
214-
215-
note: using `-j` for make somehow breaks compilation - so I'd suggest compiling everything in one thread.
3+
- FFMPEG binary files are produced by [`//browser_patches/ffmpeg`](../../browser_patches/ffmpeg) scripts.
4+
- To get exact source that produced binary, run executable without arguments and look at the version suffix. It'll be something `n4.3.1-playwright-build-1001` - with the `1001` being the [`ffmpeg/BUILD_NUMBER`](../../browser_patches/ffmpeg/BUILD_NUMBER)
2165

third_party/ffmpeg/ffmpeg-mac

-102 KB
Binary file not shown.

third_party/ffmpeg/ffmpeg-win32.exe

100644100755
-68.5 KB
Binary file not shown.

third_party/ffmpeg/ffmpeg-win64.exe

100644100755
378 KB
Binary file not shown.

0 commit comments

Comments
 (0)