av_open_input_file

I have something like this:

[jurek@FastComputer panda3d-1.8.1]$ python2 makepanda/makepanda.py --everything --no-fmodex           
WARNING: Could not locate pkg-config package eigen3, excluding from build
Generating library cache...
WARNING: Could not locate thirdparty package artoolkit, excluding from build
WARNING: Could not locate thirdparty package fcollada, excluding from build
WARNING: Could not locate thirdparty package fftw, excluding from build
WARNING: Could not locate thirdparty package vrpn, excluding from build
Generating dependencies...
[ 17%] Building Interrogate database built/pandac/input/libp3gobj.in
[ 20%] Building Interrogate database built/pandac/input/libp3pgraph.in
[ 24%] Building Interrogate database built/pandac/input/libp3display.in
In file included from built/include/get_x11.h:58:0,
                 from built/tmp/libp3display_igate.cxx:27:
/usr/include/X11/extensions/xf86dga.h:9:2: warning: #warning "xf86dga.h is obsolete and may be removed in the future." [-Wcpp]
 #warning "xf86dga.h is obsolete and may be removed in the future."
  ^
/usr/include/X11/extensions/xf86dga.h:10:2: warning: #warning "include <X11/extensions/Xxf86dga.h> instead." [-Wcpp]
 #warning "include <X11/extensions/Xxf86dga.h> instead."
  ^
[ 24%] Building Interrogate database built/pandac/input/libp3device.in
[ 25%] Building C++ object built/tmp/p3text_composite1.o
[ 26%] Building C++ object built/tmp/p3text_composite2.o
[ 26%] Building Interrogate database built/pandac/input/libp3text.in
[ 26%] Building C++ object built/tmp/p3movies_composite1.o
[ 26%] Building C++ object built/tmp/p3movies_composite2.o
In file included from panda/src/movies/p3movies_composite2.cxx:3:0:
panda/src/movies/ffmpegVirtualFile.cxx: In member function 'bool FfmpegVirtualFile::open_vfs(const Filename&)':
panda/src/movies/ffmpegVirtualFile.cxx:123:68: error: 'av_open_input_file' was not declared in this scope
     av_open_input_file(&_format_context, url.c_str(), NULL, 0, NULL);
                                                                    ^
panda/src/movies/ffmpegVirtualFile.cxx: In member function 'bool FfmpegVirtualFile::open_subfile(const SubfileInfo&)':
panda/src/movies/ffmpegVirtualFile.cxx:179:68: error: 'av_open_input_file' was not declared in this scope
     av_open_input_file(&_format_context, url.c_str(), NULL, 0, NULL);
                                                                    ^
panda/src/movies/ffmpegVirtualFile.cxx: In member function 'void FfmpegVirtualFile::close()':
panda/src/movies/ffmpegVirtualFile.cxx:197:5: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1793) [-Wdeprecated-declarations]
     av_close_input_file(_format_context);
     ^
panda/src/movies/ffmpegVirtualFile.cxx:197:40: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1793) [-Wdeprecated-declarations]
     av_close_input_file(_format_context);
                                        ^
panda/src/movies/ffmpegVirtualFile.cxx: In static member function 'static void FfmpegVirtualFile::register_protocol()':
panda/src/movies/ffmpegVirtualFile.cxx:231:10: error: 'URLProtocol' does not name a type
   static URLProtocol protocol;
          ^
panda/src/movies/ffmpegVirtualFile.cxx:232:3: error: 'protocol' was not declared in this scope
   protocol.name = "pandavfs";
   ^
panda/src/movies/ffmpegVirtualFile.cxx:249:52: error: 'av_register_protocol2' was not declared in this scope
   av_register_protocol2(&protocol, sizeof(protocol));
                                                    ^
panda/src/movies/ffmpegVirtualFile.cxx: In static member function 'static int FfmpegVirtualFile::pandavfs_open(URLContext*, const char*, int)':
panda/src/movies/ffmpegVirtualFile.cxx:271:4: error: invalid use of incomplete type 'struct URLContext'
   h->priv_data = self;
    ^
In file included from panda/src/movies/ffmpegAudioCursor.h:26:0,
                 from panda/src/movies/ffmpegAudio.cxx:19,
                 from panda/src/movies/p3movies_composite2.cxx:1:
panda/src/movies/ffmpegVirtualFile.h:31:8: error: forward declaration of 'struct URLContext'
 struct URLContext;
        ^
In file included from panda/src/movies/p3movies_composite2.cxx:3:0:
panda/src/movies/ffmpegVirtualFile.cxx: In static member function 'static int FfmpegVirtualFile::pandavfs_read(URLContext*, unsigned char*, int)':
panda/src/movies/ffmpegVirtualFile.cxx:282:52: error: invalid use of incomplete type 'struct URLContext'
   FfmpegVirtualFile *self = (FfmpegVirtualFile *)(h->priv_data);
                                                    ^
In file included from panda/src/movies/ffmpegAudioCursor.h:26:0,
                 from panda/src/movies/ffmpegAudio.cxx:19,
                 from panda/src/movies/p3movies_composite2.cxx:1:
panda/src/movies/ffmpegVirtualFile.h:31:8: error: forward declaration of 'struct URLContext'
 struct URLContext;
        ^
In file included from panda/src/movies/p3movies_composite2.cxx:3:0:
panda/src/movies/ffmpegVirtualFile.cxx: In static member function 'static int64_t FfmpegVirtualFile::pandavfs_seek(URLContext*, int64_t, int)':
panda/src/movies/ffmpegVirtualFile.cxx:324:52: error: invalid use of incomplete type 'struct URLContext'
   FfmpegVirtualFile *self = (FfmpegVirtualFile *)(h->priv_data);
                                                    ^
In file included from panda/src/movies/ffmpegAudioCursor.h:26:0,
                 from panda/src/movies/ffmpegAudio.cxx:19,
                 from panda/src/movies/p3movies_composite2.cxx:1:
panda/src/movies/ffmpegVirtualFile.h:31:8: error: forward declaration of 'struct URLContext'
 struct URLContext;
        ^
In file included from panda/src/movies/p3movies_composite2.cxx:3:0:
panda/src/movies/ffmpegVirtualFile.cxx: In static member function 'static int FfmpegVirtualFile::pandavfs_close(URLContext*)':
panda/src/movies/ffmpegVirtualFile.cxx:365:4: error: invalid use of incomplete type 'struct URLContext'
   h->priv_data = 0;
    ^
In file included from panda/src/movies/ffmpegAudioCursor.h:26:0,
                 from panda/src/movies/ffmpegAudio.cxx:19,
                 from panda/src/movies/p3movies_composite2.cxx:1:
panda/src/movies/ffmpegVirtualFile.h:31:8: error: forward declaration of 'struct URLContext'
 struct URLContext;
        ^
In file included from panda/src/movies/p3movies_composite2.cxx:4:0:
panda/src/movies/ffmpegAudioCursor.cxx: In constructor 'FfmpegAudioCursor::FfmpegAudioCursor(FfmpegAudio*)':
panda/src/movies/ffmpegAudioCursor.cxx:55:7: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1616) [-Wdeprecated-declarations]
   if (av_find_stream_info(_format_ctx)<0) {
       ^
panda/src/movies/ffmpegAudioCursor.cxx:55:38: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1616) [-Wdeprecated-declarations]
   if (av_find_stream_info(_format_ctx)<0) {
                                      ^
panda/src/movies/ffmpegAudioCursor.cxx:81:42: error: 'avcodec_open' was not declared in this scope
   if(avcodec_open(_audio_ctx, pAudioCodec)<0) {
                                          ^
panda/src/movies/ffmpegAudioCursor.cxx:91:18: error: 'AVCODEC_MAX_AUDIO_FRAME_SIZE' was not declared in this scope
   _buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
                  ^
panda/src/movies/ffmpegAudioCursor.cxx: In member function 'bool FfmpegAudioCursor::reload_buffer()':
panda/src/movies/ffmpegAudioCursor.cxx:218:17: warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3775) [-Wdeprecated-declarations]
       int len = avcodec_decode_audio3(_audio_ctx, _buffer, &bufsize, &pkt);
                 ^
panda/src/movies/ffmpegAudioCursor.cxx:218:74: warning: 'int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3775) [-Wdeprecated-declarations]
       int len = avcodec_decode_audio3(_audio_ctx, _buffer, &bufsize, &pkt);
                                                                          ^
panda/src/movies/ffmpegAudioCursor.cxx: In member function 'virtual void FfmpegAudioCursor::seek(double)':
panda/src/movies/ffmpegAudioCursor.cxx:266:42: error: 'avcodec_open' was not declared in this scope
   if(avcodec_open(_audio_ctx, pAudioCodec)<0) {
                                          ^
In file included from panda/src/movies/p3movies_composite2.cxx:5:0:
panda/src/movies/ffmpegVideoCursor.cxx: In member function 'bool FfmpegVideoCursor::open_stream()':
panda/src/movies/ffmpegVideoCursor.cxx:512:7: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1616) [-Wdeprecated-declarations]
   if (av_find_stream_info(_format_ctx) < 0) {
       ^
panda/src/movies/ffmpegVideoCursor.cxx:512:38: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1616) [-Wdeprecated-declarations]
   if (av_find_stream_info(_format_ctx) < 0) {
                                      ^
panda/src/movies/ffmpegVideoCursor.cxx:544:43: error: 'avcodec_open' was not declared in this scope
   if (avcodec_open(_video_ctx, pVideoCodec) < 0) {
                                           ^
Storing dependency cache.
Elapsed Time: 2 min 39 sec
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3movies_composite2.o -Ibuilt/tmp -Ibuilt/include -I/usr/include/python2.7 -DMAKEPANDA= -Ipanda/src/movies -pthread -msse2 -O2 -DBUILDING_PANDA panda/src/movies/p3movies_composite2.cxx
Build terminated.
[jurek@FastComputer panda3d-1.8.1]$ 

I also have to mention that in general compiling Panda3D undere Linux is really painfull… I have arch linux and i tried to install Panda3D from AUR, and NO ONE PKGBUILD made package correctly… I think it’s not only fault of maintainers.

Use latest CVS Panda, this has already been fixed (we were using functions in ffmpeg that have since been deprecated). I think there’s a pkgbuild out there for the CVS version of Panda.

Yes, i was trying this PKGBUILD and I got:

Referencing Library libp3vision
[T2] Building Interrogate database built/pandac/input/libp3rocket.in
[T3] Building C++ object built/tmp/p3rocket_rocketRegion_ext.o
[T4] Building C++ object built/tmp/p3skel_composite1.o
panda/src/rocket/rocketRegion_ext.cxx:21:42: fatal error: Rocket/Core/Python/Utilities.h: No such file or directory
 #include <Rocket/Core/Python/Utilities.h>
                                          ^
compilation terminated.
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3rocket_rocketRegion_ext.o -Ibuilt/tmp -Ibuilt/include -I/usr/include/python2.7 -Ipanda/src/rocket -pthread -msse2 -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -DBUILDING_ROCKET panda/src/rocket/rocketRegion_ext.cxx
Storing dependency cache.
Elapsed Time: 3 min 7 sec
Build process aborting.
Build terminated.
==> ERROR: A failure occurred in build().
    Aborting...

It apparently depends on libRocket but you don’t have it installed.

Yes, i do have installed this from AUR (librocket-cvs)