FFMPEG compiling problems, swscale.h not found

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
alarionfirn
Posts: 0
Joined: Sun Nov 27, 2005 11:04 am

FFMPEG compiling problems, swscale.h not found

Post by alarionfirn »

Since the recent update of the FFMPEG library in blender's svn I'm getting the following error when compiling with FFMPEG enabled:

Compiling ==> 'writeffmpeg.c'
=====
source\blender\blenkernel\intern\writeffmpeg.c:35:28: ffmpeg/swscale.h: No such file or directory
source\blender\blenkernel\intern\writeffmpeg.c: In function `generate_video_frame':
source\blender\blenkernel\intern\writeffmpeg.c:322: warning: implicit declaration of function `sws_scale'
source\blender\blenkernel\intern\writeffmpeg.c: In function `alloc_video_stream': source\blender\blenkernel\intern\writeffmpeg.c:427: warning: implicit declaration of function `sws_getContext' source\blender\blenkernel\intern\writeffmpeg.c:431: error: `SWS_BICUBIC' undeclared (first use in this function) source\blender\blenkernel\intern\writeffmpeg.c:431: error: (Each undeclared identifier is reported only once source\blender\blenkernel\intern\writeffmpeg.c:431: error: for each function it appears in.) source\blender\blenkernel\intern\writeffmpeg.c:432: warning: assignment makes pointer from integer without a cast source\blender\blenkernel\intern\writeffmpeg.c: In function `end_ffmpeg':
source\blender\blenkernel\intern\writeffmpeg.c:814: warning: implicit declaration of function `sws_freeContext'
=====
scons: *** [C:\blenderdev\build\win32-mingw\source\blender\blenkernel\intern\wri teffmpeg.o] Error 1
scons: building terminated because of errors.

Help is much appreciated. :)

mrunion
Posts: 0
Joined: Wed Oct 16, 2002 1:50 am
Location: Jonesborough, TN

Post by mrunion »

A similar thing happens to me. When the build tries to link it gets an error that it cannot find "-lswscale" and something about "commit2". I'll try to capture the exact message.

Thanx,
Matt

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

The 'no such file' msg means either something is not installed or a bad path. note: if the file does not exist, it will not be found.

For the swscale link problem, edit your user-config.py to
BF_FFMPEG_LIB = 'avformat avcodec avutil swscale'

jody
Posts: 0
Joined: Tue Jan 21, 2003 5:33 pm

Post by jody »

On Ubuntu the problem is that ffmpeg package do not install swscale.h

jody

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv »

jody wrote:On Ubuntu the problem is that ffmpeg package do not install swscale.h
The ffmpeg project does not do versioned release. This means anything packaged by loonix distros is out of date. You either need to install the current svn version of ffmpeg or the one in the blender extern/ source.

For opensuse 10.1, I installed ffmpeg from their svn repo, set
BF_FFMPEG = '/usr/local'
and
BF_FFMPEG_LIB = 'avformat avcodec avutil swscale'

alarionfirn
Posts: 0
Joined: Sun Nov 27, 2005 11:04 am

Post by alarionfirn »

Thanks for all the posts so far. :wink:

My problem is that swscale.h does exist in blender\source\blender\blenkernel\intern so it's most likely a path problem. However, being an Artist I have no clue what line/path has to be changed to fix the error. I'd be thankful if someone could help me out with this.

mrunion
Posts: 0
Joined: Wed Oct 16, 2002 1:50 am
Location: Jonesborough, TN

Post by mrunion »

I compiled the latest version of ffmpeg I found on the net and still get the same build error. The top screen shows the Blender build error and the bottom one shows the FFMpeg build successfully...

http://www.bigpony.com/linuxscreenshots ... egprob.png
Last edited by mrunion on Thu Sep 27, 2007 1:43 am, edited 1 time in total.
Thanx,
Matt

kidb
Posts: 0
Joined: Wed Jul 23, 2003 4:31 pm
Contact:

Post by kidb »

mrunion wrote:I copiled the latest version of ffmpeg I found on the net and still get the same build error. The top screen shows the Blender build error and the bottom one shows the FFMpeg build successfully...

http://www.bigpony.com/linuxscreenshots ... egprob.png
Is there an libswscale.a in /usr/lib/ ?

./configure --help
...
--enable-swscaler software scaler support [default=no]
...

maybe you need to enable swscaler

./configure --prefix=/usr --enable-swscaler

mrunion
Posts: 0
Joined: Wed Oct 16, 2002 1:50 am
Location: Jonesborough, TN

Post by mrunion »

OK, I added the option for --enable-swscaler (it wasn't in there before) but now I can't build FFMPEG -- it fails. I gotta dig around there to see why PIX_FMT_YUVA420P and some other similar stuff isn't defined. Here goes....
Thanx,
Matt

mrunion
Posts: 0
Joined: Wed Oct 16, 2002 1:50 am
Location: Jonesborough, TN

Post by mrunion »

Alright -- Success! I had to fix a few errors in the PKGBUILD for Arch for FFMPEG, but after that everything built fine. Thanks guys!!!
Thanx,
Matt

alarionfirn
Posts: 0
Joined: Sun Nov 27, 2005 11:04 am

Post by alarionfirn »

I found out that these lines in win32-mingw-config.py
WITH_BF_FFMPEG = 'false'
BF_FFMPEG_LIB = 'avformat avutil avcodec'
BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include'
has to be changed to this
WITH_BF_FFMPEG = 'false'
BF_FFMPEG_LIB = 'avformat avutil avcodec'
BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
Compiling is without flaws now, but during the linking stage I get the following error:
Linking program ==> 'blender.exe'
=====
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(. text+0x0): multiple definition of `av_log2'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x0): first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0x30): multiple definition of `av_log2_16bit'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x30)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0x50): multiple definition of `mid_pred'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x50)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0x80): multiple definition of `clip'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x80)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0xa0): multiple definition of `clip_uint8'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xa0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0xc0): multiple definition of `ff_get_fourcc'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xc0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0xf0): multiple definition of `av_cmp_q'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xf0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0x140): multiple definition of `av_q2d'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x140
): first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0x160): multiple definition of `url_is_streamed'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x160
): first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0x170): multiple definition of `av_init_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x170
): first defined here
C:\blenderdev\build\win32-mingw\lib\libsrc.a(buttons_scene.o):buttons_scene.c:(.
text+0x1c0): multiple definition of `av_free_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x1c0
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x0): multiple definition of `av_log2'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x0):
first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x30): multiple definition of `av_log2_16bit'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x30)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x50): multiple definition of `mid_pred'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x50)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x80): multiple definition of `clip'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x80)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0xa0): multiple definition of `clip_uint8'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xa0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0xc0): multiple definition of `ff_get_fourcc'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xc0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0xf0): multiple definition of `av_cmp_q'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xf0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x140): multiple definition of `av_q2d'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x140
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x160): multiple definition of `url_is_streamed'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x160
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x170): multiple definition of `av_init_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x170
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_blenkernel.a(writeffmpeg.o):writeffmpe
g.c:(.text+0x1c0): multiple definition of `av_free_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x1c0
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x0): mu
ltiple definition of `av_log2'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x0):
first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x30): m
ultiple definition of `av_log2_16bit'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x30)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x50): m
ultiple definition of `mid_pred'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x50)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x80): m
ultiple definition of `clip'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x80)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0xa0): m
ultiple definition of `clip_uint8'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xa0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0xc0): m
ultiple definition of `ff_get_fourcc'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xc0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0xf0): m
ultiple definition of `av_cmp_q'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xf0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x140):
multiple definition of `av_q2d'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x140
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x160):
multiple definition of `url_is_streamed'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x160
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x170):
multiple definition of `av_init_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x170
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim.o):anim.c:(.text+0x1c0):
multiple definition of `av_free_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x1c0
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x0): mu
ltiple definition of `av_log2'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x0):
first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x30): m
ultiple definition of `av_log2_16bit'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x30)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x50): m
ultiple definition of `mid_pred'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x50)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x80): m
ultiple definition of `clip'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x80)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0xa0): m
ultiple definition of `clip_uint8'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xa0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0xc0): m
ultiple definition of `ff_get_fourcc'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xc0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0xf0): m
ultiple definition of `av_cmp_q'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xf0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x140):
multiple definition of `av_q2d'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x140
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x160):
multiple definition of `url_is_streamed'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x160
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x170):
multiple definition of `av_init_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x170
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(util.o):util.c:(.text+0x1c0):
multiple definition of `av_free_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x1c0
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x0):
multiple definition of `av_log2'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x0):
first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x30):
multiple definition of `av_log2_16bit'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x30)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x50):
multiple definition of `mid_pred'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x50)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x80):
multiple definition of `clip'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x80)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0xa0):
multiple definition of `clip_uint8'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xa0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0xc0):
multiple definition of `ff_get_fourcc'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xc0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0xf0):
multiple definition of `av_cmp_q'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0xf0)
: first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x140)
: multiple definition of `av_q2d'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x140
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x160)
: multiple definition of `url_is_streamed'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x160
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x170)
: multiple definition of `av_init_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x170
): first defined here
C:\blenderdev\build\win32-mingw\lib\libbf_imbuf.a(anim5.o):anim5.c:(.text+0x1c0)
: multiple definition of `av_free_packet'
C:\blenderdev\build\win32-mingw\lib\libsrc.a(hddaudio.o):hddaudio.c:(.text+0x1c0
): first defined here
C:\Programme\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe:
cannot find -lavformat
collect2: ld returned 1 exit status

=====
scons: *** [C:\blenderdev\build\win32-mingw\bin\blender.exe] Error 1
scons: building terminated because of errors.

Post Reply