MakeMKV 1.10.4 - Build Fails FFmpeg-3.2.2 (Ubuntu 15.10)
Posted: Sat Dec 31, 2016 5:00 pm
Followed instructions at: http://www.makemkv.com/forum2/viewtopic.php?f=3&t=224
1. Downloaded FFmpeg from http://ffmpeg.org/releases/ffmpeg-3.2.2.tar.bz2
2. Configured with: ./configure --prefix=/tmp/ffmpeg --enable-static --disable-shared --enable-pic --disable-yasm --enable-libfdk-aac
3. Build Succeeded.
4. Configured makemkv-oss with: PKG_CONFIG_PATH=/tmp/ffmpeg/lib/pkgconfig ./configure
5. Configure failed with:
...
checking whether LIBAVCODEC_VERSION_MAJOR is declared... yes
checking LIBAVCODEC_VERSION_MAJOR... 57
checking for AVFrame.nb_samples... yes
checking whether AV_SAMPLE_FMT_U8P is declared... yes
checking for avcodec_encode_audio2... no
configure: error: The libavcodec library is too old. Please get a recent one from http://www.ffmpeg.org
I then commented out lines 4897-4899 because I believed them to be in error.
6. Reconfigured makemkv-oss with: PKG_CONFIG_PATH=/tmp/ffmpeg/lib/pkgconfig ./configure
7. Configure succeeded. Build failed with:
...
/usr/bin/ld: /usr/local/lib/libfdk-aac.a(aacdecoder_lib.o): relocation R_X86_64_32S against `channelMappingTableWAV' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfdk-aac.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:59: recipe for target 'out/libmakemkv.so.1.full' failed
make: *** [out/libmakemkv.so.1.full] Error 1
8. Used instructions from https://trac.ffmpeg.org/wiki/Compilatio ... libfdk-aac to recompile libfdk-aac from source.
9. Tried again to build makemkv-oss. Failed with:
...
In file included from libffabi/src/ffabi.c:22:0:
/tmp/ffmpeg/include/libavcodec/avcodec.h:5284:5: note: declared here
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
^
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_free':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:829: undefined reference to `XCloseDisplay'
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_create':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:859: undefined reference to `XOpenDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:864: undefined reference to `vaGetDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:871: undefined reference to `XDisplayName'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:861: undefined reference to `XDisplayName'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:885: undefined reference to `vaGetDisplayDRM'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:859: undefined reference to `XOpenDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:861: undefined reference to `XDisplayName'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:866: undefined reference to `XDisplayName'
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_create':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:432: undefined reference to `XOpenDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:438: undefined reference to `XDisplayString'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:440: undefined reference to `XDefaultScreen'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:440: undefined reference to `vdp_device_create_x11'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:434: undefined reference to `XDisplayName'
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_free':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:411: undefined reference to `XCloseDisplay'
collect2: error: ld returned 1 exit status
Makefile:59: recipe for target 'out/libmakemkv.so.1.full' failed
make: *** [out/libmakemkv.so.1.full] Error 1
UPDATE:
The problem was not with avcodec_encode_audio2 but was just a linking issue.
I compiled against the previous stable version of ffmpeg (3.1.6) and the configuration of makemkv-oss worked as expected.
To correct the linking problem change line 15 in the makemkv-oss Makefile (after configure) to:
FFMPEG_LIBS=-L/tmp/ffmpeg/lib -L/usr/local/lib -L/tmp/ffmpeg/lib -lavcodec -lva -lxcb -lxcb-shm -lxcb -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lxcb-shape -lxcb -lasound -lSDL -lfdk-aac -llzma -lz -pthread -lswresample -lavutil -lX11 -lm -lvdpau -lva -lva-drm -lva-x11
SHOUT OUT: http://stackoverflow.com/questions/3899 ... 8#39217028
Happy New Year!
1. Downloaded FFmpeg from http://ffmpeg.org/releases/ffmpeg-3.2.2.tar.bz2
2. Configured with: ./configure --prefix=/tmp/ffmpeg --enable-static --disable-shared --enable-pic --disable-yasm --enable-libfdk-aac
3. Build Succeeded.
4. Configured makemkv-oss with: PKG_CONFIG_PATH=/tmp/ffmpeg/lib/pkgconfig ./configure
5. Configure failed with:
...
checking whether LIBAVCODEC_VERSION_MAJOR is declared... yes
checking LIBAVCODEC_VERSION_MAJOR... 57
checking for AVFrame.nb_samples... yes
checking whether AV_SAMPLE_FMT_U8P is declared... yes
checking for avcodec_encode_audio2... no
configure: error: The libavcodec library is too old. Please get a recent one from http://www.ffmpeg.org
I then commented out lines 4897-4899 because I believed them to be in error.
6. Reconfigured makemkv-oss with: PKG_CONFIG_PATH=/tmp/ffmpeg/lib/pkgconfig ./configure
7. Configure succeeded. Build failed with:
...
/usr/bin/ld: /usr/local/lib/libfdk-aac.a(aacdecoder_lib.o): relocation R_X86_64_32S against `channelMappingTableWAV' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfdk-aac.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:59: recipe for target 'out/libmakemkv.so.1.full' failed
make: *** [out/libmakemkv.so.1.full] Error 1
8. Used instructions from https://trac.ffmpeg.org/wiki/Compilatio ... libfdk-aac to recompile libfdk-aac from source.
9. Tried again to build makemkv-oss. Failed with:
...
In file included from libffabi/src/ffabi.c:22:0:
/tmp/ffmpeg/include/libavcodec/avcodec.h:5284:5: note: declared here
int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
^
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_free':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:829: undefined reference to `XCloseDisplay'
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_create':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:859: undefined reference to `XOpenDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:864: undefined reference to `vaGetDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:871: undefined reference to `XDisplayName'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:861: undefined reference to `XDisplayName'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:885: undefined reference to `vaGetDisplayDRM'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:859: undefined reference to `XOpenDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:861: undefined reference to `XDisplayName'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vaapi.c:866: undefined reference to `XDisplayName'
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_create':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:432: undefined reference to `XOpenDisplay'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:438: undefined reference to `XDisplayString'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:440: undefined reference to `XDefaultScreen'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:440: undefined reference to `vdp_device_create_x11'
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:434: undefined reference to `XDisplayName'
/tmp/ffmpeg/lib/libavutil.a(hwcontext_vdpau.o): In function `vdpau_device_free':
/home/eliot/Documents/MakeMKV_Source/ffmpeg-3.2.2/libavutil/hwcontext_vdpau.c:411: undefined reference to `XCloseDisplay'
collect2: error: ld returned 1 exit status
Makefile:59: recipe for target 'out/libmakemkv.so.1.full' failed
make: *** [out/libmakemkv.so.1.full] Error 1
UPDATE:
The problem was not with avcodec_encode_audio2 but was just a linking issue.
I compiled against the previous stable version of ffmpeg (3.1.6) and the configuration of makemkv-oss worked as expected.
To correct the linking problem change line 15 in the makemkv-oss Makefile (after configure) to:
FFMPEG_LIBS=-L/tmp/ffmpeg/lib -L/usr/local/lib -L/tmp/ffmpeg/lib -lavcodec -lva -lxcb -lxcb-shm -lxcb -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lxcb-shape -lxcb -lasound -lSDL -lfdk-aac -llzma -lz -pthread -lswresample -lavutil -lX11 -lm -lvdpau -lva -lva-drm -lva-x11
SHOUT OUT: http://stackoverflow.com/questions/3899 ... 8#39217028
Happy New Year!