You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### If you like the script, please "★" this project!
5
6
6
7
build-ffmpeg
7
8
==========
8
9
9
-
The FFmpeg build script provides an easy way to build a static FFmpeg on **macOS** and **Linux** with **non-free codecs** included.
10
-
10
+
The FFmpeg build script provides an easy way to build a static FFmpeg on **macOS** and **Linux** with **non-free
11
+
codecs** included.
11
12
12
13
[](https://www.youtube.com/watch?v=Z9p3mM757cM"How-To build FFmpeg on OSX")
13
14
14
-
*Youtube: How-To build and install FFmpeg on MacOS*
15
-
15
+
*Youtube: How-To build and install FFmpeg on macOS*
16
16
17
17
## Disclaimer And Data Privacy Notice
18
-
This script will download different packages with different licenses from various sources, which may track your usage.
19
-
These sources are out of control by the developers of this script. By downloading and using this script, you are fully aware of this.
20
18
21
-
Use this script at your own risk. I maintain this script in my spare time.
22
-
Please do not file bug reports for systems other than Debian 10 and macOS 11.x,
23
-
because I don't have the resources or time to maintain different systems.
19
+
This script will download different packages with different licenses from various sources, which may track your usage.
20
+
These sources are out of control by the developers of this script. By downloading and using this script, you are fully
21
+
aware of this.
24
22
23
+
Use this script at your own risk. I maintain this script in my spare time. Please do not file bug reports for systems
24
+
other than Debian 10 and macOS 11.x, because I don't have the resources or time to maintain different systems.
25
25
26
26
## Supported Codecs
27
+
27
28
*`x264`: H.264 Video Codec (MPEG-4 AVC)
28
29
*`x265`: H.265 Video Codec (HEVC)
29
30
*`libsvtav1`, SVT-AV1 Encoder and Decoder
@@ -41,7 +42,10 @@ because I don't have the resources or time to maintain different systems.
41
42
*`webp`: Image format both lossless and lossy
42
43
43
44
### HardwareAccel
44
-
*`nv-codec`: [NVIDIA's GPU accelerated video codecs](https://devblogs.nvidia.com/nvidia-ffmpeg-transcoding-guide/). These encoders/decoders will only be available if a CUDA installation was found while building the binary. Follow [these](#Cuda-installation) instructions for installation. Supported codecs in nvcodec:
45
+
46
+
*`nv-codec`: [NVIDIA's GPU accelerated video codecs](https://devblogs.nvidia.com/nvidia-ffmpeg-transcoding-guide/).
47
+
These encoders/decoders will only be available if a CUDA installation was found while building the binary.
48
+
Follow [these](#Cuda-installation) instructions for installation. Supported codecs in nvcodec:
45
49
* Decoders
46
50
* H264 `h264_cuvid`
47
51
* H265 `hevc_cuvid`
@@ -55,7 +59,9 @@ because I don't have the resources or time to maintain different systems.
55
59
* Encoders
56
60
* H264 `nvenc_h264`
57
61
* H265 `nvenc_hevc`
58
-
*`vaapi`: [Video Acceleration API](https://trac.ffmpeg.org/wiki/Hardware/VAAPI). These encoders/decoders will only be available if a libva driver installation was found while building the binary. Follow [these](#Vaapi-installation) instructions for installation. Supported codecs in vaapi:
62
+
*`vaapi`: [Video Acceleration API](https://trac.ffmpeg.org/wiki/Hardware/VAAPI). These encoders/decoders will only be
63
+
available if a libva driver installation was found while building the binary. Follow [these](#Vaapi-installation)
64
+
instructions for installation. Supported codecs in vaapi:
59
65
* Encoders
60
66
* H264 `h264_vaapi`
61
67
* H265 `hevc_vaapi`
@@ -65,16 +71,20 @@ because I don't have the resources or time to maintain different systems.
65
71
* VP9 `vp9_vaapi`
66
72
67
73
### Apple M1 (Apple Silicon) Support
74
+
68
75
The script also builds FFmpeg on a new MacBook with an Apple Silicon M1 processor.
69
76
70
77
### LV2 Plugin Support
78
+
71
79
If Python is available, the script will build a ffmpeg binary with lv2 plugin support.
72
80
73
-
## Continuos Integration
74
-
ffmpeg-build-script is rockstable. Every commit runs against Linux and MacOS with https://github.com/markus-perl/ffmpeg-build-script/actions just to make sure everything works as expected.
81
+
## Continuous Integration
75
82
83
+
ffmpeg-build-script is very stable. Every commit runs against Linux and macOS
84
+
with https://github.com/markus-perl/ffmpeg-build-script/actions to make sure everything works as expected.
With Docker, FFmpeg can be built reliably without altering the host system.
118
-
Also, there is no need to have the CUDA SDK installed outside of the Docker image.
127
+
With Docker, FFmpeg can be built reliably without altering the host system. Also, there is no need to have the CUDA SDK
128
+
installed outside of the Docker image.
119
129
120
130
A Docker engine with version 19.03 or higher is required to build images based on the following distributions:
131
+
121
132
* Ubuntu >= 16.04 (16.04, 18.04, 20.04)
122
133
* Centos >= 7 (7, 8)
123
134
124
135
1. Enable Docker BuildKit
136
+
125
137
```bash
126
138
$ export DOCKER_BUILDKIT=1
127
139
```
128
140
129
-
2. Set the DIST (`ubuntu` or `centos`) and VER (ubuntu: `16.04` , `18.04`, `20.04` or centos: `7`, `8`) environment variables to select the preferred Docker base image.
141
+
2. Set the DIST (`ubuntu` or `centos`) and VER (ubuntu: `16.04` , `18.04`, `20.04` or centos: `7`, `8`) environment
142
+
variables to select the preferred Docker base image.
4. Build an `export.dockerfile` that copies only what you need from the image you just built as follows. When running, move the library in the lib to a location where the linker can find it or set the `LD_LIBRARY_PATH`.
141
-
Since we have matched the operating system and version, it should work well with dynamic links. If it doesn't work, edit the `export.dockerfile` and copy the necessary libraries and try again.
155
+
4. Build an `export.dockerfile` that copies only what you need from the image you just built as follows. When running,
156
+
move the library in the lib to a location where the linker can find it or set the `LD_LIBRARY_PATH`. Since we have
157
+
matched the operating system and version, it should work well with dynamic links. If it doesn't work, edit
158
+
the `export.dockerfile` and copy the necessary libraries and try again.
To use CUDA from inside the container, the installed Docker version must be >= 19.03.
173
-
Install the driver and `nvidia-docker2` from [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-docker-ce).
193
+
194
+
To use CUDA from inside the container, the installed Docker version must be >= 19.03. Install the driver
195
+
and `nvidia-docker2`
196
+
from [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-docker-ce).
174
197
You can then run FFmpeg inside Docker with GPU hardware acceleration enabled, as follows:
or [this blog](https://www.pugetsystems.com/labs/hpc/How-To-Install-CUDA-10-1-on-Ubuntu-19-04-1405/)
223
+
to setup the CUDA toolkit.
199
224
200
225
## Vaapi installation
201
226
@@ -223,8 +248,9 @@ Options:
223
248
```
224
249
225
250
## Notes of static link
226
-
- Because of the NSS (Name Service Switch), glibc does **not recommend** static links.
227
-
See detail below: https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked_programs_need_some_shared_libraries_which_is_not_acceptable_for_me.__What_can_I_do.3F
251
+
252
+
- Because of the NSS (Name Service Switch), glibc does **not recommend** static links. See detail
0 commit comments