FFmpeg upgrade to revision 12758 (avformat version 52.13): support libavdevice for video capture in VideoTexture module (BGE). Makefile, CMake, scons updated. FFmpeg binaries will have to be rebuilt for certain OS (irix), win32 binaries already up to date. You MUST do a clean rebuild after this patch. Scons users: pay attention that the config/<os>-config.py files have changed, adapt your user-config.py in consequence

This commit is contained in:
Benoit Bolsee 2008-12-17 20:52:39 +00:00
parent 3c886d7c38
commit 04ef5be177
9 changed files with 32 additions and 18 deletions

@ -175,7 +175,7 @@ IF(UNIX)
SET(FFMPEG /usr)
SET(FFMPEG_INC ${FFMPEG}/include)
SET(FFMPEG_LIB avformat avcodec avutil)
SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale)
SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
SET(JPEG_LIB jpeg)

@ -322,10 +322,15 @@ if not quickie and do_clean:
print "remove file %s"%(B.root_build_dir+entry)
os.remove(B.root_build_dir+entry)
for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
'extern/xvidcore/build/generic/platform.inc']:
'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
if os.path.exists(confile):
print "clean file %s"%confile
os.remove(confile)
if os.path.isdir(confile):
for root, dirs, files in os.walk(confile):
for name in files:
os.remove(os.path.join(root, name))
else:
os.remove(confile)
print B.bc.OKGREEN+'...done'+B.bc.ENDC
else:
print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC

@ -40,7 +40,11 @@ else:
# enable ffmpeg support
WITH_BF_FFMPEG = True # -DWITH_FFMPEG
BF_FFMPEG = "#extern/ffmpeg"
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
# trick : The version of ffmpeg in extern/ffmpeg uses explicit libav.. directory in #include statements
# To keep Blender compatible with older versions, I add ${BF_FFMPEG} to the inc dir so that ffmpeg
# finds the files directly in extern/ffmpeg/libav... while blender finds them in
# extern/ffmpeg/include.
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}'
if USE_SDK==True:
BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
#BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'

@ -146,7 +146,7 @@ WITH_BF_BINRELOC = 'false'
WITH_BF_FFMPEG = 'true' # -DWITH_FFMPEG
# Uncomment the following two lines to use system's ffmpeg
BF_FFMPEG = LCGDIR+'/ffmpeg'
BF_FFMPEG_LIB = 'avformat avcodec swscale avutil faad faac vorbis x264 ogg mp3lame z'
BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice faad faac vorbis x264 ogg mp3lame z'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'

@ -139,8 +139,13 @@ BF_FFMPEG = '#extern/ffmpeg'
BF_FFMPEG_LIB = ''
# Uncomment the following two lines to use system's ffmpeg
# BF_FFMPEG = '/usr'
# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
# BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
# trick : The version of ffmpeg in extern/ffmpeg uses explicit libav.. directory in #include statements
# To keep Blender compatible with older version, I add ${BF_FFMPEG} to the inc dir so that ffmpeg
# finds the files directly in extern/ffmpeg/libav... while blender finds them in
# extern/ffmpeg/include. When using system ffmpeg, you don't need that, assuming the system library
# still use the flat directory model, otherwise will not compile anyway
BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
# enable ogg, vorbis and theora in ffmpeg

@ -131,7 +131,7 @@ WITH_BF_FFMPEG = False # -DWITH_FFMPEG
BF_FFMPEG = '/usr/local'
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
BF_FFMPEG_LIB = 'avformat avcodec avutil'
BF_FFMPEG_LIB = 'avformat avcodec avutil avdevice'
# Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = False

@ -21,7 +21,7 @@ BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
WITH_BF_FFMPEG = False
BF_FFMPEG_LIB = 'avformat swscale avcodec avutil xvidcore x264'
BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264'
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include'

@ -71,7 +71,7 @@
#ifdef WITH_FFMPEG
#include <ffmpeg/avcodec.h>
#include <ffmpeg/avformat.h>
//#include <ffmpeg/avdevice.h>
#include <ffmpeg/avdevice.h>
#include <ffmpeg/log.h>
#if LIBAVFORMAT_VERSION_INT < (49 << 16)
@ -258,7 +258,7 @@ void do_init_ffmpeg()
if (!ffmpeg_init) {
ffmpeg_init = 1;
av_register_all();
//avdevice_register_all();
avdevice_register_all();
if ((G.f & G_DEBUG) == 0)
{

@ -100,13 +100,13 @@ endif
ifeq ($(FREE_WINDOWS), true)
export NAN_FTGL ?= $(LCGDIR)/gcc/ftgl
export NAN_FFMPEG ?= $(LCGDIR)/gcc/ffmpeg
export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavcodec.a
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libavdevice.a
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include -I$(NANBLENDERHOME)/extern/ffmpeg
else
export NAN_FTGL ?= $(LCGDIR)/ftgl
export NAN_FFMPEG ?= $(LCGDIR)/ffmpeg
export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
export NAN_FFMPEGLIBS ?= $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavdevice.a
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include -I$(NANBLENDERHOME)/extern/ffmpeg
endif
ifeq ($(WITH_VERSE), true)
@ -357,8 +357,8 @@ endif
export NAN_SDLLIBS ?= $(NAN_SDL)/lib/libSDL.a
export NAN_SDLCFLAGS ?= -I$(NAN_SDL)/include/SDL
export NAN_FFMPEG ?= $(LCGDIR)/ffmpeg
export NAN_FFMPEGLIBS = $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libogg.a $(NAN_FFMPEG)/lib/libfaad.a $(NAN_FFMPEG)/lib/libmp3lame.a $(NAN_FFMPEG)/lib/libvorbis.a $(NAN_FFMPEG)/lib/libx264.a $(NAN_FFMPEG)/lib/libfaac.a $(NAN_ZLIB)/lib/libz.a
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
export NAN_FFMPEGLIBS = $(NAN_FFMPEG)/lib/libavformat.a $(NAN_FFMPEG)/lib/libavcodec.a $(NAN_FFMPEG)/lib/libswscale.a $(NAN_FFMPEG)/lib/libavutil.a $(NAN_FFMPEG)/lib/libavdevice.a $(NAN_FFMPEG)/lib/libogg.a $(NAN_FFMPEG)/lib/libfaad.a $(NAN_FFMPEG)/lib/libmp3lame.a $(NAN_FFMPEG)/lib/libvorbis.a $(NAN_FFMPEG)/lib/libx264.a $(NAN_FFMPEG)/lib/libfaac.a $(NAN_ZLIB)/lib/libz.a
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include -I$(NANBLENDERHOME)/extern/ffmpeg
# Uncomment the following line to use Mozilla inplace of netscape
# CPPFLAGS +=-DMOZ_NOT_NET
@ -407,7 +407,7 @@ endif
ifneq ($(NAN_USE_FFMPEG_CONFIG), true)
export NAN_FFMPEG ?= /usr
export NAN_FFMPEGLIBS ?= -L$(NAN_FFMPEG)/lib -lavformat -lavcodec -lavutil -lswscale -ldts -lz
export NAN_FFMPEGLIBS ?= -L$(NAN_FFMPEG)/lib -lavformat -lavcodec -lavutil -lswscale -lavdevice -ldts -lz
export NAN_FFMPEGCFLAGS ?= -I$(NAN_FFMPEG)/include
endif