Comments (20)
I've also posted it on stack overflow, if anyone is interested
http://stackoverflow.com/questions/7823082/problems-installing-pyffmpeg-on-mac-o
s-x
Original comment by [email protected]
on 19 Oct 2011 at 3:08
from pyffmpeg.
It is probably related to the fact that the modern version of cython, you are
using...
I have to update the code. There are many recent posts related to this issue
__new__ should be replaced by __cinit__ everywhere in the code. I hope we'll
find time to provide a new version to everyone soon. I am working on it, but
unfortunately at very slow pace.
Original comment by [email protected]
on 19 Oct 2011 at 10:23
from pyffmpeg.
So, I've substituted __new__ for __cinit__ and change the signatures from cdef
to def, as this was giving me another error, and now I still get errors, but
I've looked at the included files in the c compiling and I couldn't find it, so
that might be the error, I've got ffmpegx installed and ffmpeg in macports, I'm
installing ffmpeg-devel to see if it helps. By the way, it would be great to
have a dependency listing somewhere, have I overlooked it?
thanks for the help!
Original comment by [email protected]
on 20 Oct 2011 at 7:57
from pyffmpeg.
Ok, so I've narrowed it down to a problem with the __registered variable,
apparently the function py_av_register_all() is confusing what should be the
global variable __registered with a local variable which hasn't been assigned.
I've pasted the resulting code below. Is it maybe a problem with how you define
local and global variables in cython?
thanks again!
---
sampa:pyffmpeg-2.1beta alex$ sudo python setup.py install
running install
running build
running build_ext
cythoning pyffmpeg.pyx to pyffmpeg.c
warning: pyffmpeg.pyx:1904:49: Unreachable code
Error compiling Cython file:
------------------------------------------------------------
...
##################################################################
def py_av_register_all():
if __registered:
^
------------------------------------------------------------
pyffmpeg.pyx:705:19: local variable '__registered' referenced before assignment
building 'pyffmpeg' extension
C compiler: llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe
-fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE
-DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g
-fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64
-pipe
compile options: '-I/opt/ffmpeg/include -I/usr/include/ffmpeg -I./include
-I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macos
x-10.7-x86_64.egg/numpy/core/include
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
llvm-gcc-4.2: pyffmpeg.c
pyffmpeg.c:1:2: error: #error Do not use this file, it is the result of a
failed Cython compilation.
pyffmpeg.c:1:2: error: #error Do not use this file, it is the result of a
failed Cython compilation.
lipo: can't open input file: /var/tmp//ccXZr5zV.out (No such file or directory)
pyffmpeg.c:1:2: error: #error Do not use this file, it is the result of a
failed Cython compilation.
pyffmpeg.c:1:2: error: #error Do not use this file, it is the result of a
failed Cython compilation.
lipo: can't open input file: /var/tmp//ccXZr5zV.out (No such file or directory)
error: Command "llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os
-pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE
-DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g
-fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64
-pipe -I/opt/ffmpeg/include -I/usr/include/ffmpeg -I./include
-I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macos
x-10.7-x86_64.egg/numpy/core/include
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
pyffmpeg.c -o build/temp.macosx-10.7-intel-2.7/pyffmpeg.o" failed with exit
status 1
Original comment by [email protected]
on 20 Oct 2011 at 8:42
from pyffmpeg.
Well the fix should be just declare the variable before :
Well sorry to make you work
The fix should simply be, write before the def :
__registered=False
Thanks for your efforts.
BTW, you are right for the dependency list for each platform.
Most programmers now C-dependencies for compiling involve to have the
"devel"-package. But it would be nice to have clean instructions and automated
build on all platforms... A project... we have never been able to make concrete
so far.
Original comment by [email protected]
on 20 Oct 2011 at 9:11
from pyffmpeg.
Ok, so the problem is the __registered is defined beforehand in the code, which
just makes the whole thing spooky! I've moved the definition to before the
function definition so it actually shows in the error message:
--
...
cdef __registered
__registered = False
def py_av_register_all():
if __registered:
^
------------------------------------------------------------
pyffmpeg.pyx:703:19: local variable '__registered' referenced before assignment
I don't know why he's looking for a local variable...
I'm fine working on it a bit, as long as I don't take months to do it.
Original comment by [email protected]
on 20 Oct 2011 at 9:26
from pyffmpeg.
Has anyone managed to fix this? I've ran into exactly the same thing on
FreeBSD. If no one fixed this I can have a look at it I just don't want to
reinvent the wheel
Original comment by [email protected]
on 14 Nov 2011 at 4:31
from pyffmpeg.
Hi, I've managed to get around it, basically I did a find-replace of "cdef
__new__:" for "def __cinit:" and changed the line above to
def py_av_register_all():
global __registered
if __registered:
...
It did compile, but I still couldn't manage to get all the libraries linked, so
I'm not sure if it's 100% functional.
I'm not sure if I should upload the changes, any dev want to venture a comment?
Alex.
Original comment by [email protected]
on 14 Nov 2011 at 4:36
from pyffmpeg.
I got it to compile on 10.7 for Python 2.7 (macports) with ffmpeg-devel
@20111104_0+nonfree (also macports).
Changes needed to pyffmpeg.pyx:
1) replace "cdef __new__" with "def __cinit__" as mentioned above
2) add global __registered as mentioned above
3) search/replace "CODEC_TYPE" with "AVMEDIA_TYPE" (I guess ffmpeg devs changed
this)
4) remove all references to "hurry_up" (ffmpeg devs say it's deprecated and
removed from ffmpeg)
5) search/replace "guess_format" with "av_guess_format" (otherwise import fails
with "no such symbol: _guess_format")
Also some path tweaking in setup.py was needed so it would recognize macports
includes.
With these changes the module can be imported into python without errors and
the interpreter recognizes module members... but it crashes after calling
FFMpegReader.open() on a file.
Not sure if #5 is legal... but Python complained it couldn't find guess_format
symbol and indeed there is no such symbol in libavcodec or libavformat but I
found the av_guess_format which sounds similar. Maybe these two are not
interchangeable and pyffmpeg needs a thorough refactoring.
Also not sure if #4 has other ramifications. Maybe it needs to be replaced with
something else.
Obviously pyffmpeg needs to be updated to use the latest ffmpeg source before
it can be compiled.
This is my first experience with cython and ffmpeg so maybe these changes don't
make any sense... but at least I got it to compile and import into python.
I'll post a patch if I get it all to work properly.
Original comment by [email protected]
on 17 Nov 2011 at 1:55
from pyffmpeg.
I got as far as you did. Thanks for the work! It doesn't crash for me though. I
was obviously missing the ffmpeg-devel library and was linking with the wrong
path in the setup.py. I'll fiddle around a bit more, let you know if I stumble
onte something.
Best.
Alex.
Original comment by [email protected]
on 17 Nov 2011 at 8:16
from pyffmpeg.
Original comment by [email protected]
on 24 Nov 2011 at 5:42
Attachments:
from pyffmpeg.
Hey,
I tried the above fix and managed to complete the python setup.py install. But
when I import i get:
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/pyffmpeg.so, 2):
Symbol not found: _av_close_input_file
Referenced from: /usr/local/lib/python2.7/site-packages/pyffmpeg.so
Expected in: dynamic lookup
Any ideas?
For reference I'm on Os 10.6 and python 2.7.2
Regards,
Graham
Original comment by [email protected]
on 29 Nov 2011 at 7:17
from pyffmpeg.
Just ran into this issue myself, Mac OS X 10.7.2 (Lion), Xcode 4.2, using
pyffmpeg-2.1beta,
$ python setup.py build
...
pyffmpeg.pyx:808:4: __new__ method of extension type will change semantics in a
future version of Pyrex and Cython. Use __cinit__ instead.
...
Have the changes described above been applied to the repository yet? I've had a
look at the SVN, but can't see any recent changes on
http://code.google.com/p/pyffmpeg/source/browse/ - but then I found the
"unofficial" github repository instead, https://github.com/mhaller/pyffmpeg/ -
but here too both the master and v2.2alpha branches are using __new__ still.
Original comment by [email protected]
on 13 Jan 2012 at 4:19
from pyffmpeg.
See also these patches from Robert Kern (NumPy developer), see:
http://mail.scipy.org/pipermail/numpy-discussion/2012-January/059865.html
>> Thanks for the suggestion.
>>
>> Sadly right now pyffmpeg won't install on Mac OS X,
>> at least not with the version of Cython I have installed:
>> http://code.google.com/p/pyffmpeg/issues/detail?id=44
>>
>> There doesn't seem to have been any activity on the
>> official repository for some time either.
>
> Oh, right, I had to fix those, too. I've attached the patches that I
> used. I used MacPorts to install the ffmpeg libraries, so I modified
> the paths in the setup.py appropriately.
Original comment by [email protected]
on 18 Jan 2012 at 10:55
Attachments:
from pyffmpeg.
Why aren't these patches merged into the downloadable version yet?
Original comment by [email protected]
on 2 Feb 2012 at 9:39
from pyffmpeg.
Good news, everyone!
For your convenience, I have applied the patches mentioned above + some new
needed fixes and put them up at https://github.com/vvrbanc/pyffmpeg
My repo is a fork of https://github.com/mhaller/pyffmpeg, which is the latest
available unofficial version from one of the project maintainers.
It compiles against current macport of ffmpeg-devel, which is @20111104 as of
Feb 20. 2012.
If you have issues with my fork, please post your comments at github, not here.
An alternative approach to compiling pyffmpeg is to get latest mhaller's
version from git://github.com/mhaller/pyffmpeg.git and compile it against the
FFmpeg version he used... it's listed in the README file on github.
Basically, just go to https://github.com/mhaller/pyffmpeg and
https://github.com/FFmpeg/FFmpeg/tree/35d7d6f7489c75aaa2fcb39820fb25b0fd44524b
, download repos as zipballs, compile, install.
If you're installing FFmpeg to an alternative location, remember to edit
setup.py for pyffmpeg at line 34 and include your new path.
Cheers,
Vedran
Original comment by [email protected]
on 20 Feb 2012 at 9:24
from pyffmpeg.
@16: Building fails with the following error message and setup from your Git
repository:
$ python2 setup.py build
pyffmpeg.c: In function '__pyx_import_star_set':
pyffmpeg.c:22675:38: error: incompatible types when assigning to type 'struct
AVRational' from type 'int'
cython 0.16
ffmpeg 1:0.11.1
python2 2.7.3
pyffmpeg.c: http://pastebin.com/atatvCzS (relevant function)
Original comment by [email protected]
on 23 Jul 2012 at 3:59
from pyffmpeg.
my build fails with the same error message too; I have filed a new issue on
google code.lets see.
Original comment by [email protected]
on 17 Sep 2012 at 9:26
from pyffmpeg.
[deleted comment]
from pyffmpeg.
I've installed ffmpeg with brew
I have the latest version of the fixed pyffmpeg supplied by Vedran Vrbanc
(thank you)
https://github.com/vvrbanc/pyffmpeg.git
I've posted an gist here with the compile error:
https://gist.github.com/pjakobsen/6390588
Any hints would be much appreciated? I suspect this may be happening because
brew installs the latest version of ffmpeg, which is either not a development
version or is incompatible with the dependencies required by this particular
version of pyffmpeg. Am I on the right track? I'm reluctant to start
installing ffmpeg with port because I hear running both port and brew can mess
up OS X
Original comment by [email protected]
on 30 Aug 2013 at 2:52
from pyffmpeg.
Related Issues (20)
- An error in the usage examples. HOT 1
- setup.py fails with cython 0.14 HOT 3
- get_next_frame() not in sync with video file HOT 3
- sys is not defined HOT 3
- Import Erorr: No module found pyffmpeg HOT 1
- seek_to_frame not working on long .mp4 files
- Undefined Symbol: av_free_packet HOT 1
- Build on Ubuntu 11.04, python 2.7 AMD fails HOT 1
- Error opening media when using standalone executables with either py2app or pyinstaller HOT 1
- ImportError: DLL load failed: No such module has been found HOT 1
- ImportError: DLL load failed: The specified procedure could not be found.
- module declaration
- No 32 bits build HOT 1
- pyffmpeg 2.0 & 2.1 beta under Fedoara 16 with python 2.7.2 - error compiling HOT 1
- Build on Ubuntu 11.10 python 2.7.2+ Intel Centrino Duo 32bit fails HOT 1
- The "python-numpy-devel" package is required by "setup.py", but it is not documented
- The "libffmpeg-devel" package is required during the compilation, but it is not documented
- Error: "undefined reference to `floorf' " during the compilation
- Fails to build in Fedora15 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyffmpeg.