Hello, I'm new here and wanted to compile on my Arch Linux system.
I get the error message:
Code:
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 http://ffmpeg.zeranoe.com...c.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.
-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:
Code:
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.
Age: 21 Joined: 08 May 2009 Posts: 713 Location: Ukraine
Posted: 2012-08-18, 11:30
Thanks for report, should be fixed in rev 2832.
Problem was with ffmpeg detection - code should be fine.
We do have some deprecation issues with ffmpeg but I want to avoid fixing it right now - too many changes and we have to support old versions as well (e.g. Debian).
Quote:
EDIT: I just found that my version of ffmpeg (0.11.1) can play both .bik and .smk videos, at least using ffplay
Age: 21 Joined: 08 May 2009 Posts: 713 Location: Ukraine
Posted: 2012-08-18, 11:44
Yes but right now it is used only for 64-bit Windows. Should be easy to change.
Url protocol removal is a bit problematic. It does have replacement (avioContext) but it requires quite large amount of changes and not yet available in Debian Squeeze and Ubuntu Natty (they still use ffmpeg 0.5).
I'll start working on replacement but not sure when I'll finish it. One or two weeks I think.
I would suggest removing the current Windows player and using ffmpeg instead.
The build could check if ffmpeg is available and if not use the empty player.
This would make the code simpler, because only three players are needed: empty, old ffmpeg and new ffmpeg.
Age: 21 Joined: 08 May 2009 Posts: 713 Location: Ukraine
Posted: 2012-08-18, 12:31
Try rev 2833 - VCMI should use empty video player if av_register_protocol is missing.
Quote:
Why can 64-bit Windows not use ffmpeg?
I found out about full bink support only a few weeks ago. Before this switching to ffmpeg was not an option - it could not play half of H3 video files.
I've already proposed this switch to Tow (project leader and Windows user) so if there won't be OS-specific issues Windows player will be removed at some point.
Quote:
old ffmpeg and new ffmpeg.
I'd wish everything was that simple... Because right now we need ffmpeg 0.5, 0.6, 0.7 ... 0.11 players - just look on amount of "if version" checks in client/CVideoPlayer.cpp. Those API changes are quite common in ffmpeg and most distros are not as fast in updating as Arch or Gentoo.
It compiles well. The 3DO logo is played when starting the game but there is no sound in the logo. ffplay has sound in the logo. The video in the tavern plays. The videos before campaign maps don't play (should they?). The game always crashes when combat ends with
Code:
terminate called after throwing an instance of 'std::runtime_error'
what(): Decompression error!
Aborted
I would post the logs but I can't find them. Where are they on Linux?
They make the logs messy because changing configure.ac also changes configure for example. Running autoreconf does not take long. I think that a Windows build does not need these files.
Age: 21 Joined: 08 May 2009 Posts: 713 Location: Ukraine
Posted: 2012-08-22, 12:29
There shouldn't be any decompression at all in video player.
Ah. Found it. Bug with detecting size of last entry in video archive.
Quote:
EDIT: I suggest removing these files from the svn tree because they can be generated using autoreconf -i:
That practive was started long time ago. In such way users don't need to install autotools (one dependency less).
Switching to CMake is probably a better solution. After next release I'm going to replace autotools with cmake in readme's and will remove autotools completely after one more release.
You cannot post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum