Synfig, ffmpeg, and Gentoo Linux

(This may belong here, or in the compilation forum, since installing software on Gentoo typically involves compiling it, but I’m too lazy to fill out Yet Another Forum Membership Form.)

The problem: It isn’t possible to install Synfig-0.61.07 with ffmpeg support on a Gentoo system running a recent svn version of ffmpeg.

The question: I assume that the problem is due to recent API changes in ffmpeg–is this fixed in the svn version of Synfig, or is there a way around it? Or will I just have to wait, and live with no ffmpeg support in Synfig in the meanwhile?

The anecdote, which I’m writing out in detail in the hope that the information may be of help to someone somewhere: I was attempting to install Synfigstudio using the Gentoo Sunrise ebuild. The installation of Synfig (not -studio) errored out midway through:

x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I../../.. -I../../../src -I/usr/include/libxml++-2.6 -I/usr/include/libxml2 -I/usr/include/glibmm-2.4 -I/usr/lib64/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -DSYNFIG_NO_DEPRECATED -D__STDC_CONSTANT_MACROS -march=k8 -pipe -DNDEBUG -Wno-deprecated -O2 -W -Wall -Wno-unused-parameter -fpermissive -MT libmod_libavcodec_la-trgt_av.lo -MD -MP -MF .deps/libmod_libavcodec_la-trgt_av.Tpo -c trgt_av.cpp -fPIC -DPIC -o .libs/libmod_libavcodec_la-trgt_av.o trgt_av.cpp:38:22: avformat.h: No such file or directory trgt_av.cpp:87: error: expected constructor, destructor, or type conversion before '*' token trgt_av.cpp:107: error: variable or field `free_picture' declared void trgt_av.cpp:107: error: `AVFrame' was not declared in this scope trgt_av.cpp:107: error: `pic' was not declared in this scope trgt_av.cpp:108: error: expected `,' or `;' before '{' token trgt_av.cpp:114: error: variable or field `convert_surface_frame' declared void (plus another hundred or so lines of the same)
All right, thought I, there’s a mess of references to libavcodec in that. A bit of digging around determined that I have libavcodec.so.51.51.0 and that it belongs to the ffmpeg ebuild.

At this point, I sort of went “Hmmm.” I vaguely remembered something about some things refusing to build against ffmpeg after recent changes, and knew that I was running a version of ffmpeg taken from the live ebuild in the Berkano overlay, although I didn’t think I had updated it that recently.

Turns out I was wrong:

FFmpeg version SVN-r12401, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-static --enable-shared --cc=x86_64-pc-linux-gnu-gcc --arch=x86_64 --cpu=athlon64 --disable-altivec --disable-debug --disable-ipv6 --enable-libmp3lame --enable-liba52 --enable-libdc1394 --enable-libxvid --enable-libvorbis --enable-libx264 --enable-libtheora --enable-libfaad --enable-libfaac --enable-gpl --enable-postproc --disable-strip libavutil version: 49.6.0 libavcodec version: 51.51.0 libavformat version: 52.9.0 libavdevice version: 52.0.0 built on Mar 9 2008 20:09:48, gcc: 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.10)
Disabling the ffmpeg USE flag enabled the Synfig ebuild to work, but there doesn’t seem to be a way to make the two programs “play nice” together at the moment.

The moral: Mixing Portage overlays is trouble. :stuck_out_tongue_winking_eye:

Some things:

synfig 0.61.08 is out

The critical issue is that gcc couldn’t find the avformat header:

trgt_av.cpp:38:22: avformat.h: No such file or directory

Also, ffmpeg changed some API recently, so it may not compile. We need help fixing this if you know how. You may as well just use the ffmpeg target instead of the libav target, since it runs the ffmpeg binary instead of using the libav* libraries and the ffmpeg command-line parameters don’t change as much.