Hello, I’m new here and wanted to compile on my Arch Linux system.
I get the error message:
checking for av_open_input_file in -lavformat... no
configure: error: FFMpeg avformat library not found. Please install it.
Arch Linux always has the newest packages, so I googled av_open_input_file and found it has been deprecated and is no longer included in ffmpeg.
See for example ffmpeg.zeranoe.com/forum/viewtopic.php?f=7&t=461.
The code should be changed to use avformat_open_input instead.
The last parameters to the function have changed, so just changing the name won’t work.
I only just started to find my way through the code, so I don’t know how to do it.
EDIT: I just found that my version of ffmpeg (0.11.1) can play both .bik and .smk videos, at least using ffplay. I would check if they work in VCMI, but I can’t get it to build.
EDIT 2: I got ./configure to work with the patch
diff --git a/configure.ac b/configure.ac
index c5e0332..1428d2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,7 +79,7 @@ FFMPEG_LIBS=
LIBS="$LIBS `pkg-config --libs libavcodec libavformat libavutil libswscale`"
CFLAGS="$CFLAGS `pkg-config --cflags libavformat libswscale`"
-AC_CHECK_LIB(avformat,av_open_input_file,,AC_MSG_ERROR([FFMpeg avformat library not found. Please install it.]))
+AC_CHECK_LIB(avformat,avformat_open_input,,AC_MSG_ERROR([FFMpeg avformat library not found. Please install it.]))
AC_CHECK_LIB(swscale,sws_getContext,,AC_MSG_ERROR([FFMpeg swscale library not found. Please install it.]))
AC_CHECK_LIB(avcodec,avcodec_decode_video2,AVCODEC_DECODE_VIDEO2="-DWITH_AVCODEC_DECODE_VIDEO2",)
AC_CHECK_LIB(avcodec,av_register_protocol2,AV_REGISTER_PROTOCOL2="-DWITH_AV_REGISTER_PROTOCOL2",)
The code already has support for the new api (avformat_open_input).
Another api that was removed from ffmpeg 0.11 is URLContext and URLProtocol. I don’t know what the replacements are. Google is not producing anything useful.
I get this error when compiling:
make[2]: Entering directory `/home/ismo/desktop/vcmi/vcmi/client'
CXX vcmiclient-CVideoHandler.o
CVideoHandler.cpp:587:21: error: ‘URLContext’ was not declared in this scope
CVideoHandler.cpp:587:33: error: ‘context’ was not declared in this scope
CVideoHandler.cpp:587:42: error: expected primary-expression before ‘const’
CVideoHandler.cpp:587:64: error: expected primary-expression before ‘int’
CVideoHandler.cpp:587:73: error: expression list treated as compound expression in initializer -fpermissive]
CVideoHandler.cpp:588:1: error: expected ‘,’ or ‘;’ before ‘{’ token
CVideoHandler.cpp:602:22: error: ‘URLContext’ was not declared in this scope
CVideoHandler.cpp:602:34: error: ‘h’ was not declared in this scope
CVideoHandler.cpp:603:1: error: expected ‘,’ or ‘;’ before ‘{’ token
CVideoHandler.cpp:608:21: error: ‘URLContext’ was not declared in this scope
CVideoHandler.cpp:608:33: error: ‘context’ was not declared in this scope
CVideoHandler.cpp:608:46: error: expected primary-expression before ‘*’ token
CVideoHandler.cpp:608:47: error: ‘buf’ was not declared in this scope
CVideoHandler.cpp:608:52: error: expected primary-expression before ‘int’
CVideoHandler.cpp:608:60: error: expression list treated as compound expression in initializer -fpermissive]
CVideoHandler.cpp:609:1: error: expected ‘,’ or ‘;’ before ‘{’ token
CVideoHandler.cpp:625:22: error: ‘URLContext’ was not declared in this scope
CVideoHandler.cpp:625:34: error: ‘context’ was not declared in this scope
CVideoHandler.cpp:625:48: error: expected primary-expression before ‘pos’
CVideoHandler.cpp:625:53: error: expected primary-expression before ‘int’
CVideoHandler.cpp:625:63: error: expression list treated as compound expression in initializer -fpermissive]
CVideoHandler.cpp:626:1: error: expected ‘,’ or ‘;’ before ‘{’ token
CVideoHandler.cpp:637:8: error: ‘URLProtocol’ does not name a type
CVideoHandler.cpp: In constructor ‘CVideoPlayer::CVideoPlayer()’:
CVideoHandler.cpp:666:25: error: ‘lod_protocol’ was not declared in this scope
CVideoHandler.cpp:666:59: error: ‘av_register_protocol2’ was not declared in this scope
CVideoHandler.cpp: At global scope:
CVideoHandler.cpp:587:12: warning: ‘lod_open’ defined but not used -Wunused-variable]
CVideoHandler.cpp:602:12: warning: ‘lod_close’ defined but not used -Wunused-variable]
CVideoHandler.cpp:608:12: warning: ‘lod_read’ defined but not used -Wunused-variable]
CVideoHandler.cpp:625:13: warning: ‘lod_seek’ defined but not used -Wunused-variable]
make[2]: *** [vcmiclient-CVideoHandler.o] Error 1
make[2]: Leaving directory `/home/ismo/desktop/vcmi/vcmi/client'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ismo/desktop/vcmi/vcmi/client'
make: *** [all-recursive] Error 1
I changed the title because the real problem is URLContext, av_open_input_file has already been fixed, except the bug in configure.