rbash88 / pyffmpeg

Automatically exported from code.google.com/p/pyffmpeg
0 stars 0 forks source link

How to install pyffmpeg on Ubuntu 8.04 #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Since I am not a member of the project - take this with caution:

1) use Synaptic (or apt-get/aptitude) to install the following packages:
ffmpeg, libavcodec-dev, libavformat-dev, libavutil-dev, python-dev,
python-Pyrex

2) verify that /usr/include/ffmpeg was created

3) in "pyffmpeg.pyx", fix line #584 (arguments of function "GetFrameTime"),
namely, change the  var type of "timestep" from type "float" to "int64_t",
so that the function header would be:
    def GetFrameTime(self,int64_t timestamp):

4) if you got here, you should not be editing anything else ... (unlike
other protocols in this project's post) just go to the project folder on
your machine

5) 'python setup.py build' (I got about 6 compilation warnings ...)

6) I use 'checkinstall' as an installation tool but it is not a must:
'sudo checkinstall python setup.py install'

7) enter whatever you wish when asked by checkinstall and there-you-have-it !

Original issue reported on code.google.com by amit.mor...@gmail.com on 16 Oct 2008 at 9:38

GoogleCodeExporter commented 8 years ago
amit's comments were extremely useful for me. 
Also had to change line #22 at setup py for:
        Extension("pyffmpeg", ["pyffmpeg/pyffmpeg.pyx"],
Got the same 6 compilation warnings. 

Original comment by razzari on 27 Dec 2008 at 11:33

GoogleCodeExporter commented 8 years ago
needed to install libswscale-dev as well and found GetFrameTime() at line 631.
Thanks for pointing the stuff out.

Original comment by sfisc...@gmail.com on 30 Apr 2009 at 6:16

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
pyffmpeg-read-only will cause:
/pyffmpeg.pyx:0:0: 'pyffmpeg-read-only.pyffmpeg' is not a valid module name
So don't do that. do mv pyffmpeg-read-only/ pyffmpeg

sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libavutil-dev 
python-dev
python-pyrex libswscale-dev libbz2-dev checkinstall

2) don't verify that /usr/include/ffmpeg was created (it isn't on my box, but 
still work)

3) in "pyffmpeg.pyx", line #631 change the  var type of "timestep" from type 
"float"
to "int64_t", so that the function header would be:
    def GetFrameTime(self,int64_t timestamp):

python setup.py build

sudo checkinstall python setup.py install

Original comment by cfkars...@gmail.com on 6 Oct 2009 at 2:48

GoogleCodeExporter commented 8 years ago
On modern Ubuntu Linux boxes,

For compiling the beta

The following packages are required : 
* libavcodec-dev libavformat-dev libavutil-dev python-dev  libswscale-dev 
libbz2-dev
* python-PIL python-numpy
* Cython

If you have problem during the "cythonization" :
Try with the latest version of Cython.
Ubuntu Cython distribs were sometime a bit outdated.

There are still many warning while compiling the beta.
Please, let us know.

Original comment by bertrand...@gmail.com on 8 Jan 2010 at 3:39

GoogleCodeExporter commented 8 years ago
The Python Imaging Library (PIL) package name under Debian/Ubuntu is 
python-imaging not python-pil.

Original comment by mathias@mwinkler.at on 1 May 2010 at 8:12

GoogleCodeExporter commented 8 years ago
Trying to install the new beta:
OS: Ubuntu 10.04 (Lucid)
Cython ver: 0.12.1 (latest version for today)

- All dependencies listed above are met.

- Turkish locale! Forgive me if I had to do something else prior to compilation.

Here's the output:

can@can-laptop:~/pyffmpeg-1.9.0beta$ sudo python setup.py build
running build
running build_ext
cythoning pyffmpeg.pyx to pyffmpeg.c
Traceback (most recent call last):
  File "setup.py", line 130, in <module>
    **meta_data
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/usr/local/lib/python2.6/dist-packages/Cython/Distutils/build_ext.py", line 82, in build_extensions
    ext.sources = self.cython_sources(ext.sources, ext)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Distutils/build_ext.py", line 197, in cython_sources
    full_module_name=module_name)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Main.py", line 716, in compile
    return compile_single(source, options, full_module_name)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Main.py", line 663, in compile_single
    return run_pipeline(source, options, full_module_name)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Main.py", line 561, in run_pipeline
    err, enddata = context.run_pipeline(pipeline, source)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Main.py", line 221, in run_pipeline
    data = phase(data)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Main.py", line 154, in generate_pyx_code
    module_node.process_implementation(options, result)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/ModuleNode.py", line 72, in process_implementation
    self.generate_c_code(env, options, result)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/ModuleNode.py", line 274, in generate_c_code
    self.body.generate_function_definitions(env, code)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Nodes.py", line 341, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Nodes.py", line 341, in generate_function_definitions
    stat.generate_function_definitions(env, code)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Nodes.py", line 1062, in generate_function_definitions
    code.mark_pos(self.pos)
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Code.py", line 1034, in mark_pos
    source_desc.get_escaped_description(), line, u'\n'.join(lines))
  File "/usr/local/lib/python2.6/dist-packages/Cython/Compiler/Scanning.py", line 129, in get_escaped_description
    self.get_description().encode('ASCII', 'replace').decode("ASCII")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14: 
ordinal not in range(128)

Original comment by logikits...@gmail.com on 27 Jun 2010 at 6:37

GoogleCodeExporter commented 8 years ago
Hmm, I had a look at my development version, there is apparently no strange 
character in the source.

Can you have a try with this latest version :

git clone "http://github.com/tranx/pyffmpeg.git/" 
git checkout origin/beta

I believe I will update this release as pyffmpeg2 soon.

Original comment by bertrand...@gmail.com on 27 Jun 2010 at 6:51

GoogleCodeExporter commented 8 years ago
I tried with the latest git version; still the same.

Original comment by logikits...@gmail.com on 27 Jun 2010 at 7:13

GoogleCodeExporter commented 8 years ago
Sorry, please don't take into consideration my previous comment as the branch 
didn't actually change to origin/beta for my first attempt.
It could compile it successfully using the latest version.
Thank you.

Original comment by logikits...@gmail.com on 27 Jun 2010 at 7:23

GoogleCodeExporter commented 8 years ago
Ok great, so I will update the package during the week, so that other users 
don't face this bug. Feel free to ask more questions, if you have other issues 
with the package.

Original comment by bertrand...@gmail.com on 27 Jun 2010 at 7:27

GoogleCodeExporter commented 8 years ago
Hi, I tried to compile pyffmpeg 2.1.beta on Ubuntu 8.04 with Cython 0.14, but I 
always get the following error:
...
  File "... /python2.5/site-packages/Cython/Compiler/TypeSlots.py", line 100, in fixed_arg_type
    return self.format_map[self.fixed_arg_format[i]]
KeyError: 'T'

Does anyone know how to solve this error?

Original comment by philippe...@gmail.com on 3 Feb 2011 at 2:24

GoogleCodeExporter commented 8 years ago
Hmm ,this is somehow an "internal compiler error", so this means that something 
happened in the source code that was unexpected. My intuition, is that 
generally Cython 0.14 users are on using python 2.6/2.7, and maybe there is 
some unnoticed bug in-between python 2.5 and cython 0.14, I would try compiling 
with older version of Cython, (or upgrading my python... but this is larger 
operation)

It is also possible that there is something awkward in the source code of 
pyffmpeg, but I cannot tell you if I don't know where the compiler crashed in 
the source code...
'T' is supposed to be the key for the type for the self keyword in python.

Original comment by bertrand...@gmail.com on 3 Feb 2011 at 2:46

GoogleCodeExporter commented 8 years ago
ok thank you, with cython 0.12 it compiles fine.

Original comment by philippe...@gmail.com on 4 Feb 2011 at 9:58

GoogleCodeExporter commented 8 years ago
This is a known problem that has already been reported but is still not fixed 
in the trunk: http://code.google.com/p/pyffmpeg/issues/detail?id=33

It's a bug in pyffmpeg and sort of in Cython. The use of __new__ instead of 
__cinit__ has been deprecated for years and Cython till 0.13 issued a warning, 
but went on happily. Problem is, you normally don't see warnings with Cython.

From 0.14 on this fall back behaviour isn't supported any more, but Cython 
still only issues a warning but doesn't raise an error. This ultimately leads 
to the error above and you have no clue what initially went wrong from the 
error message presented. Oh, by the way this is also a known issue for Cython 
0.14 and hopefully someone fixes it.

Original comment by md...@gmx.de on 5 Feb 2011 at 12:14

GoogleCodeExporter commented 8 years ago

Original comment by martin.h...@gmail.com on 17 Mar 2011 at 11:38