FFMPEG Support on OS X

I compiling and using the CVS version of Panda3D, on an Intel Macs, quite succesfully. I’m trying to compile FFMPEG suuport. I’ve got the Config.pp file setup ok - ppremake works - but I get a stop in grutil:

g++ -ftemplate-depth-30  -c -o Opt3-OSX/grutil_grutil_composite1.o -I. -I/Users/pete/Projects/Panda3D/panda -I../cull -I../display -I../downloader -I../event -I../express -I../gobj -I../gsgbase -I../lerp -I../linmath -I../mathutil -I../nativenet -I../net -I../pandabase -I../parametrics -I../pgraph -I../pipeline -I../pnmimage -I../pstatclient -I../putil -I../text -I/usr/local/panda/include -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -I/opt/local/include/ffmpeg    -g -O2 -fPIC grutil_composite1.cxx
In file included from ffmpegTexture.h:28,
                 from config_grutil.cxx:22,
                 from grutil_composite1.cxx:3:
/opt/local/include/ffmpeg/avformat.h:66: error: integer constant is too large for 'long' type
/opt/local/include/ffmpeg/avformat.h:67: error: integer constant is too large for 'long' type
/opt/local/include/ffmpeg/avcodec.h:2463: warning: attribute ignored in declaration of 'struct ImgReSampleContext'
/opt/local/include/ffmpeg/avcodec.h:2463: warning: attribute for 'struct ImgReSampleContext' must follow the 'struct' keyword
/opt/local/include/ffmpeg/avcodec.h:2468: warning: 'ImgReSampleContext' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2465)
/opt/local/include/ffmpeg/avcodec.h:2475: warning: 'ImgReSampleContext' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2465)
/opt/local/include/ffmpeg/avcodec.h:2479: warning: 'ImgReSampleContext' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2465)
/opt/local/include/ffmpeg/avcodec.h:2481: warning: 'ImgReSampleContext' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2465)
/opt/local/include/ffmpeg/avformat.h: In function 'void av_init_packet(AVPacket*)':
/opt/local/include/ffmpeg/avformat.h:66: error: 'INT64_C' was not declared in this scope
/opt/local/include/ffmpeg/avformat.h: At global scope:
/opt/local/include/ffmpeg/avformat.h:292: warning: 'AVFrac' is deprecated (declared at /opt/local/include/ffmpeg/avformat.h:118)
ffmpegTexture.cxx: In member function 'bool FFMpegTexture::VideoStream::get_frame_data(int)':
ffmpegTexture.cxx:573: warning: 'img_convert' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2606)
ffmpegTexture.cxx:575: warning: 'img_convert' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2606)
ffmpegTexture.cxx:578: warning: 'img_convert' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2606)
ffmpegTexture.cxx:580: warning: 'img_convert' is deprecated (declared at /opt/local/include/ffmpeg/avcodec.h:2606)
make[1]: *** [Opt3-OSX/grutil_grutil_composite1.o] Error 1
make: *** [grutil] Error 2

FFMPEG was installed via DarwinPorts and is Version 0.4.9-pre1,

any ideas?

Does ffmpeg require some special compiler options to build on OSX? It sure does seem like something’s not quite vanilla about that avformat.h header file.

You might need to ask this one of the ffmpeg team.

David

I’m getting the same on Gentoo:

g++ -ftemplate-depth-30  -c -o Opt3-Linux/grutil_grutil_composite1.o -I. -I/home/pete/Projects/Panda3D/CVS/panda -I../cull -I../display -I../downloader -I../event -I../express -I../gobj -I../gsgbase -I../lerp -I../linmath -I../mathutil -I../nativenet -I../net -I../pandabase -I../parametrics -I../pgraph -I../pipeline -I../pnmimage -I../pnmtext -I../pstatclient -I../putil -I../text -I/usr/local/panda/include -I/usr/include/python2.4 -I/usr/include/ffmpeg    -g -O2 -fPIC grutil_composite1.cxx
In file included from ffmpegTexture.h:28,
                 from config_grutil.cxx:22,
                 from grutil_composite1.cxx:3:
/usr/include/ffmpeg/avformat.h:66: error: integer constant is too large for 'long' type
/usr/include/ffmpeg/avformat.h:67: error: integer constant is too large for 'long' type
../nativenet/time_span.h: In constructor 'Time_Span::Time_Span(float)':
../nativenet/time_span.h:93: warning: converting to '__time_t' from 'float'
../nativenet/time_span.h:94: warning: converting to '__suseconds_t' from 'double'
/usr/include/ffmpeg/avcodec.h: At global scope:
/usr/include/ffmpeg/avcodec.h:2445: warning: attribute ignored in declaration of 'struct ImgReSampleContext'
/usr/include/ffmpeg/avcodec.h:2445: warning: attribute for 'struct ImgReSampleContext' must follow the 'struct' keyword
/usr/include/ffmpeg/avcodec.h:2450: warning: 'ImgReSampleContext' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2447)
/usr/include/ffmpeg/avcodec.h:2457: warning: 'ImgReSampleContext' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2447)
/usr/include/ffmpeg/avcodec.h:2461: warning: 'ImgReSampleContext' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2447)
/usr/include/ffmpeg/avcodec.h:2463: warning: 'ImgReSampleContext' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2447)
/usr/include/ffmpeg/avformat.h: In function 'void av_init_packet(AVPacket*)':
/usr/include/ffmpeg/avformat.h:66: error: 'INT64_C' was not declared in this scope
/usr/include/ffmpeg/avformat.h: At global scope:
/usr/include/ffmpeg/avformat.h:284: warning: 'AVFrac' is deprecated (declared at /usr/include/ffmpeg/avformat.h:118)
ffmpegTexture.cxx: In member function 'bool FFMpegTexture::VideoStream::get_frame_data(int)':
ffmpegTexture.cxx:573: warning: 'img_convert' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2588)
ffmpegTexture.cxx:575: warning: 'img_convert' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2588)
ffmpegTexture.cxx:578: warning: 'img_convert' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2588)
ffmpegTexture.cxx:580: warning: 'img_convert' is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2588)
make[1]: *** [Opt3-Linux/grutil_grutil_composite1.o] Error 1
make[1]: Leaving directory `/home/pete/Projects/Panda3D/CVS/panda/src/grutil'
make: *** [grutil] Error 2

ffmpeg is:

*  media-video/ffmpeg
      Latest version available: 0.4.9_p20070330
      Latest version installed: 0.4.9_p20070330
      Size of files: 2,666 kB
      Homepage:      http://ffmpeg.org/
      Description:   Complete solution to record, convert and stream audio and video. Includes libavcodec. SVN revision 8560
      License:       GPL-2

What version do you compile against?

I don’t actually know. You can check out the downloadable “thirdparty” tools and see what version of ffmpeg is in there.

David

unfortunately, the original ffmpeg implementation was built on the cvs head, which is horribly outdated from the svn head. I’ve had success getting the svn version to compile in osx, so we should be able to get it working in the near future.