ffmpeg-build-script icon indicating copy to clipboard operation
ffmpeg-build-script copied to clipboard

Compiling using Docker throws error invalid reference format

Open Artim96 opened this issue 2 years ago • 3 comments
trafficstars

So I gave up trying to compile without Docker because pkg-config is a moron. Now I tried to compile using Docker, but either I'm missing something or something is broken. I built the image with docker build --tag=ffmpeg:cuda-$DIST -f /opt/ffmpeg-build-script/cuda-ubunu.dockerfile . (absolute path for the dockerfile was necessary, also setting --build-arg without anything after it but the dot only threw an error ("docker buildx build" requires exactly 1 argument)). After that finished I ran docker build --output type=local,dest=build -f export.dockerfile --build-arg DIST=$DIST . but that led only to this error

docker build --output type=local,dest=build -f export.dockerfile --build-arg DIST=$DIST .
[+] Building 0.0s (2/2) FINISHED
 => [internal] load build definition from export.dockerfile                                                                                    0.0s
 => => transferring dockerfile: 647B                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                              0.0s
 => => transferring context: 60B                                                                                                               0.0s
export.dockerfile:14
--------------------
  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
--------------------
ERROR: failed to solve: failed to parse stage name "ffmpeg:cuda-${DIST}": invalid reference format

Artim96 avatar Mar 05 '23 17:03 Artim96

Please try the following command: docker build --tag=ffmpeg:cuda -f cuda-ubuntu.dockerfile .

markus-perl avatar Mar 06 '23 16:03 markus-perl

This does work. But this doesn't create a ffmpeg binary.

Artim96 avatar Mar 06 '23 18:03 Artim96

Compiling works now with docker build --output type=local,dest=build --tag=ffmpeg:cuda -f cuda-ubuntu.dockerfile .

But I'm not sure if it actually does what it should do (or at least what I thought it would do). It seems to be only compiling with vaapi support, no other hardware accelerators.

16:56:30 user@pc01:/opt/ffmpeg-build-script# build/bin/ffmpeg -help
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
  configuration: --enable-nonfree --enable-gpl --enable-openssl --enable-libdav1d --enable-libsvtav1 --enable-libx264 --enable-libx265 --enable-libvpx --enable-libxvid --enable-libvidstab --enable-libaom --enable-libzimg --enable-lv2 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora --enable-libfdk-aac --enable-libwebp --enable-libsrt --enable-amf --disable-debug --disable-doc --disable-shared --enable-pthreads --enable-static --enable-small --enable-version3 --disable-ffnvcodec --extra-cflags='-I/app/workspace/include -I/app/workspace/include/lilv-0' --extra-ldexeflags= --extra-ldflags=-L/app/workspace/lib --extra-libs='-ldl -lpthread -lm -lz' --pkgconfigdir=/app/workspace/lib/pkgconfig --pkg-config-flags=--static --prefix=/app/workspace --extra-version=
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Hardware acceleration methods:
vaapi

in the list of encoders there's also only entries with _vaapi, none with _nvenc.

Artim96 avatar Mar 10 '23 16:03 Artim96