Unable to build

99 views
Skip to first unread message

Rio

unread,
May 2, 2011, 8:42:52 AM5/2/11
to pyffmpeg
First thanks for doing this, i've been looking around for something
like this for a long time!

I've been trying to get it to work for a week now with different
methods.
I'd like to build it in a seperate environment as i'm on my
workstation and it has to be stable at all times. Here is what i've
done so far:

made a virtual environment with virtualenv.
installed cython through pip in there.
did a git checkout of ffmpeg for the 2.2 alpha of pyffmpeg
(git-35d7d6f)
build it and installed it in my virtual environment.
grabbed the pyffmpeg 2.2alpha package.
extrackted it and edited the setup.py to point to ffmpeg in the
virtual environment.
ran virtualenv/bin/python setup.py install.

and it fails everytime on all versions of ffmpeg and pyffmpeg i throw
at it.
I really hope you can help me.
I'm on debian squeeze 64 bit.
here is the build log:


running install
running build
running build_ext
skipping 'pyffmpeg.c' Cython extension (up-to-date)
building 'pyffmpeg' extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -
Wall -Wstrict-prototypes -fPIC

compile options: '-I/home/rio/Documents/Programming/testenv/include -I/
usr/include -I./include -I/usr/lib/pymodules/python2.6/numpy/core/
include -I/usr/include/python2.6 -c'
gcc: pyffmpeg.c
pyffmpeg.c: In function ‘__pyx_pf_8pyffmpeg_10VideoTrack_init’:
pyffmpeg.c:8789: warning: ‘sws_getContext’ is deprecated (declared at /
home/rio/Documents/Programming/testenv/include/libswscale/swscale.h:
191)
pyffmpeg.c: In function ‘__pyx_f_8pyffmpeg_10VideoTrack__convert_to’:
pyffmpeg.c:11892: warning: passing argument 2 of ‘sws_scale’ from
incompatible pointer type
/home/rio/Documents/Programming/testenv/include/libswscale/swscale.h:
223: note: expected ‘const uint8_t * const*’ but argument is of type
‘uint8_t **’
pyffmpeg.c: In function
‘__pyx_f_8pyffmpeg_10VideoTrack__convert_withbuf’:
pyffmpeg.c:12062: warning: passing argument 2 of ‘sws_scale’ from
incompatible pointer type
/home/rio/Documents/Programming/testenv/include/libswscale/swscale.h:
223: note: expected ‘const uint8_t * const*’ but argument is of type
‘uint8_t **’
pyffmpeg.c: In function ‘__pyx_pf_8pyffmpeg_1py_av_register_all’:
pyffmpeg.c:2055: warning: ‘__pyx_v___registered’ is used uninitialized
in this function
pyffmpeg.c: In function
‘__pyx_pf_8pyffmpeg_12FFMpegReader_6__finalize_open’:
pyffmpeg.c:14182: warning: ‘__pyx_v_i’ may be used uninitialized in
this function
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-
x86_64-2.6/pyffmpeg.o -L/home/rio/Documents/Programming/testenv/lib -
lavformat -lavcodec -lavutil -lswscale -o build/lib.linux-x86_64-2.6/
pyffmpeg.so
/usr/bin/ld: /home/rio/Documents/Programming/testenv/lib/
libavformat.a(allformats.o): relocation R_X86_64_32 against
`ff_a64_muxer' can not be used when making a shared object; recompile
with -fPIC
/home/rio/Documents/Programming/testenv/lib/libavformat.a: could not
read symbols: Bad value
collect2: ld returned 1 exit status
/usr/bin/ld: /home/rio/Documents/Programming/testenv/lib/
libavformat.a(allformats.o): relocation R_X86_64_32 against
`ff_a64_muxer' can not be used when making a shared object; recompile
with -fPIC
/home/rio/Documents/Programming/testenv/lib/libavformat.a: could not
read symbols: Bad value
collect2: ld returned 1 exit status

KATO Kanryu

unread,
May 2, 2011, 11:01:20 AM5/2/11
to pyff...@googlegroups.com
hi, Rio

I think there are too many compiler options.

I have a Gentoo Linux system for x64, now build pyffmpeg-2.2 alpha and
the ffmpeg and successed.

here it is all log for pyffmpeg:

pyffmpeg $ python setup.py build
Remember: Edit at first ffmpegpath within setup.py
running build
running build_ext
cythoning pyffmpeg.pyx to pyffmpeg.c
building 'pyffmpeg' extension
C compiler: x86_64-pc-linux-gnu-gcc -pthread -fPIC

compile options: '-I../ffmpeg/include -I/usr/include -I./include
-I/usr/lib64/python2.6/site-packages/numpy/core/include
-I/usr/include/python2.6 -c'
x86_64-pc-linux-gnu-gcc: pyffmpeg.c
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_10VideoTrack_init':
pyffmpeg.c:8714:12: warning: 'sws_getContext' is deprecated (declared
at ../ffmpeg/include/libswscale/swscale.h:191)
pyffmpeg.c: In function '__pyx_f_8pyffmpeg_10VideoTrack__convert_to':
pyffmpeg.c:11808:3: warning: passing argument 2 of 'sws_scale' from
incompatible pointer type
../ffmpeg/include/libswscale/swscale.h:223:5: note: expected 'const


uint8_t * const*' but argument is of type 'uint8_t **'
pyffmpeg.c: In function '__pyx_f_8pyffmpeg_10VideoTrack__convert_withbuf':

pyffmpeg.c:11972:3: warning: passing argument 2 of 'sws_scale' from
incompatible pointer type
../ffmpeg/include/libswscale/swscale.h:223:5: note: expected 'const
uint8_t * const*' but argument is of type 'uint8_t **'
x86_64-pc-linux-gnu-gcc -pthread -shared
build/temp.linux-x86_64-2.6/pyffmpeg.o -L../ffmpeg/lib -L/usr/lib64
-lavformat -lavcodec -lavutil -lswscale -lpython2.6 -o
build/lib.linux-x86_64-2.6/pyffmpeg.so
cythoning audioqueue.pyx to audioqueue.c
warning: audioqueue.pyx:1:0: __getslice__, __setslice__, and
__delslice__ are not supported by Python 3, use __getitem__,
__setitem__, and __delitem__ instead
building 'audioqueue' extension
C compiler: x86_64-pc-linux-gnu-gcc -pthread -fPIC

compile options: '-I../ffmpeg/include -I/usr/include -I./include
-I/usr/lib64/python2.6/site-packages/numpy/core/include
-I/usr/include/python2.6 -c'
x86_64-pc-linux-gnu-gcc: audioqueue.c
x86_64-pc-linux-gnu-gcc -pthread -shared
build/temp.linux-x86_64-2.6/audioqueue.o -L../ffmpeg/lib -L/usr/lib64
-lavformat -lavcodec -lavutil -lswscale -lpython2.6 -o
build/lib.linux-x86_64-2.6/audioqueue.so
cythoning pyffmpeg_numpybindings.pyx to pyffmpeg_numpybindings.c
building 'pyffmpeg_numpybindings' extension
C compiler: x86_64-pc-linux-gnu-gcc -pthread -fPIC

compile options: '-I../ffmpeg/include -I/usr/include -I./include
-I/usr/lib64/python2.6/site-packages/numpy/core/include
-I/usr/include/python2.6 -c'
x86_64-pc-linux-gnu-gcc: pyffmpeg_numpybindings.c
x86_64-pc-linux-gnu-gcc -pthread -shared
build/temp.linux-x86_64-2.6/pyffmpeg_numpybindings.o -L../ffmpeg/lib
-L/usr/lib64 -lavformat -lavcodec -lavutil -lswscale -lpython2.6 -o
build/lib.linux-x86_64-2.6/pyffmpeg_numpybindings.so
pyffmpeg $

Bertrand Nouvel

unread,
May 2, 2011, 11:35:34 AM5/2/11
to pyff...@googlegroups.com
Hi Rio, 

Thanks for the message.

Thanks Kato for your contributions too, for your answer too. 

However, from my understanding, the error message is quite explicit : 

You are trying to build a dynamic library(the pyffmpeg module is a dynamic loading library for python)
 based on a static version of FFMPEG... However, this static version of FFMPEG has not
been built with the option "-fPIC" and this option is mandatory on 64 bits to create dynamicly loadable
code. 


Thus you need to install the dynamic versions of ffmpeg in order to be able to compile 
pyffmpeg.  Once you will have done so you will have ".so" files like libavcodec.so,
and then pyffmpeg will compile fine.

Let us know if this solves your problem.

Bertrand



2011/5/2 Rio <rioki...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "pyffmpeg" group.
To post to this group, send email to pyff...@googlegroups.com.
To unsubscribe from this group, send email to pyffmpeg+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyffmpeg?hl=en.


Rio

unread,
May 2, 2011, 6:05:03 PM5/2/11
to pyffmpeg
Thanks for the tip!

Maybe you should be putting this stuff in the readme?
would be helping guys like me out a lot :)

I'll be writing some stuff with it so expect some more questions from
me!

On May 2, 5:35 pm, Bertrand Nouvel <bertrand.nou...@gmail.com> wrote:
> Hi Rio,
>
> Thanks for the message.
>
> Thanks Kato for your contributions too, for your answer too.
>
> However, from my understanding, the error message is quite explicit :
>
> You are trying to build a dynamic library(the pyffmpeg module is a dynamic
> loading library for python)
>  based on a static version of FFMPEG... However, this static version of
> FFMPEG has not
> been built with the option "-fPIC" and this option is mandatory on 64 bits
> to create dynamicly loadable
> code.
>
> Thus you need to install the dynamic versions of ffmpeg in order to be able
> to compile
> pyffmpeg.  Once you will have done so you will have ".so" files
> like libavcodec.so,
> and then pyffmpeg will compile fine.
>
> Let us know if this solves your problem.
>
> Bertrand
>
> 2011/5/2 Rio <riokierk...@gmail.com>
Reply all
Reply to author
Forward
0 new messages