Open beadon opened 9 years ago
Looks like the condition for setting USE_NEW_FFMPEG_ALLOC_API at the top of ContentDecoder/Frame.h doesn't work correctly for you. Can you check why?
Not sure what I'm looking for exactly ...
31 #if defined(LIBAVCODEC_VERSION_INT) && (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1))
32 #define USE_NEW_FFMPEG_ALLOC_API
33 #endif
34
35 #ifdef MAC
36 #define USE_NEW_FFMPEG_API
37 #endif
38
It looks like the function for AV_VERSION_INT is only present in the OSX section ??
theorem@topgun:~/build/electricsheep/client_generic/ContentDecoder$ grep -r "AV_VERSION_INT" ../*
../ContentDecoder/Frame.h:#if defined(LIBAVCODEC_VERSION_INT) && (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1))
../ffmpeg/osx/include/libavdevice/version.h:#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
../ffmpeg/osx/include/libavutil/version.h:#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
../ffmpeg/osx/include/libavutil/version.h:#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
../ffmpeg/osx/include/libswscale/version.h:#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
../ffmpeg/osx/include/libavformat/version.h:#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
../ffmpeg/osx/include/libavcodec/version.h:#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
I am building for Ubuntu 13.10.
What versions of libav do you have?
Here
theorem@topgun:~/build/electricsheep/client_generic/ContentDecoder$ apt-show-versions | grep libav
gstreamer1.0-libav:amd64/saucy 1.0.10-1ubuntu1 uptodate
libav-tools:amd64/saucy-security 6:0.8.13-0ubuntu0.13.10.1 uptodate
libavahi-client3:amd64/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-client3:i386/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-common-data:amd64/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-common-data:i386/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-common3:amd64/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-common3:i386/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-core7:amd64/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-glib1:amd64/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavahi-gobject0:amd64/saucy-updates 0.6.31-2ubuntu4.1 uptodate
libavc1394-0:amd64/saucy 0.5.4-2 uptodate
libavcodec-dev:amd64/saucy-security 6:0.8.13-0ubuntu0.13.10.1 uptodate
libavcodec-extra-53:amd64/saucy-security 6:0.8.13ubuntu0.13.10.1 uptodate
libavdevice53:amd64/saucy-security 6:0.8.13-0ubuntu0.13.10.1 uptodate
libavfilter2:amd64/saucy-security 6:0.8.13-0ubuntu0.13.10.1 uptodate
libavformat-dev:amd64/saucy-security 6:0.8.13-0ubuntu0.13.10.1 uptodate
libavformat53:amd64/saucy-security 6:0.8.13-0ubuntu0.13.10.1 uptodate
libavutil-dev:amd64/saucy-security 6:0.8.13-0ubuntu0.13.10.1 uptodate
libavutil-extra-51:amd64/saucy-security 6:0.8.13ubuntu0.13.10.1 uptodate
the /ffmpeg/osx/include/ directory inside the project contains only headers to be used on OS X (there is no ffmpeg in the system). On ubuntu you need to look through headers where they are installed by apt-get. You should not use header from the electric sheep folder. That is the reason why they are in "osx" subfolder. As for the version I think we use ffmpeg at version 2.1. But we should be backward compatible, I am just not sure until which version. You would need to investigate.
I'm a little fuzzy on what you're asking me to do here...
Similar problems, different classes. (undeclared PixelFormat
etc.)
ffmpeg is at version 2.8.6-1.
Same problem here. Ubuntu version: Ubuntu 15.10.1 ffmpeg -version (The one that comes with Ubuntu): FFmpeg version 7:2.7.6-0ubuntu0.15.10.1, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Mar 2 2016 03:06:13 with gcc 5.2.1 20151010 configuration: libavutil 50. 7. 0 / 50. 7. 0 libavcodec 52.45. 0 / 52.45. 0 libavformat 52.46. 0 / 52.46. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0. 7. 2 / 0. 7. 2 Link to config log
$ make Making all in Client make[1]: Entering directory '/home/tibor/repos/electricsheep/client_generic/Client' g++ -DPACKAGE_NAME=\"electricsheep\" -DPACKAGE_TARNAME=\"electricsheep\" -DPACKAGE_VERSION=\"2.7b33-svn\" -DPACKAGE_STRING=\"electricsheep\ 2.7b33-svn\" -DPACKAGE_BUGREPORT=\"http://code.google.com/p/electricsheep/issues/list\" -DPACKAGE_URL=\"\" -DPACKAGE=\"electricsheep\" -DVERSION=\"2.7b33-svn\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DEXTENSIONS=1 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS=1 -D_TANDEM_SOURCE=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DUSE_NEW_FFMPEG_API=1 -DHAVE_LIBBOOST_THREAD=1 -DHAVE_LIBBOOST_FILESYSTEM=1 -DHAVE_LIBBOOST_SYSTEM=1 -DHAVE_LIBTINYXML=1 -DHAVE_LIBGLUT=1 -DHAVE_LIBGL=1 -DHAVE_LIBRT=1 -I. -DPACKAGE_DATA_DIR=\""/usr/local/share"\" -DPACKAGE_LOCALE_DIR=\""/usr/local/share/locale"\" -I .. -iquote ../DisplayOutput/OpenGL -I ../Common -I ../DisplayOutput -I ../DisplayOutput/Renderer -I ../Common/Math -I ../ContentDecoder -I ../TupleStorage -I ../ContentDownloader -I ../lua5.1/src -I ../Client -I ../Networking -I ../tinyXml -DLINUX_GNU=1 -DSHAREDIR=\"/usr/local/share/electricsheep/\" -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libgtop-2.0 -I/usr/include/lua5.1 -I/usr/include/libpng12 -I/usr/include/lua5.1 -lrt -lz -lGL -D__STDC_CONSTANT_MACROS -Wno-write-strings -DHAVE_AVC_VID2=1 -g -O2 -MT Player.o -MD -MP -MF .deps/Player.Tpo -c -o Player.o Player.cpp In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h: In destructor ‘virtual ContentDecoder::CVideoFrame::~CVideoFrame()’: ../ContentDecoder/Frame.h:120:36: error: ‘avcodec_free_frame’ was not declared in this scope avcodec_free_frame( &m_pFrame ); ^ In file included from Player.h:11:0, from Player.cpp:37: ../ContentDecoder/ContentDecoder.h: In destructor ‘virtual ContentDecoder::sOpenVideoInfo::~sOpenVideoInfo()’: ../ContentDecoder/ContentDecoder.h:108:44: error: ‘avformat_close_input’ was not declared in this scope avformat_close_input( &m_pFormatContext ); ^ ../ContentDecoder/ContentDecoder.h:120:34: error: ‘avcodec_free_frame’ was not declared in this scope avcodec_free_frame( &m_pFrame ); ^ In file included from Player.h:14:0, from Player.cpp:37: FrameDisplay.h: At global scope: FrameDisplay.h:32:38: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 const fp8 TEX_MOVE_SECS = 60.f * 30.f; //30 minutes ^ Makefile:630: recipe for target 'Player.o' failed make[1]: * [Player.o] Error 1 make[1]: Leaving directory '/home/tibor/repos/electricsheep/client_generic/Client' Makefile:511: recipe for target 'all-recursive' failed make: * [all-recursive] Error 1
No change in Ubuntu 16.04 LTS either.
ffmpeg -version FFmpeg version UNKNOWN, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Mar 2 2016 03:06:13 with gcc 5.2.1 20151010 configuration: libavutil 50. 7. 0 / 50. 7. 0 libavcodec 52.45. 0 / 52.45. 0 libavformat 52.46. 0 / 52.46. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0. 7. 2 / 0. 7. 2 FFmpeg UNKNOWN libavutil 50. 7. 0 / 50. 7. 0 libavcodec 52.45. 0 / 52.45. 0 libavformat 52.46. 0 / 52.46. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0. 7. 2 / 0. 7. 2
if you add the full path to the ffmpeg headers (inserting the x86_64 part) in Frame.h, then the build goes on a little further but fails the same:
Player.o: In function
ContentDecoder::CVideoFrame::~CVideoFrame()': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/Frame.h:122: undefined reference to
av_frame_free' Player.o: In functionContentDecoder::CVideoFrame::~CVideoFrame()': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/Frame.h:122: undefined reference to
av_frame_free' Player.o: In functionContentDecoder::CVideoFrame::~CVideoFrame()': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/Frame.h:122: undefined reference to
av_frame_free' ContentDecoder.o: In functionContentDecoder::CContentDecoder::Open(ContentDecoder::sOpenVideoInfo*)': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.cpp:160: undefined reference to
avformat_open_input' /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.cpp:170: undefined reference toavformat_find_stream_info' /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.cpp:222: undefined reference to
avcodec_open2' /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.cpp:232: undefined reference toav_frame_alloc' ContentDecoder.o: In function
ContentDecoder::CVideoFrame::CVideoFrame(AVCodecContext_, AVPixelFormat, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/Frame.h:103: undefined reference to av_frame_alloc' ContentDecoder.o: In function
ContentDecoder::CContentDecoder::ReadOneFrame(ContentDecoder::sOpenVideoInfo_)': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.cpp:647: undefined reference toav_frame_unref' ContentDecoder.o: In function
ContentDecoder::CVideoFrame::~CVideoFrame()': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/Frame.h:122: undefined reference toav_frame_free' ContentDecoder.o: In function
ContentDecoder::sOpenVideoInfo::~sOpenVideoInfo()': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.h:108: undefined reference toavformat_close_input' /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.h:118: undefined reference to
av_frame_free' ContentDecoder.o: In functionContentDecoder::sOpenVideoInfo::~sOpenVideoInfo()': /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.h:108: undefined reference to
avformat_close_input' /home/tibor/repos/electricsheep/client_generic/Client/../ContentDecoder/ContentDecoder.h:118: undefined reference to `av_frame_free' collect2: error: ld returned 1 exit status Makefile:537: recipe for target 'electricsheep' failed make[1]: * [electricsheep] Error 1 make[1]: Leaving directory '/home/tibor/repos/electricsheep/client_generic/Client' Makefile:511: recipe for target 'all-recursive' failed make: * [all-recursive] Error 1
After downloading and compiling latest ffmpeg, the error changes again (previous alterations have been removed):
ffmpeg -version ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413 configuration: libavutil 55. 17.103 / 55. 17.103 libavcodec 57. 24.102 / 57. 24.102 libavformat 57. 25.100 / 57. 25.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 31.100 / 6. 31.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101
In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:78:48: error: ‘PixelFormat’ has not been declared CVideoFrame( AVCodecContext pCodecContext, PixelFormat _format, std::string _filename ) : mpFrame(NULL) ^ ../ContentDecoder/Frame.h: In constructor ‘ContentDecoder::CVideoFrame::CVideoFrame(AVCodecContext, int, std::cxx11::string)’: ../ContentDecoder/Frame.h:106:23: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations] int32 numBytes = avpicture_get_size( _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4898:5: note: declared here int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); ^ In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:106:23: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations] int32 numBytes = avpicture_get_size( _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4898:5: note: declared here int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); ^ In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:106:98: error: invalid conversion from ‘int’ to ‘AVPixelFormat’ [-fpermissive] int32 numBytes = avpicture_get_size( _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4898:5: note: initializing argument 1 of ‘int avpicture_get_size(AVPixelFormat, int, int)’ int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); ^ In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:106:98: warning: ‘int avpicture_get_size(AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations] int32 numBytes = avpicture_get_size( _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4898:5: note: declared here int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); ^ In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:108:6: warning: ‘int avpicturefill(AVPicture, const uint8t, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations] avpicturefill( (AVPicture )m_pFrame, m_spBuffer->GetBufferPtr(), _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4883:5: note: declared here int avpicture_fill(AVPicture picture, const uint8_t ptr, ^ In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:108:6: warning: ‘int avpicturefill(AVPicture, const uint8t, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations] avpicture_fill( (AVPicture )m_pFrame, m_spBuffer->GetBufferPtr(), _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4883:5: note: declared here int avpicture_fill(AVPicture picture, const uint8_t ptr, ^ In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:108:128: error: invalid conversion from ‘int’ to ‘AVPixelFormat’ [-fpermissive] avpicture_fill( (AVPicture )m_pFrame, m_spBuffer->GetBufferPtr(), _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4883:5: note: initializing argument 3 of ‘int avpicturefill(AVPicture, const uint8t, AVPixelFormat, int, int)’ int avpicture_fill(AVPicture picture, const uint8_t ptr, ^ In file included from ../ContentDecoder/ContentDecoder.h:46:0, from Player.h:11, from Player.cpp:37: ../ContentDecoder/Frame.h:108:128: warning: ‘int avpicturefill(AVPicture, const uint8t, AVPixelFormat, int, int)’ is deprecated [-Wdeprecated-declarations] avpicture_fill( (AVPicture )m_pFrame, m_spBuffer->GetBufferPtr(), _format, _pCodecContext->width, _pCodecContext->height ); ^ In file included from ../ContentDecoder/ContentDecoder.h:29:0, from Player.h:11, from Player.cpp:37: /usr/local/include/libavcodec/avcodec.h:4883:5: note: declared here int avpicture_fill(AVPicture picture, const uint8_t ptr, ^ In file included from Player.h:11:0, from Player.cpp:37: ../ContentDecoder/ContentDecoder.h: At global scope: ../ContentDecoder/ContentDecoder.h:199:2: error: ‘PixelFormat’ does not name a type PixelFormat m_WantedPixelFormat; ^ ../ContentDecoder/ContentDecoder.h:233:120: error: ‘PixelFormat’ has not been declared CContentDecoder( spCPlaylist _spPlaylist, bool _bStartByRandom, bool _bAllowTransitions, const uint32 _queueLenght, PixelFormat _wantedPixelFormat = PIX_FMT_RGB24 ); ^ In file included from Player.h:11:0, from Player.cpp:37: ../ContentDecoder/ContentDecoder.h:233:153: error: ‘PIX_FMT_RGB24’ was not declared in this scope CContentDecoder( spCPlaylist _spPlaylist, bool _bStartByRandom, bool _bAllowTransitions, const uint32 _queueLenght, PixelFormat _wantedPixelFormat = PIX_FMT_RGB24 ); ^ In file included from Player.h:14:0, from Player.cpp:37: FrameDisplay.h:32:38: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 const fp8 TEX_MOVE_SECS = 60.f \ 30.f; //30 minutes ^ Player.cpp: In member function ‘ContentDecoder::CContentDecoder_ CPlayer::CreateContentDecoder(bool)’: Player.cpp:377:2: error: ‘PixelFormat’ was not declared in this scope PixelFormat pf = PIX_FMT_BGR32; ^ Player.cpp:384:214: error: ‘pf’ was not declared in this scope CContentDecoder( m_spPlaylist, _bStartByRandom, g_Settings()->Get( "settings.player.CalculateTransitions", true ), (uint32)abs(g_Settings()->Get( "settings.player.BufferLength", 25 )), pf ); ^ Makefile:630: recipe for target 'Player.o' failed make[1]: * [Player.o] Error 1 make[1]: Leaving directory '/home/tibor/repos/electricsheep/client_generic/Client' Makefile:511: recipe for target 'all-recursive' failed make: * [all-recursive] Error 1
"PixelFormat" type needs to be replaced with "AVPixelFormat" "PIX_FMT_RGB24" constant needs to be replaced with "AV_PIX_FMT_RGB24" Build has finished successfully. (with ffmpeg version 3.0.2, built on local machine)
So, the original problem probably was that the code does not handle well the 64-bit version of ffmpeg for which the header files are located in /usr/include/x86_64-linux-gnu/ instead of /usr/include/ as several of the header files (of electricsheep code) and probably also the build script presumes.
I'm having a problem compiling with the latest clone, rather than fix it all up myself, this may be indicative of a larger issue, jump to the end for make errors :