Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvidia nvenc/nvdec support added #168

Merged
merged 7 commits into from
May 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,55 @@ env:
- VERSION=snapshot VARIANT=centos
- VERSION=snapshot VARIANT=scratch
- VERSION=snapshot VARIANT=vaapi
- VERSION=snapshot VARIANT=nvidia
- VERSION=4.1 VARIANT=ubuntu
- VERSION=4.1 VARIANT=alpine
- VERSION=4.1 VARIANT=centos
- VERSION=4.1 VARIANT=scratch
- VERSION=4.1 VARIANT=vaapi
- VERSION=4.1 VARIANT=nvidia
- VERSION=4.0 VARIANT=ubuntu
- VERSION=4.0 VARIANT=alpine
- VERSION=4.0 VARIANT=centos
- VERSION=4.0 VARIANT=scratch
- VERSION=4.0 VARIANT=vaapi
- VERSION=4.0 VARIANT=nvidia
- VERSION=3.4 VARIANT=ubuntu
- VERSION=3.4 VARIANT=alpine
- VERSION=3.4 VARIANT=centos
- VERSION=3.4 VARIANT=scratch
- VERSION=3.4 VARIANT=vaapi
- VERSION=3.4 VARIANT=nvidia
- VERSION=3.3 VARIANT=ubuntu
- VERSION=3.3 VARIANT=alpine
- VERSION=3.3 VARIANT=centos
- VERSION=3.3 VARIANT=scratch
- VERSION=3.3 VARIANT=vaapi
- VERSION=3.3 VARIANT=nvidia
- VERSION=3.2 VARIANT=ubuntu
- VERSION=3.2 VARIANT=alpine
- VERSION=3.2 VARIANT=centos
- VERSION=3.2 VARIANT=scratch
- VERSION=3.2 VARIANT=vaapi
- VERSION=3.2 VARIANT=nvidia
- VERSION=3.1 VARIANT=ubuntu
- VERSION=3.1 VARIANT=alpine
- VERSION=3.1 VARIANT=centos
- VERSION=3.1 VARIANT=scratch
- VERSION=3.1 VARIANT=vaapi
- VERSION=3.1 VARIANT=nvidia
- VERSION=3.0 VARIANT=ubuntu
- VERSION=3.0 VARIANT=alpine
- VERSION=3.0 VARIANT=centos
- VERSION=3.0 VARIANT=scratch
- VERSION=3.0 VARIANT=vaapi
- VERSION=3.0 VARIANT=nvidia
- VERSION=2.8 VARIANT=ubuntu
- VERSION=2.8 VARIANT=alpine
- VERSION=2.8 VARIANT=centos
- VERSION=2.8 VARIANT=scratch
- VERSION=2.8 VARIANT=vaapi
- VERSION=2.8 VARIANT=nvidia

branches:
only:
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ Thanks to [qmfrederik](https://github.com/qmfrederik) for the vaapi ubuntu based
- Run ffmpeg with the correct parameters, this is the same as when running [ffmpeg natively](https://trac.ffmpeg.org/wiki/Hardware/VAAPI).


#### Use nvidia hardware acceleration enabled build
Supports nvenc only on all ffmpeg versions, and hardware decoding and scaling on ffmpeg >= 4.0

- Install nvidia latest drivers on host machine.
- Install [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) on host machine.
- Run container using "--runtime=nvidia" flag and use supported [ffmpeg hwaccel options](https://trac.ffmpeg.org/wiki/HWAccelIntro)

Hardware encoding only example:
`docker run --runtime=nvidia jrottenberg/ffmpeg:nvidia-2.8 -i INPUT -c:v nvenc_h264 -preset hq OUTPUT`
Full hardware acceleration example:
`docker run --runtime=nvidia jrottenberg/ffmpeg:nvidia-4.1 -hwaccel cuvid -c:v h264_cuvid -i INPUT -vf scale_npp=-1:720 -c:v h264_nvenc -preset slow OUTPUT`

See what's inside the beast
---------------------------

Expand Down
27 changes: 27 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
snapshot_vaapi:
VERSION: snapshot
VARIANT: vaapi
snapshot_nvidia:
VERSION: snapshot
VARIANT: nvidia
4_1_ubuntu:
VERSION: 4.1
VARIANT: ubuntu
Expand All @@ -35,6 +38,9 @@ jobs:
4_1_vaapi:
VERSION: 4.1
VARIANT: vaapi
4_1_nvidia:
VERSION: 4.1
VARIANT: nvidia
4_0_ubuntu:
VERSION: 4.0
VARIANT: ubuntu
Expand All @@ -50,6 +56,9 @@ jobs:
4_0_vaapi:
VERSION: 4.0
VARIANT: vaapi
4_0_nvidia:
VERSION: 4.0
VARIANT: nvidia
3_4_ubuntu:
VERSION: 3.4
VARIANT: ubuntu
Expand All @@ -65,6 +74,9 @@ jobs:
3_4_vaapi:
VERSION: 3.4
VARIANT: vaapi
3_4_nvidia:
VERSION: 3.4
VARIANT: nvidia
3_3_ubuntu:
VERSION: 3.3
VARIANT: ubuntu
Expand All @@ -80,6 +92,9 @@ jobs:
3_3_vaapi:
VERSION: 3.3
VARIANT: vaapi
3_3_nvidia:
VERSION: 3.3
VARIANT: nvidia
3_2_ubuntu:
VERSION: 3.2
VARIANT: ubuntu
Expand All @@ -95,6 +110,9 @@ jobs:
3_2_vaapi:
VERSION: 3.2
VARIANT: vaapi
3_2_nvidia:
VERSION: 3.2
VARIANT: nvidia
3_1_ubuntu:
VERSION: 3.1
VARIANT: ubuntu
Expand All @@ -110,6 +128,9 @@ jobs:
3_1_vaapi:
VERSION: 3.1
VARIANT: vaapi
3_1_nvidia:
VERSION: 3.1
VARIANT: nvidia
3_0_ubuntu:
VERSION: 3.0
VARIANT: ubuntu
Expand All @@ -125,6 +146,9 @@ jobs:
3_0_vaapi:
VERSION: 3.0
VARIANT: vaapi
3_0_nvidia:
VERSION: 3.0
VARIANT: nvidia
2_8_ubuntu:
VERSION: 2.8
VARIANT: ubuntu
Expand All @@ -140,6 +164,9 @@ jobs:
2_8_vaapi:
VERSION: 2.8
VARIANT: vaapi
2_8_nvidia:
VERSION: 2.8
VARIANT: nvidia
steps:
- script: |
docker build -t ffmpeg:${VERSION}-${VARIANT} --build-arg MAKEFLAGS="-j$(($(grep -c ^processor /proc/cpuinfo) + 1))" docker-images/${VERSION}/${VARIANT}
Expand Down
Loading