Skip to content

Commit 18e6e24

Browse files
committed
Readme update
1 parent 2f2f903 commit 18e6e24

File tree

1 file changed

+60
-35
lines changed

1 file changed

+60
-35
lines changed

README.md

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,29 @@
22

33
![FFmpeg build script](https://raw.github.com/markus-perl/ffmpeg-build-script/master/ffmpeg-build-script.png)
44

5+
### If you like the script, please "★" this project!
56

67
build-ffmpeg
78
==========
89

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.
1112

1213
[![How-To build FFmpeg on MacOS](https://img.youtube.com/vi/Z9p3mM757cM/0.jpg)](https://www.youtube.com/watch?v=Z9p3mM757cM "How-To build FFmpeg on OSX")
1314

14-
*Youtube: How-To build and install FFmpeg on MacOS*
15-
15+
*Youtube: How-To build and install FFmpeg on macOS*
1616

1717
## 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.
2018

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.
2422

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.
2525

2626
## Supported Codecs
27+
2728
* `x264`: H.264 Video Codec (MPEG-4 AVC)
2829
* `x265`: H.265 Video Codec (HEVC)
2930
* `libsvtav1`, SVT-AV1 Encoder and Decoder
@@ -41,7 +42,10 @@ because I don't have the resources or time to maintain different systems.
4142
* `webp`: Image format both lossless and lossy
4243

4344
### 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:
4549
* Decoders
4650
* H264 `h264_cuvid`
4751
* H265 `hevc_cuvid`
@@ -55,7 +59,9 @@ because I don't have the resources or time to maintain different systems.
5559
* Encoders
5660
* H264 `nvenc_h264`
5761
* 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:
5965
* Encoders
6066
* H264 `h264_vaapi`
6167
* H265 `hevc_vaapi`
@@ -65,16 +71,20 @@ because I don't have the resources or time to maintain different systems.
6571
* VP9 `vp9_vaapi`
6672

6773
### Apple M1 (Apple Silicon) Support
74+
6875
The script also builds FFmpeg on a new MacBook with an Apple Silicon M1 processor.
6976

7077
### LV2 Plugin Support
78+
7179
If Python is available, the script will build a ffmpeg binary with lv2 plugin support.
7280

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
7582

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.
7685

7786
## Requirements
87+
7888
### macOS
7989

8090
* XCode 10.x or greater
@@ -96,7 +106,7 @@ $ sudo dnf install @development-tools curl
96106

97107
### Quick install and run (macOS, Linux)
98108

99-
Open your command line and run (needs curl to be installed):
109+
Open your command line and run (curl needs to be installed):
100110

101111
```bash
102112
$ bash <(curl -s "https://raw.githubusercontent.com/markus-perl/ffmpeg-build-script/master/web-install.sh?v1")
@@ -114,31 +124,38 @@ $ ./build-ffmpeg --help
114124

115125
### Build in Docker (Linux)
116126

117-
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.
119129

120130
A Docker engine with version 19.03 or higher is required to build images based on the following distributions:
131+
121132
* Ubuntu >= 16.04 (16.04, 18.04, 20.04)
122133
* Centos >= 7 (7, 8)
123134

124135
1. Enable Docker BuildKit
136+
125137
```bash
126138
$ export DOCKER_BUILDKIT=1
127139
```
128140

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.
143+
130144
```bash
131145
$ export DIST=centos
132146
$ export VER=8
133147
```
134148

135149
3. Start the build as follows.
150+
136151
```bash
137152
$ sudo -E docker build --tag=ffmpeg:cuda-$DIST -f cuda-$DIST.dockerfile --build-arg VER=$VER .
138153
```
139154

140-
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.
142159

143160
```bash
144161
$ sudo -E docker build --output type=local,dest=build -f export.dockerfile --build-arg DIST=$DIST .
@@ -151,16 +168,20 @@ libnppc.so.11 libnppicc.so.11 libnppidei.so.11 libnppig.so.11
151168
```
152169

153170
### Build in Docker (full static ver.) (Linux)
154-
If you're running an operating system other than the one above, a completely static build may work.
155-
To build a full statically linked binary inside Docker, just run the following command:
171+
172+
If you're running an operating system other than the one above, a completely static build may work. To build a full
173+
statically linked binary inside Docker, just run the following command:
174+
156175
```bash
157176
$ sudo -E docker build --tag=ffmpeg:cuda-static --output type=local,dest=build -f full-static.dockerfile .
158177
```
159178

160179
### Run with Docker (macOS, Linux)
180+
161181
You can also run the FFmpeg directly inside a Docker container.
162182

163183
#### Default - Without CUDA (macOS, Linux)
184+
164185
If CUDA is not required, a dockerized FFmpeg build can be executed with the following command:
165186

166187
```bash
@@ -169,9 +190,12 @@ $ sudo docker run ffmpeg -i https://files.coconut.co.s3.amazonaws.com/test.mp4 -
169190
```
170191

171192
#### With CUDA (Linux)
172-
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).
174197
You can then run FFmpeg inside Docker with GPU hardware acceleration enabled, as follows:
198+
175199
```bash
176200
$ sudo docker build --tag=ffmpeg:cuda -f cuda-ubuntu.dockerfile .
177201
$ sudo docker run --gpus all ffmpeg-cuda -hwaccel cuvid -c:v h264_cuvid -i https://files.coconut.co.s3.amazonaws.com/test.mp4 -c:v hevc_nvenc -vf scale_npp=-1:1080 - > test.mp4
@@ -189,13 +213,14 @@ $ ./build-ffmpeg --build
189213

190214
## Cuda installation
191215

192-
CUDA is a parallel computing platform developed by NVIDIA.
193-
To be able to compile ffmpeg with CUDA support, you first need a compatible NVIDIA GPU.
194-
- Ubuntu: To install the CUDA toolkit on Ubuntu, simply run "sudo apt install nvidia-cuda-toolkit"
216+
CUDA is a parallel computing platform developed by NVIDIA. To be able to compile ffmpeg with CUDA support, you first
217+
need a compatible NVIDIA GPU.
218+
219+
- Ubuntu: To install the CUDA toolkit on Ubuntu, run "sudo apt install nvidia-cuda-toolkit"
195220
- Other Linux distributions: Once you have the GPU and display driver installed, you can follow the
196-
[official instructions](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)
197-
or [this blog](https://www.pugetsystems.com/labs/hpc/How-To-Install-CUDA-10-1-on-Ubuntu-19-04-1405/)
198-
to setup the CUDA toolkit.
221+
[official instructions](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)
222+
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.
199224

200225
## Vaapi installation
201226

@@ -223,8 +248,9 @@ Options:
223248
```
224249

225250
## 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
253+
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
228254

229255
- The libnpp in the CUDA SDK cannot be statically linked.
230256
- Vaapi cannot be statically linked.
@@ -234,7 +260,6 @@ Contact
234260

235261
* Github: [http://www.github.com/markus-perl/](https://github.com/markus-perl/ffmpeg-build-script)
236262

237-
238263
Tested on
239264
---------
240265

@@ -693,7 +718,7 @@ avfoundation lavfi
693718
Enabled outdevs:
694719
sdl2
695720
696-
License: nonfree and unredistributable
721+
License: non-free and unredistributable
697722
$ make -j 12
698723
$ make install
699724
@@ -707,12 +732,12 @@ Password:
707732
Done. FFmpeg is now installed to your system.
708733
```
709734

710-
711735
Other Projects Of Mine
712736
------------
737+
713738
- [Pushover CLI Client](https://github.com/markus-perl/pushover-cli)
714739
- [Gender API](https://gender-api.com): [Genderize A Name](https://gender-api.com)
715740
- [Gender API Client PHP](https://github.com/markus-perl/gender-api-client)
716741
- [Gender API Client NPM](https://github.com/markus-perl/gender-api-client-npm)
717742
- [Genderize Names](https://www.youtube.com/watch?v=2SLIAguaygo)
718-
- [Genderize API](https://gender-api.io)
743+
- [Genderize API](https://gender-api.io)

0 commit comments

Comments
 (0)