Trouble compiling Pyffmpeg 2.2a on Windows for Python 2.7

458 views
Skip to first unread message

dsch...@gmail.com

unread,
Jun 23, 2012, 11:57:25 AM6/23/12
to pyff...@googlegroups.com
Hi all,

I'm trying to compile the newest version of pyffmpeg (2.2 alpha) for Windows, as I there doesn't seem to be a distro for Python 2.7.
After having solved some initial problems:

1) On r78 of setup.py, I had to adapt libinc variable to not append "\include" to the ffmpeg dir.
2) Again on r78, I had to change the incdir from a string  type to a list (otherwise you get an error msg you can't concatenate string and list).
3) The compilation then fails because gcc can't find libavutil/avconfig.h. This file has been gone for quite a while now in ffmpeg. I did find its contents on http://opendvs.googlecode.com/svn-history/r6/trunk/dvs/ffmpeg/libavutil/avconfig.h, so I added this file myself.
 
After that, the compilation process goes into a frenzy, and I get some many error messages I don't know where to start to solve them. Here's the output:

running install
running build
running build_ext
skipping 'pyffmpeg.c' Cython extension (up-to-date)
building 'pyffmpeg' extension
C compiler: gcc -O2 -Wall -Wstrict-prototypes

compile options: '-Ic:\ffmpeg -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c'
extra options: '-static-libgcc'
gcc -O2 -Wall -Wstrict-prototypes -Ic:\ffmpeg -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c pyffmpeg.c -o build\temp.win32-2.7\Release\pyffmpeg.o -static-libgcc
Found executable C:\MingW\bin\gcc.exe
pyffmpeg.c: In function '__pyx_f_8pyffmpeg_av_read_frame_flush':
pyffmpeg.c:2297:25: error: 'struct AVFormatContext' has no member named 'cur_st'
pyffmpeg.c:2307:14: error: 'struct AVFormatContext' has no member named 'cur_st'
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_5Track_10init':
pyffmpeg.c:5201:3: warning: 'avcodec_open' is deprecated (declared at c:\ffmpeg/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
pyffmpeg.c:5253:27: error: 'struct AVCodecContext' has no member named 'hurry_up'
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_5Track_18_reopencodec':
pyffmpeg.c:6428:3: warning: 'avcodec_open' is deprecated (declared at c:\ffmpeg/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
pyffmpeg.c: In function '__pyx_f_8pyffmpeg_18AudioPacketDecoder_audio_decode_frame':
pyffmpeg.c:6914:3: warning: 'avcodec_decode_audio3' is deprecated (declared at c:\ffmpeg/libavcodec/avcodec.h:3658) [-Wdeprecated-declarations]
pyffmpeg.c: In function '__pyx_f_8pyffmpeg_10AudioTrack_process_packet':
pyffmpeg.c:8428:195: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_10VideoTrack_18_internal_get_current_frame':
pyffmpeg.c:11495:198: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_10VideoTrack_20_get_current_frame_without_copy':
pyffmpeg.c:11673:198: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_10VideoTrack_36set_hurry':
pyffmpeg.c:12929:38: error: 'struct AVCodecContext' has no member named 'hurry_up'
pyffmpeg.c:12968:38: error: 'struct AVCodecContext' has no member named 'hurry_up'
pyffmpeg.c: In function '__pyx_f_8pyffmpeg_10VideoTrack__convert_to':
pyffmpeg.c:13131:3: warning: passing argument 2 of 'sws_scale' from incompatible pointer type [enabled by default]
In file included from pyffmpeg.c:283:0:
c:\ffmpeg/libswscale/swscale.h:237: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:13305:3: warning: passing argument 2 of 'sws_scale' from incompatible pointer type [enabled by default]
In file included from pyffmpeg.c:283:0:
c:\ffmpeg/libswscale/swscale.h:237:5: note: expected 'const uint8_t * const*' but argument is of type 'uint8_t **'
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_12FFMpegReader_2__dealloc__':
pyffmpeg.c:14616:5: warning: 'av_close_input_file' is deprecated (declared at c:\ffmpeg/libavformat/avformat.h:1533) [-Wdeprecated-declarations]
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_12FFMpegReader_8open':
pyffmpeg.c:14848:3: error: unknown type name 'FF_INTERNAL_MEM_TYPE'
pyffmpeg.c:15054:7: warning: implicit declaration of function 'url_setbufsize' [-Wimplicit-function-declaration]
pyffmpeg.c:15124:57: error: 'FF_INTERNAL_MEM_TYPE' undeclared (first use in this function)
pyffmpeg.c:15124:57: note: each undeclared identifier is reported only once for each function it appears in
pyffmpeg.c:15298:5: warning: implicit declaration of function 'av_open_input_stream' [-Wimplicit-function-declaration]
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_12FFMpegReader_12__finalize_open':
pyffmpeg.c:15719:3: warning: 'av_find_stream_info' is deprecated (declared at c:\ffmpeg/libavformat/avformat.h:1357) [-Wdeprecated-declarations]
pyffmpeg.c:16087:32: error: 'CODEC_TYPE_VIDEO' undeclared (first use in this function)
pyffmpeg.c:16273:32: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function)
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_12FFMpegReader_14close':
pyffmpeg.c:17006:5: warning: 'av_close_input_file' is deprecated (declared at c:\ffmpeg/libavformat/avformat.h:1533) [-Wdeprecated-declarations]
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_12FFMpegReader_16process_current_packet':
pyffmpeg.c:17516:56: error: 'CODEC_TYPE_VIDEO' undeclared (first use in this function)
pyffmpeg.c:17559:56: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function)
pyffmpeg.c:17634:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:17634:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:17672:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:17672:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c: In function '__pyx_pf_8pyffmpeg_12FFMpegReader_28read_until_next_frame':
pyffmpeg.c:18560:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:18560:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:18617:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:18617:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:18658:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:18658:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c: In function '__pyx_import_star_set':
pyffmpeg.c:22714:5: warning: implicit declaration of function '__pyx_convert__from_py_AVRational' [-Wimplicit-function-declaration]
pyffmpeg.c:22714:38: error: incompatible types when assigning to type 'struct AVRational' from type 'int'
pyffmpeg.c: In function 'initpyffmpeg':
pyffmpeg.c:24990:30: error: 'CODEC_TYPE_VIDEO' undeclared (first use in this function)
pyffmpeg.c:25007:30: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function)
pyffmpeg.c:25198:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
pyffmpeg.c:25198:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
error: Command "gcc -O2 -Wall -Wstrict-prototypes -Ic:\ffmpeg -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c pyffmpeg.c -o build\temp.win32-2.7\Release\pyffmpeg.o -static-libgcc" failed

Is there anybody who's been succesfully able to compile pyffmpeg for windows of could offer me any help with this?



jhra...@gmail.com

unread,
Jul 17, 2013, 7:28:44 PM7/17/13
to pyff...@googlegroups.com, dsch...@gmail.com
What I think  are seeing is an offshoot of pyffmpeg being built against a very specific version of FFmpeg.  Seeing "deprecated" show up is a good inidication of a version issue. 
FFmpeg is a well maintained and rapidly developing product and the installation makes 
no determination on what version of ffmpeg is already installed on the box. Was this an oversight or was this supposed to be version agnostic ?

Thanks
Jim

datou...@gmail.com

unread,
Nov 4, 2013, 10:03:30 PM11/4/13
to pyff...@googlegroups.com, dsch...@gmail.com
Hi:
   I've been encounter the same problem when build the pyffmpeg2.0 on Ubuntu 11.10, but I finally compile it successfully. Though the environment may be different, but the
   following steps may helps you:
      1. You need to replace some strings in file pyffmpeg.c:
             replace all 'CODEC_TYPE_AUDIO' with 'AVMEDIA_TYPE_AUDIO'
             replace all 'CODEC_TYPE_VIDEO' with 'AVMEDIA_TYPE_VIDEO'
 
      2. Commented some code lines in file pyffmpeg.c:
             all code lines include 'CodecCtx->hurry_up ....' should be commented
 
      3. You also need to replace some strings in file pyffmpeg.py:
             (some places according to compile error messages)
              replace the '__init__' with '__cinit__'
 
      Now try again.
      Hope it can helps you.

在 2012年6月23日星期六UTC+8下午11时57分25秒,dsch...@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages