Skip to content

Commit e1c8205

Browse files
authored
Merge pull request #66 from AkashiSN/master
Add webp support and enable ffplay
2 parents e7140e2 + 9edcb61 commit e1c8205

File tree

7 files changed

+76
-19
lines changed

7 files changed

+76
-19
lines changed

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,22 @@ RUN SKIPINSTALL=yes /app/build-ffmpeg --build
1414

1515
FROM ubuntu:20.04
1616

17+
ENV DEBIAN_FRONTEND noninteractive
18+
1719
# install va-driver
1820
RUN apt-get update \
1921
&& apt-get -y install libva-drm2 \
2022
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
2123

24+
# Copy ffmpeg
2225
COPY --from=build /app/workspace/bin/ffmpeg /usr/bin/ffmpeg
2326
COPY --from=build /app/workspace/bin/ffprobe /usr/bin/ffprobe
27+
COPY --from=build /app/workspace/bin/ffplay /usr/bin/ffplay
2428

25-
RUN ldd /usr/bin/ffmpeg ; exit 0
26-
RUN ldd /usr/bin/ffprobe ; exit 0
29+
# Check shared library
30+
RUN ldd /usr/bin/ffmpeg
31+
RUN ldd /usr/bin/ffprobe
32+
RUN ldd /usr/bin/ffplay
2733

2834
CMD ["--help"]
2935
ENTRYPOINT ["/usr/bin/ffmpeg"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ $ sudo -E docker build --tag=ffmpeg:cuda-$DIST -f cuda-$DIST.dockerfile --build-
129129
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.
130130

131131
```bash
132-
$ sudo -E docker build --output type=local,dest=build -f export.dockerfile .
132+
$ sudo -E docker build --output type=local,dest=build -f export.dockerfile --build-arg DIST=$DIST .
133133
$ ls build
134134
bin lib
135135
$ ls build/bin

build-ffmpeg

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,36 @@ fi
467467
CONFIGURE_OPTIONS+=("--enable-libfdk-aac")
468468

469469

470+
##
471+
## image library
472+
##
473+
474+
if build "libwebp"; then
475+
download "https://github.com/webmproject/libwebp/archive/v1.1.0.tar.gz" "libwebp-1.1.0.tar.gz"
476+
make_dir build
477+
cd build || exit
478+
execute cmake -DCMAKE_INSTALL_PREFIX="${WORKSPACE}" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_BINDIR=bin -DCMAKE_INSTALL_INCLUDEDIR=include -DENABLE_SHARED=OFF -DENABLE_STATIC=ON ../
479+
execute make -j $MJOBS
480+
execute make install
481+
482+
build_done "libwebp"
483+
fi
484+
CONFIGURE_OPTIONS+=("--enable-libwebp")
485+
486+
470487
##
471488
## other library
472489
##
473490

491+
if build "libsdl"; then
492+
download "https://www.libsdl.org/release/SDL2-2.0.12.tar.gz"
493+
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
494+
execute make -j $MJOBS
495+
execute make install
496+
497+
build_done "libsdl"
498+
fi
499+
474500
if build "srt"; then
475501
download "https://github.com/Haivision/srt/archive/v1.4.1.tar.gz" "srt-1.4.1.tar.gz"
476502
export OPENSSL_ROOT_DIR="${WORKSPACE}"
@@ -535,7 +561,6 @@ download "https://ffmpeg.org/releases/ffmpeg-4.3.1.tar.bz2"
535561
./configure "${CONFIGURE_OPTIONS[@]}" \
536562
--disable-debug \
537563
--disable-doc \
538-
--disable-ffplay \
539564
--disable-shared \
540565
--enable-gpl \
541566
--enable-nonfree \

cuda-centos.dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ ARG VER=8
22

33
FROM nvidia/cuda:11.1-devel-centos${VER} AS build
44

5-
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
5+
ENV NVIDIA_VISIBLE_DEVICES all
6+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
67

78
RUN yum group install -y "Development Tools" \
89
&& yum install -y curl libva-devel \
@@ -17,6 +18,9 @@ RUN SKIPINSTALL=yes /app/build-ffmpeg --build
1718

1819
FROM centos:${VER}
1920

21+
ENV NVIDIA_VISIBLE_DEVICES all
22+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
23+
2024
# install va-driver
2125
RUN yum install -y libva \
2226
&& rm -rf /var/cache/yum/* \
@@ -31,9 +35,12 @@ COPY --from=build /usr/local/cuda-11.1/targets/x86_64-linux/lib/libnppidei.so.11
3135
# Copy ffmpeg
3236
COPY --from=build /app/workspace/bin/ffmpeg /usr/bin/ffmpeg
3337
COPY --from=build /app/workspace/bin/ffprobe /usr/bin/ffprobe
38+
COPY --from=build /app/workspace/bin/ffplay /usr/bin/ffplay
3439

35-
RUN ldd /usr/bin/ffmpeg ; exit 0
36-
RUN ldd /usr/bin/ffprobe ; exit 0
40+
# Check shared library
41+
RUN ldd /usr/bin/ffmpeg
42+
RUN ldd /usr/bin/ffprobe
43+
RUN ldd /usr/bin/ffplay
3744

3845
CMD ["--help"]
3946
ENTRYPOINT ["/usr/bin/ffmpeg"]

cuda-ubuntu.dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ ARG VER=20.04
33
FROM nvidia/cuda:11.1-devel-ubuntu${VER} AS build
44

55
ENV DEBIAN_FRONTEND noninteractive
6-
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
6+
ENV NVIDIA_VISIBLE_DEVICES all
7+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
78

89
RUN apt-get update \
910
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates libva-dev \
@@ -18,6 +19,10 @@ RUN SKIPINSTALL=yes /app/build-ffmpeg --build
1819

1920
FROM ubuntu:${VER}
2021

22+
ENV DEBIAN_FRONTEND noninteractive
23+
ENV NVIDIA_VISIBLE_DEVICES all
24+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
25+
2126
# install va-driver
2227
RUN apt-get update \
2328
&& apt-get -y install libva-drm2 \
@@ -32,9 +37,12 @@ COPY --from=build /usr/local/cuda-11.1/targets/x86_64-linux/lib/libnppidei.so.11
3237
# Copy ffmpeg
3338
COPY --from=build /app/workspace/bin/ffmpeg /usr/bin/ffmpeg
3439
COPY --from=build /app/workspace/bin/ffprobe /usr/bin/ffprobe
40+
COPY --from=build /app/workspace/bin/ffplay /usr/bin/ffplay
3541

36-
RUN ldd /usr/bin/ffmpeg ; exit 0
37-
RUN ldd /usr/bin/ffprobe ; exit 0
42+
# Check shared library
43+
RUN ldd /usr/bin/ffmpeg
44+
RUN ldd /usr/bin/ffprobe
45+
RUN ldd /usr/bin/ffplay
3846

3947
CMD ["--help"]
4048
ENTRYPOINT ["/usr/bin/ffmpeg"]

export.dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
ARG DIST=ubuntu
2+
13
FROM scratch
24

35
# Copy libnpp
4-
COPY --from=ffmpeg:cuda /lib/x86_64-linux-gnu/libnppc.so.11 /lib/libnppc.so.11
5-
COPY --from=ffmpeg:cuda /lib/x86_64-linux-gnu/libnppig.so.11 /lib/libnppig.so.11
6-
COPY --from=ffmpeg:cuda /lib/x86_64-linux-gnu/libnppicc.so.11 /lib/libnppicc.so.11
7-
COPY --from=ffmpeg:cuda /lib/x86_64-linux-gnu/libnppidei.so.11 /lib/libnppidei.so.11
6+
COPY --from=ffmpeg:cuda-${DIST} /lib/x86_64-linux-gnu/libnppc.so.11 /lib/libnppc.so.11
7+
COPY --from=ffmpeg:cuda-${DIST} /lib/x86_64-linux-gnu/libnppig.so.11 /lib/libnppig.so.11
8+
COPY --from=ffmpeg:cuda-${DIST} /lib/x86_64-linux-gnu/libnppicc.so.11 /lib/libnppicc.so.11
9+
COPY --from=ffmpeg:cuda-${DIST} /lib/x86_64-linux-gnu/libnppidei.so.11 /lib/libnppidei.so.11
810

911
# Copy ffmpeg
10-
COPY --from=ffmpeg:cuda /usr/bin/ffmpeg /bin/ffmpeg
11-
COPY --from=ffmpeg:cuda /usr/bin/ffprobe /bin/ffprobe
12+
COPY --from=ffmpeg:cuda-${DIST} /usr/bin/ffmpeg /bin/ffmpeg
13+
COPY --from=ffmpeg:cuda-${DIST} /usr/bin/ffprobe /bin/ffprobe
14+
COPY --from=ffmpeg:cuda-${DIST} /usr/bin/ffplay /bin/ffplay

full-static.dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM nvidia/cuda:11.1-devel-ubuntu20.04 AS build
22

33
ENV DEBIAN_FRONTEND noninteractive
4-
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
4+
ENV NVIDIA_VISIBLE_DEVICES all
5+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
56

67
RUN apt-get update \
78
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates \
@@ -13,13 +14,20 @@ COPY ./build-ffmpeg /app/build-ffmpeg
1314

1415
RUN AUTOINSTALL=yes /app/build-ffmpeg --build --full-static
1516

16-
RUN ldd /app/workspace/bin/ffmpeg ; exit 0
17-
RUN ldd /app/workspace/bin/ffprobe ; exit 0
17+
# Check shared library
18+
RUN ! ldd /app/workspace/bin/ffmpeg
19+
RUN ! ldd /app/workspace/bin/ffprobe
20+
RUN ! ldd /app/workspace/bin/ffplay
1821

1922
FROM scratch
2023

24+
ENV NVIDIA_VISIBLE_DEVICES all
25+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
26+
27+
# Copy ffmpeg
2128
COPY --from=build /app/workspace/bin/ffmpeg /ffmpeg
2229
COPY --from=build /app/workspace/bin/ffprobe /ffprobe
30+
COPY --from=build /app/workspace/bin/ffplay /ffplay
2331

2432
CMD ["--help"]
2533
ENTRYPOINT ["/ffmpeg"]

0 commit comments

Comments
 (0)