2

I am trying to build ffmpeg with dav1d. I've successfully built davit using the following commands:

git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && cd build && \
meson .. && \
ninja

After that, I am running a config command for the FFmpeg and get the error:

PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure \
    --prefix="/app/ffmpeg_build" \
    --pkg-config-flags="--static" \
    --extra-cflags="-I/app/ffmpeg_build/include" \
    --extra-ldflags="-L/app/ffmpeg_build/lib" \
    --extra-libs="-lpthread -lm" \
    --bindir="/usr/local/bin" \
    --enable-gpl \
    --enable-libass \
    --enable-libmp3lame \
    --enable-libfreetype \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libx264 \
    --enable-libdav1d \
    --enable-nonfree

(All other libs are installed and FFmpeg configures and builds correctly with them if I omit --enable-libdav1d, but in case of the above command I get):

ERROR: dav1d >= 0.2.1 not found using pkg-config

I think the reason could be that meson puts bin files in the wrong directory. Could anyone please help?

P.S. I am using Ubuntu 18.04.

Example of build commands for the other libs:

git -C x264 pull 2> /dev/null || git clone --depth 1 https://code.videolan.org/videolan/x264.git && \
cd x264 && \
PKG_CONFIG_PATH="/app/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/app/ffmpeg_build" --bindir="/usr/local/bin" --enable-static --enable-pic && \
make && \
make install
Dmitry Maksakov
  • 1,591
  • 1
  • 16
  • 22
  • 1
    Missing path to the "package config file" = dav1d.pc : Assume `sudo ninja install` to **/usr/local/** .... You can do `sudo cp /usr/local/lib/pkgconfig/dav1d.pc /usr/lib/pkgconfig/` .... Or copy from `dav1d/build/meson-private/dav1d.pc` – Knud Larsen Apr 23 '20 at 14:01
  • `sudo ninja install` made the trick. Thanks, Knud! – Dmitry Maksakov Apr 23 '20 at 16:30

1 Answers1

3

To pass the build you have to add ninja install:

git clone --depth=1 https://code.videolan.org/videolan/dav1d.git && \
cd dav1d && \
mkdir build && cd build && \
meson --bindir="/usr/local/bin" .. && \
ninja && \
ninja install

But this not enough, if you run FFmpeg after, you'll get:

ffmpeg: error while loading shared libraries: libdav1d.so.4: cannot open shared object file: No such file or directory

To fix this issue add /usr/local/lib/x86_64-linux-gnu to the LD_LIBRARY_PATH:

export LD_LIBRARY_PATH+=":/usr/local/lib/x86_64-linux-gnu"
Dmitry Maksakov
  • 1,591
  • 1
  • 16
  • 22
  • you could also add `--default-library=static` in the `meson` call and avoid updating `LD_LIBRARY_PATH` – Kostis Oct 20 '20 at 22:25