Pymedia on debian lenny

Pymedia is a Python module for wav, mp3, ogg, avi, divx, dvd, cdda etc files manipulations.
It allows you to parse, demutiplex, multiplex, decode and encode all supported formats.
It can be compiled for Windows, Linux and cygwin.
we will focus on how to install pymedia 1.3.7.3 on a debian lenny

First install all the dependencies:
$ wget http://debian-multimedia.org/pool/main/l/lame/libmp3lame0_3.98.2-0.4_i386.deb
$ wget http://debian-multimedia.org/pool/main/l/lame/libmp3lame-dev_3.98.2-0.4_i386.deb
$ sudo apt-get install python-dev libogg-dev libvorbis-dev libfaad-dev libasound2-dev python-pygame
$ sudo dpkg -i libmp3lame0_3.98.2-0.4_i386.deb libmp3lame-dev_3.98.2-0.4_i386.deb

Extract a download of pymedia-1.3.7.3.tar.gz and open a terminal in the extracted folder,
Edit the audio/acodec/acodec.c file and on line 31 insert the following :

#define HAVE_LRINTF

So you should have:

#include <libavcodec/avcodec.h>
#define HAVE_LRINTF
#include “libavcodec/dsputil.h”
#include “version.h”

So we can build pymedia:
$ python setup.py build

This should display:
Using UNIX configuration…
OGG : found
VORBIS : found
FAAD : found
MP3LAME : found
VORBISENC : found
ALSA : found
Continue building pymedia ? [Y,n]:
If everything is found press Y

Finally install pymedia:

$ sudo python setup.py install

Advertisements