Emulator Issues #7408
closedDebian compilation of dolphin fails
0%
Description
Compilation isn't successful while using Debian x64.
I've tried with debian testing and debian experimental and get the following error on compilation:
[ 70%] Building CXX object Source/Core/VideoCommon/CMakeFiles/videocommon.dir/AVIDump.cpp.o
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp: In static member function ‘static bool AVIDump::CreateFile()’:
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp:262:24: error: ‘CODEC_ID_FFV1’ was not declared in this scope
g_Config.bUseFFV1 ? CODEC_ID_FFV1 : s_FormatContext->oformat->video_codec;
^
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp:278:15: warning: ‘AVFrame* avcodec_alloc_frame()’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3114) [-Wdeprecated-declarations]
s_BGRFrame = avcodec_alloc_frame();
^
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp:278:35: warning: ‘AVFrame* avcodec_alloc_frame()’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3114) [-Wdeprecated-declarations]
s_BGRFrame = avcodec_alloc_frame();
^
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp:279:15: warning: ‘AVFrame* avcodec_alloc_frame()’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3114) [-Wdeprecated-declarations]
s_YUVFrame = avcodec_alloc_frame();
^
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp:279:35: warning: ‘AVFrame* avcodec_alloc_frame()’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3114) [-Wdeprecated-declarations]
s_YUVFrame = avcodec_alloc_frame();
^
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp: In static member function ‘static void AVIDump::AddFrame(const u8*, int, int)’:
/home/danfun64/dolphin/Source/Core/VideoCommon/AVIDump.cpp:317:85: error: ‘avcodec_encode_video’ was not declared in this scope
int outsize = avcodec_encode_video(s_Stream->codec, s_OutBuffer, s_size, s_YUVFrame);
^
Source/Core/VideoCommon/CMakeFiles/videocommon.dir/build.make:994: recipe for target 'Source/Core/VideoCommon/CMakeFiles/videocommon.dir/AVIDump.cpp.o' failed
make[2]: *** [Source/Core/VideoCommon/CMakeFiles/videocommon.dir/AVIDump.cpp.o] Error 1
CMakeFiles/Makefile2:1050: recipe for target 'Source/Core/VideoCommon/CMakeFiles/videocommon.dir/all' failed
make[1]: *** [Source/Core/VideoCommon/CMakeFiles/videocommon.dir/all] Error 2
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
The issue was reported in the dolphin form as well by another user:
https://forums.dolphin-emu.org/Thread-trouble-compiling-on-debian?pid=328699#pid328699
Updated by nicolaspanti over 10 years ago
I have the same problem on a fresh install of Debian GNU/Linux 8 testing/jessie amd64.
I have found a way to compile dolphin-emu and make it works by using old librairies :
-
Add that to /etc/apt/sources.list with your favorite text editor¶
deb http://ftp.de.debian.org/debian wheezy main
deb http://security.debian.org/debian-security wheezy/updates main - apt-get update # as a root/SuperUser
- apt-get install libavcodec53 libavformat53
- apt-get install libavcodec-dev/wheezy libavformat-dev/wheezy libswscale-dev/wheezy libswscale-dev/wheezy # force old wheezy versions
- make
- apt-get upgrade # dev files are upgraded to current versions, but libavcodec53 and libavformat53 must not be deleted
How solving the problem?
- In libavcodec-dev (6:0.8.12-1)
- libavcodec/libavcodec.h
- int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict);
- libavcodec/version.h
- #define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 35
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR,
LIBAVCODEC_VERSION_MINOR,
LIBAVCODEC_VERSION_MICRO)
#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR,
LIBAVCODEC_VERSION_MINOR,
LIBAVCODEC_VERSION_MICRO)
In libavcodec-dev (6:10.2-1)
- #define LIBAVCODEC_VERSION_MAJOR 53
- libavcodec/libavcodec.h
- no avcodec_encode_video :(
- A new function : int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr);
- libavcodec/version.h
- #define LIBAVCODEC_VERSION_MAJOR 55
#define LIBAVCODEC_VERSION_MINOR 34
#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR,
LIBAVCODEC_VERSION_MINOR,
LIBAVCODEC_VERSION_MICRO)
#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR,
LIBAVCODEC_VERSION_MINOR,
LIBAVCODEC_VERSION_MICRO)
A probably useful commit (when avcodec_encode_video2 appears) : http://ffmpeg.org/pipermail/ffmpeg-cvslog/2012-February/046866.html
So apparently, to solve the problem a simple condition is needed to use the correct function (probably with a constant preprocessor) and avcodec_encode_video2 has to be used with correct arguments. For someone that knows this lib and dolphin-emu code that should be easy.
- #define LIBAVCODEC_VERSION_MAJOR 55
- libavcodec/libavcodec.h
- Moreover, av_frame_alloc should be used instead of avcodec_alloc_frame.
Updated by nicolaspanti over 10 years ago
I have made a fix!
https://github.com/dolphin-emu/dolphin/pull/548