-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (22 loc) · 1.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Building layer
FROM nvidia/cuda:12.0.0-cudnn8-devel-ubuntu22.04 AS cv_ffmpeg_builder
MAINTAINER CVision AI <[email protected]>
RUN apt update && apt install -y --no-install-recommends libx264-dev libx265-dev git yasm pkg-config
WORKDIR /working
RUN git clone --branch n12.0.16.0 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
RUN git clone --branch n6.0 https://github.com/FFmpeg/FFmpeg.git
WORKDIR /working/nv-codec-headers
RUN make install
WORKDIR /working/FFmpeg
RUN ./configure --prefix=/opt/nvenc --enable-cuda --enable-cuvid --extra-cflags="-I/usr/local/cuda/include" --extra-ldflags="-L/usr/local/cuda/lib64" --enable-nonfree --enable-libnpp
RUN make -j16 && make install
# Deployment layer
FROM nvidia/cuda:12.0.0-cudnn8-runtime-ubuntu22.04 AS cv_ffmpeg_nvenc
RUN apt-get update && apt-get install -y --no-install-recommends libx264. libx265.
COPY --from=cv_ffmpeg_builder /opt/nvenc /opt/nvenc
ENV PATH="/opt/nvenc/bin:${PATH}"
# By default NVIDIA image only enables compute,utility
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
WORKDIR /working
ENTRYPOINT ["ffmpeg"]
CMD ["-h"]