View previous topic :: View next topic |
Author |
Message |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Mon Jan 10, 2005 7:42 pm Post subject: HOWTO: Build pymedia on Linux |
|
|
First get the pymedia package off the sourceforge:
http://sourceforge.net/project/showfiles.php?group_id=86491&package_id=89813
The bigger the number the better codecs support and more features.
( don't rely it will have less bugs though )
Unzip the archive into the place you want:
Code: | tar xfz pymedia-x.x.x.x |
The next step is to install vorbis and mp3 encoding.
Get these:
Code: | lame-3.96.1.tar.gz
libogg-1.1.tar.gz
libvorbis-1.0.1.tar.gz
faad2 (latest version is fine) |
Unzip them and install as described in the README file inside the approppriate archive.
Make sure you use GCC3.x, do:
gcc 4.0 wil not work for any version below 1.3.5.0-pre2 !
Then go to the place you unzipped pymedia into. And type:
Code: | python setup.py build |
Then just click ENTER upon prompt.
If you got problem saying something like below:
Code: |
...
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open ...
|
You do not have python-devel package installed. Instal it first before proceeding any further !
Anything else may be related to either gcc version( see next post about gcc-3.4.* ). Or faad. Right now PyMedia do not support FAAD2. So you have to uninstall it first. It will get fixed in the next versions.
Upon completion you need to install the pymedia as root by:
Code: | python setup.py install |
Version 1.2.3.0 cannot run under regular user, you have to be root. All other versions can be run under any user. Some features such as direct sound card access still may require root priviledges. But it depends on your settings.
If you encounter any problem finding liblame or libogg like below:
Code: |
ImportError: libmp3lame.so.0: cannot open shared object file: No such file or directory
|
just run the following:
Code: |
export LD_LIBRARY_PATH=<path_to_libraries>
|
If you want to play movies with pymedia make sure you do the following: Code: | 1. Get pygame-1.6 sources
2. Update it with the patch from [url=http://66.159.221.186/pygame-1.6-overlay.patch.gz]here[/url]
3. Go to the pygame directory and run: python setup.py install |
After that you should be able to run movies with the examples/vplayer.py script.
Last edited by jbors on Tue Nov 01, 2005 4:25 pm; edited 13 times in total |
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Mon Jan 31, 2005 11:06 pm Post subject: |
|
|
Just got a fix from Lane Dailey <rldailey@blarg.net>
It fixes compiling issues under gcc-3.4.*
Here is the explanation:
Code: |
Here is a patch for three files that needed modification when
building pymedia from source on a Mandrake 10.1 Linux system,
using gcc version 3.4.1. All three files are in the directory
video/libavcodec/i386. The same problem occurred with pymedia
versions 1.2.2.1 and 1.2.3.0-pre2 from Sourceforge.
Without these changes, the files would compile, but the vcodec.so
library would cause undefined symbol errors when Python tried
to dynamically link it (during "import pymedia").
The change is to insert ",used" into the definitions of these five
long integer constants. I found a similar patch on a mailing list
for libavcodec, and just imitated it here. Apparently the problem
comes from recent changes in gcc.
|
Thanks a lot Lane ! |
|
Back to top |
|
 |
spot Newbie
Joined: 28 Aug 2005 Posts: 13
|
Posted: Sun Aug 28, 2005 9:06 pm Post subject: with gcc4 |
|
|
with gcc4 on fedora core 4 i get:
video/common.h:66: error: array type has incomplete element type
video/common.h:70: error: array type has incomplete element type
is this a known problem?
I get it with versions 1.2.3pre2 and 1.2.2.1 |
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Sun Aug 28, 2005 9:57 pm Post subject: |
|
|
Can you grab CVS and try that ? |
|
Back to top |
|
 |
Sibshops
Joined: 02 Sep 2005 Posts: 3
|
Posted: Fri Sep 02, 2005 4:28 am Post subject: |
|
|
This problem still occurs off of cvs as of Sep2.
audio/libavcodec/common.h:881: error: array type has incomplete element type
audio/libavcodec/common.h:885: error: array type has incomplete element type |
|
Back to top |
|
 |
Sibshops
Joined: 02 Sep 2005 Posts: 3
|
Posted: Fri Sep 02, 2005 4:58 am Post subject: |
|
|
I tried building on FC2 and the build was successful. Maybe the problem is with the new GCC? |
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Fri Sep 02, 2005 6:14 am Post subject: |
|
|
It seems GCC syntax changes are incompatible with some declarations in pymedia. If anyone can help, please do so, I'm pretty swamped with making 1.4 so will not be able to address the issue for 2-3 months at least. |
|
Back to top |
|
 |
mpatterson500z Newbie
Joined: 05 Oct 2005 Posts: 9
|
Posted: Wed Oct 05, 2005 1:32 pm Post subject: |
|
|
Has anyone managed to compile under linuxPPC. I gave a hack at it last night, and by switching dependencies to the NONMMX files I was able to compile without errors, but then I end up with a non functional pymedia.
Any ideas? |
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Wed Oct 05, 2005 2:11 pm Post subject: |
|
|
Sounds interesting. What does it say that is nonfunctional ? |
|
Back to top |
|
 |
mheslep
Joined: 27 Oct 2005 Posts: 2
|
Posted: Thu Oct 27, 2005 4:14 pm Post subject: pymedia linux build with gcc 4.0 / 3.2 |
|
|
gcc 4.0 ( Fedora 4) still causes this problem:
In file included from video/libavcodec/h263.c:32:
video/common.h:66: error: array type has incomplete element type
video/common.h:70: error: array type has incomplete element type
this same problem occurs compiling ffmpeg from source. configure --cc=gcc32 solves the problem there and make completes successfully with ffmpeg.
Likewise w/ pymedia:
Code: | export CC=gcc32
python setup.py build |
takes you pass the 'element type' problem and it churns almost all the way home until:
Code: |
In file included from video/libavcodec/i386/dsputil_mmx.c:130:
video/libavcodec/i386/dsputil_mmx_rnd.h: In function `put_no_rnd_pixels8_l2_mmx':
video/libavcodec/i386/dsputil_mmx_rnd.h:60: can't find a register in class `BREG' while reloading `asm'
error: command 'gcc32' failed with exit status 1
|
Now what? |
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Thu Oct 27, 2005 7:41 pm Post subject: |
|
|
Which pymedia version is that ? |
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Tue Nov 01, 2005 4:26 pm Post subject: |
|
|
CVS version fixes gcc4.0 issue |
|
Back to top |
|
 |
guzugi2
Joined: 11 Jan 2006 Posts: 2
|
Posted: Wed Jan 11, 2006 8:16 pm Post subject: |
|
|
where is this patch?
jbors wrote: | Just got a fix from Lane Dailey <rldailey@blarg.net>
It fixes compiling issues under gcc-3.4.*
Here is the explanation:
Code: |
Here is a patch for three files that needed modification when
building pymedia from source on a Mandrake 10.1 Linux system,
using gcc version 3.4.1. All three files are in the directory
video/libavcodec/i386. The same problem occurred with pymedia
versions 1.2.2.1 and 1.2.3.0-pre2 from Sourceforge.
Without these changes, the files would compile, but the vcodec.so
library would cause undefined symbol errors when Python tried
to dynamically link it (during "import pymedia").
The change is to insert ",used" into the definitions of these five
long integer constants. I found a similar patch on a mailing list
for libavcodec, and just imitated it here. Apparently the problem
comes from recent changes in gcc.
|
Thanks a lot Lane ! |
|
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Wed Jan 11, 2006 8:34 pm Post subject: |
|
|
It is already in a new version of pymedia. Doesn't it work for you ? |
|
Back to top |
|
 |
guzugi2
Joined: 11 Jan 2006 Posts: 2
|
Posted: Wed Jan 11, 2006 9:24 pm Post subject: |
|
|
pycar says that it needs the 1.2.2.x version of pymedia. i will try a newer version again, but last i checked, it was not compatible. |
|
Back to top |
|
 |
|