mpv-player/mpv-build

--enable-dav1d is not working

acedogblast opened this issue · 12 comments

When using this script to build mpv with --enable-libdav1d for the ffmpeg options it does not add dav1d av1 decoder into the ffmpeg build. Checked using ./ffmpeg -decoders. It should have this V..... libdav1d dav1d AV1 decoder by VideoLAN (codec av1) but it does not. I have installed libdav1d-dev on my system.

it's --enable-libdav1d. Your ffmpeg build probably failed because of this and you didn't notice.

Sorry it was --enable-libdav1d but I misspelled it in the issue. Regardless it still does not work. The script for me failed on building mpv on that part that links libplacebo but it finished the ffmpeg build.

A few things to check:

  • is your file really called ffmpeg_options?
  • is there a line #define CONFIG_LIBDAV1D 1 in ffmpeg_build/config.h?
  • What is the output of pkg-config --path dav1d?
  • Are you running ./ffmpeg -decoders in the right directory, i.e. ffmpeg_build?
  • Did you run ./rebuild -j$(nproc) after adding the option to ffmpeg_options?

It seems my ffmpeg_build/config.h is #define CONFIG_LIBDAV1D 0. I assume it should be 1? I did not modify this config file myself. Going to rebuild and see if it fixes it.

Strange rebuilding sets #define CONFIG_LIBDAV1D back to 0.

that's because your ffmpeg configure step isn't picking up libdav1d. Please check the other things, particularly the filename of ffmpeg_options.

The file is named "ffmpeg_options" and the only line in it is "--enable-libdav1d". But I think I found my problem
pkg-config does not have --path as an option. There is --exists which returns nothing so I assume that libdav1d-dev is not installed but apt says it is: libdav1d-dev is already the newest version (0.9.2-0xneon+20.04+focal+release+build2).

There is a dav1d folder in /usr/include/dav1d/ along with several header files.

If you explicitly enable building with libdav1d like this, ffmpeg would fail during configure if it didn't find it. Make sure that in the ffmpeg part of the output, you see an --enable-libdav1d scroll by somewhere.

Ok I think I found the problem. If I have multiple enables in the ffmpeg_options file and if one or more of the enables do not work such as "--enable-libx265" the other enables do not get configured. Additionally on the built ffmpeg banner is this:
ffmpeg version N-107738-g109515e16d Copyright (c) 2000-2022 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1) configuration: --prefix=/home/charles/Apps/mpv-build/build_libs --enable-gpl --disable-debug --disable-doc --enable-static --disable-shared --enable-pic --enable-gnutls '--enable-libdav1d --enable-libx264 --enable-libx265 --enable-libopus --enable-libass'
Notice how there is a single quotes around several enables.

Solved. It turns out that for each --enable option needs to be on their own line in the ffmpeg_options file. Before I had them in the same line which caused the script to treat the whole line as a single option which is a problem.

garoto commented

[...] each --enable option needs to be on their own line [...]

gee bro