FFMpeg and FreeBSD

Shane Ambler FreeBSD at ShaneWare.Biz
Sat Jun 29 03:57:17 UTC 2013


On 29/06/2013 02:07, Giorgos Keramidas wrote:

>> I have had no problems using ffmpeg1 with my version of blender
>> for several months now. It has a cmake option for lib names and
>> then I added include/ffmpeg1 to C/CXXFLAGS and lib/ffmpeg1 to
>> LDFLAGS.
>
> Hi Shane,
>
> This should probably be in the multimedi chapter of the Handbook or
> the FAQ, or in the UPDATING file of the ports.  Would you mind if I
> copied parts of the text and added them to e.g the FAQ?

sure - I'm thinking FAQ. Maybe start with the following -

To use ffmpeg1 with an existing port.

The first step is to get the ffmpeg1 headers and libs found, this should
be easily accomplished with the following (an easy way to first check
that the port compiles with ffmpeg1) -
CFLAGS+=    -I${LOCALBASE}/include/ffmpeg1
CXXFLAGS+=  -I${LOCALBASE}/include/ffmpeg1
LDFLAGS+=   -L${LOCALBASE}/lib/ffmpeg1

If the project source hasn't kept up with ffmpeg changes then you may be
able to replace some of the old functions to quickly keep it working
with the newer version. Blender can be source of inspiration for this -
http://projects.blender.org/scm/viewvc.php/trunk/blender/intern/ffmpeg/ffmpeg_compat.h?view=markup&root=bf-blender

The next step is to get it linking with the new lib names, these are
the ffmpeg lib names with a 1 appended to them eg. libavcodec1 instead
of libavcodec. Some ports may have options to make this easy for example
graphics/blender has a cmake variable called FFMPEG_LIBRARIES so adding
CMAKE_ARGS+=-DFFMPEG_LIBRARIES:STRING="avformat1;avcodec1;avutil1;avdevice1;swscale1"
to the port Makefile handles that. Other ports may need a search and
replace such as sed 's|avcodec|avcodec1|g' or a patch manually made
for their Makefiles.




More information about the freebsd-questions mailing list