2022-03-14 22:22:33 +00:00
# docker-ffmpeg-gpu
2022-03-14 22:12:32 +00:00
2024-11-04 00:13:14 +00:00
Use `ffmpeg` with `docker` and `nvidia` powers to transcode in Debian GNU/Linux, based on [this nice docker project ](https://git.archive.org/www/ffmpeg-gpu )
2022-03-14 22:12:32 +00:00
(__)
(oo)
/------\/
/ | ||
* /\---/\
~~ ~~
..."Have you mooed today?"...
## Requisites
### This project needs docker and docker-compose working with [nvidia runtime](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html)
## Build
$ git clone https://git.manalejandro.com/ale/docker-ffmpeg-gpu
$ cd docker-ffmpeg-gpu & & docker-compose build --force-rm
2024-11-03 23:43:07 +00:00
## Pull docker image
$ docker pull registry.manalejandro.com/docker-ffmpeg-gpu
2024-11-04 00:13:14 +00:00
$ docker tag registry.manalejandro.com/docker-ffmpeg-gpu docker-ffmpeg-gpu
2024-11-03 23:43:07 +00:00
2022-03-14 22:12:32 +00:00
## Usage
### You can use "/ffmpeg" or "/ffmpeg-pascal" for architecture version
2024-11-04 00:13:14 +00:00
$ docker-compose run --rm docker-ffmpeg-gpu -hwaccels -v 0
2022-03-14 22:12:32 +00:00
Hardware acceleration methods:
vdpau
cuda
vaapi
2022-03-14 23:24:38 +00:00
## Sample using CUDA for encoding:
2022-03-14 22:12:32 +00:00
2024-11-04 00:13:14 +00:00
$ docker-compose run --rm --entrypoint /ffmpeg docker-ffmpeg-gpu -vsync 0 -i /folder/input -c:a copy -c:v h264_nvenc /folder/output
2022-03-14 22:12:32 +00:00
## Full hardware transcode with NVDEC and NVENC:
2024-11-04 00:13:14 +00:00
$ docker-compose run --rm --entrypoint /ffmpeg-pascal docker-ffmpeg-gpu -vsync 0 -hwaccel nvdec -hwaccel_output_format cuda -extra_hw_frames 10 -i /folder/input -c:a copy -c:v h264_nvenc /folder/output
2022-03-14 22:12:32 +00:00
## License
MIT