Skip to content

Commit de9a8dd

Browse files
committed
Merge branch 'AkashiSN-vaapi'
1 parent 30d2961 commit de9a8dd

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ ffmpeg-build-script is rockstable. Every commit runs against Linux and MacOS wit
6363

6464

6565
## Requirements
66-
### MacOS
66+
### macOS
6767

6868
* XCode 10.x or greater
6969

7070
### Linux
7171

7272
* Debian >= Buster, Ubuntu => Focal Fossa, other Distributions might work too
73-
* build-essentials, curl is required installed
73+
* A development environment and curl is required
7474

7575
```bash
7676
# Debian and Ubuntu
@@ -102,9 +102,10 @@ $ ./build-ffmpeg --help
102102

103103
### Build in Docker (Linux)
104104

105-
The main advantage of using Docker is the ability to reliably build without polluting the host environment. And you don't even have to install the CUDA SDK on your host!
105+
With Docker, FFmpeg can be built reliably without altering the host system.
106+
Also, there is no need to have the CUDA SDK installed outside of the Docker image.
106107

107-
If you are running below kind of operating system and having Docker version 19.03 or higher, this is your best option.
108+
A Docker engine with version 19.03 or higher is required to build images based on the following distributions:
108109
* Ubuntu >= 16.04 (16.04, 18.04, 20.04)
109110
* Centos >= 7 (7, 8)
110111

@@ -113,13 +114,13 @@ If you are running below kind of operating system and having Docker version 19.0
113114
$ export DOCKER_BUILDKIT=1
114115
```
115116

116-
2. Set the following DIST (`ubuntu` or `centos`) and VER (ubuntu: `16.04` , `18.04`, `20.04` or centos: `7`, `8`) environment variables in conjunction with your operating system.
117+
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.
117118
```bash
118119
$ export DIST=centos
119120
$ export VER=8
120121
```
121122

122-
3. Start the docker build as follows.
123+
3. Start the build as follows.
123124
```bash
124125
$ sudo -E docker build --tag=ffmpeg:cuda-$DIST -f cuda-$DIST.dockerfile --build-arg VER=$VER .
125126
```
@@ -139,26 +140,26 @@ libnppc.so.11 libnppicc.so.11 libnppidei.so.11 libnppig.so.11
139140

140141
### Build in Docker (full static ver.) (Linux)
141142
If you're running an operating system other than the one above, a completely static build may work.
142-
It's easy to do, just run the following command.
143+
To build a full statically linked binary inside Docker, just run the following command:
143144
```bash
144145
$ sudo -E docker build --tag=ffmpeg:cuda-static --output type=local,dest=build -f full-static.dockerfile .
145146
```
146147

147148
### Run with Docker (macOS, Linux)
148-
You can also run the entire Docker if the above two fail.
149+
You can also run the FFmpeg directly inside a Docker container.
149150

150151
#### Default - Without CUDA (macOS, Linux)
151-
If you don't use CUDA, it's simple and runs as follows.
152+
If CUDA is not required, a dockerized FFmpeg build can be executed with the following command:
152153

153154
```bash
154155
$ sudo docker build --tag=ffmpeg .
155156
$ sudo docker run ffmpeg -i https://files.coconut.co.s3.amazonaws.com/test.mp4 -f webm -c:v libvpx -c:a libvorbis - > test.mp4
156157
```
157158

158159
#### With CUDA (Linux)
159-
If you use CUDA, Docker must be higher than 19.03.
160+
To use CUDA from inside the container, the installed Docker version must be >= 19.03.
160161
Install the driver and `nvidia-docker2` from [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#installing-docker-ce).
161-
You can perform hardware acceleration by GPU by running the following.
162+
You can then run FFmpeg inside Docker with GPU hardware acceleration enabled, as follows:
162163
```bash
163164
$ sudo docker build --tag=ffmpeg:cuda -f cuda-ubuntu.dockerfile .
164165
$ 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

build-ffmpeg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ usage () {
159159
echo " --version Display version information"
160160
echo " -b, --build Starts the build process"
161161
echo " -c, --cleanup Remove all working dirs"
162-
echo " -f, --full-static Complete static build of ffmpeg (eg. glibc, pthreads etc...) **only Linux**"
162+
echo " -f, --full-static Build a full static FFmpeg binary (eg. glibc, pthreads etc...) **only Linux**"
163163
echo " Note: Because of the NSS (Name Service Switch), glibc does not recommend static links."
164164
echo ""
165165
}
@@ -184,7 +184,7 @@ while (( $# > 0 )); do
184184
fi
185185
if [[ "$1" == "--full-static" || "$1" =~ 'f' ]]; then
186186
if [[ "$OSTYPE" == "darwin"* ]]; then
187-
echo "Error: full-static mode is available only Linux."
187+
echo "Error: A full static binary can only be build on Linux."
188188
exit 1
189189
fi
190190
LDEXEFLAGS="-static"
@@ -512,7 +512,7 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
512512
CONFIGURE_OPTIONS+=("--nvccflags=-gencode arch=compute_52,code=sm_52")
513513
fi
514514

515-
# Vaapi doesn't work well with static links ffmpeg.
515+
# Vaapi doesn't work well with static links FFmpeg.
516516
if [ -z "$LDEXEFLAGS" ]; then
517517
# If the libva development SDK is installed, enable vaapi.
518518
if library_exists "libva" ; then
@@ -567,11 +567,11 @@ if [[ "$AUTOINSTALL" == "yes" ]]; then
567567
if command_exists "sudo"; then
568568
sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
569569
sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
570-
echo "Done. ffmpeg is now installed to your system."
570+
echo "Done. FFmpeg is now installed to your system."
571571
else
572572
cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
573573
cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
574-
echo "Done. ffmpeg is now installed to your system."
574+
echo "Done. FFmpeg is now installed to your system."
575575
fi
576576
elif [[ ! "$SKIPINSTALL" == "yes" ]]; then
577577
read -r -p "Install the binary to your $INSTALL_FOLDER folder? [Y/n] " response
@@ -584,7 +584,7 @@ elif [[ ! "$SKIPINSTALL" == "yes" ]]; then
584584
cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
585585
cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
586586
fi
587-
echo "Done. ffmpeg is now installed to your system."
587+
echo "Done. FFmpeg is now installed to your system."
588588
;;
589589
esac
590590
fi

0 commit comments

Comments
 (0)