lutris / ffmpeg-nvenc

Build script for FFmpeg with nvenc support
GNU General Public License v3.0
140 stars 45 forks source link

Error compiling on Ubuntu 16.04 #19

Open jedrekdomanski opened 6 years ago

jedrekdomanski commented 6 years ago

The script fails on Ubuntu 16.04. Output log below.

In file included from /home/jedrek/Dokumenty/Nvenc/include/fdk-aac/FDK_audio.h:98:0, from /home/jedrek/Dokumenty/Nvenc/include/fdk-aac/aacdecoder_lib.h:347, from libavcodec/libfdk-aacdec.c:20: /home/jedrek/Dokumenty/Nvenc/include/fdk-aac/genericStds.h:402:5: warning: ‘IS_LITTLE_ENDIAN’ defined but not used [-Wunused-function] int IS_LITTLE_ENDIAN(void) { ^ CC libavcodec/libmp3lame.o In file included from /home/jedrek/Dokumenty/Nvenc/include/fdk-aac/FDK_audio.h:98:0, from /home/jedrek/Dokumenty/Nvenc/include/fdk-aac/aacenc_lib.h:706, from libavcodec/libfdk-aacenc.c:20: /home/jedrek/Dokumenty/Nvenc/include/fdk-aac/genericStds.h:402:5: warning: ‘IS_LITTLE_ENDIAN’ defined but not used [-Wunused-function] int IS_LITTLE_ENDIAN(void) { ^ CC libavcodec/libopus.o CC libavcodec/libopusdec.o CC libavcodec/libopusenc.o CC libavcodec/libtheoraenc.o CC libavcodec/libvorbisdec.o CC libavcodec/libvorbisenc.o CC libavcodec/libvpx.o CC libavcodec/libvpxdec.o CC libavcodec/libvpxenc.o CC libavcodec/libx264.o CC libavcodec/ljpegenc.o libavcodec/libx264.c: In function ‘X264_frame’: libavcodec/libx264.c:282:9: error: ‘x264_bit_depth’ undeclared (first use in this function) if (x264_bit_depth > 8) ^ libavcodec/libx264.c:282:9: note: each undeclared identifier is reported only once for each function it appears in libavcodec/libx264.c: In function ‘X264_init_static’: libavcodec/libx264.c:892:9: error: ‘x264_bit_depth’ undeclared (first use in this function) if (x264_bit_depth == 8) ^ common.mak:60: polecenia dla obiektu 'libavcodec/libx264.o' failed make: [libavcodec/libx264.o] Exit code 1 make: Waiting to terminate the task....

kingprimex commented 6 years ago

It is a bug in ffmpeg version. It still is in 3.4.

bnku commented 6 years ago

Use the actual snapshot of ffmpeg from https://ffmpeg.org/releases/ffmpeg-snapshot-git.tar.bz2

jedrekdomanski commented 6 years ago

@bnku I've taken a look at the bash script and I see that the script uses version 3.1, here's the code.

ffmpeg_version="3.1"
if [ ! -f  ffmpeg-${ffmpeg_version}.tar.bz2 ]; then
  wget -4 http://ffmpeg.org/releases/ffmpeg-${ffmpeg_version}.tar.bz
fi

So I changed the script to use ffmpeg-snapshot-git.tar.bz2 version - as you suggest - but it errors out during configurations at line 201 --enable-x11grab.

Unknown option "--enable-x11grab".
See ./configure --help for available options.

Correct me if I am wrong.

bnku commented 6 years ago

use the --enable-libxcb instead

jedrekdomanski commented 6 years ago

After applying certain modifications to the script, it compiles everything fine. Here is the the modified parts of the script and a screen shot confirming it all works fine.

BuildFFmpeg() {
    echo "Compiling ffmpeg"
    cd $source_dir
    ffmpeg_version="snapshot-git"
    if [ ! -f  ffmpeg-${ffmpeg_version}.tar.bz2 ]; then
        wget -4 http://ffmpeg.org/releases/ffmpeg-${ffmpeg_version}.tar.bz2
    fi
    tar xjf ffmpeg-${ffmpeg_version}.tar.bz2
    cd ffmpeg
    PKG_CONFIG_PATH="${build_dir}/lib/pkgconfig" ./configure \
        --prefix="$build_dir" \
        --extra-cflags="-fPIC -m64 -I${inc_dir}" \
        --extra-ldflags="-L${build_dir}/lib" \
        --bindir="$bin_dir" \
        --enable-gpl \
        --enable-libass \
        --enable-libfdk-aac \
        --enable-libfreetype \
        --enable-libmp3lame \
        --enable-libopus \
        --enable-libtheora \
        --enable-libvorbis \
        --enable-libvpx \
        --enable-libx264 \
        --enable-nonfree \
        --enable-nvenc \
        --enable-pic \
        --enable-libxcb \
        --extra-ldexeflags=-pie \
        --enable-shared
    make -j${cpus}
    make install
}

I also removed my previous installation of OBS and now the new installation has NVENC.H264 encoder. obs