"Pymedia is a Python library for accessing and manipulating media files. It makes audio and video playback/creation a snap for even a newcomer to programming." There is a deb installer available for pymedia 1.3.5 but not for 1.3.7 So I decided to write this howto.
First install all the dependencies:
sudo apt-get install python-dev libogg-dev libvorbis-dev liblame-dev libfaad2-dev libasound2-dev python-pygame
(Pygame is not really necessary, but recommended.)
Extract a download of pymedia-*.tgz and open a terminal in the extracted folder, 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
Test if pymedia installed correctly by typing this at the python shell:
import pymedia
==================
Recently, I needed to use pymedia, for some audio and video encoding. The problem though, is that pymedia was nowhere to be found in the Ubuntu Hardy Heron package repository, and the only .deb installation candidate from the pymedia website was for an older version of pymedia and Python 2.4. Not wanting to run an old version and having Python 2.5 as a requirement, I needed to compile the package myself–no easy task, it turns out.
Step 1. Get pymedia
wget http://internap.dl.sourceforge.net/sourceforge/pymedia/pymedia-1.3.7.3.tar.gz
tar xzvf pymedia-1.3.7.3.tar.gz
cd pymedia-*
Step 2: Get the pymedia dependencies (as noted here).
sudo apt-get install python-dev libogg-dev libvorbis-dev liblame-dev libfaad-dev libasound2-dev python-pygame
Step 3. Get GCC 3.4 (pymedia will not compile with GCC 4.0)
sudo apt-get install gcc-3.4 g++-3.4
export CC=gcc-3.4
Step 4. Build/compile pymedia
python setup.py build
Step 5. Be a good Ubuntu user with checkinstall
Checkinstall is great because it installs the package as a .deb file.
sudo apt-get install checkinstall
sudo checkinstall python setup.py install
Note: If you want to be a bad Ubuntu user, you can run “sudo python setup.py install” instead of the checkinstall command.
Step 6. Try it out
python
>>> import pymedia
分享到:
相关推荐
pymedia模块 用于windows xp 32位操作系统下的 python开发多媒体应用。
pymedia安装程序,好东西不解释 pymedia安装程序,好东西不解释 pymedia安装程序,好东西不解释
pymedia-examples python pymedia-examples
pymedia-1.3.7.3.win32-py2.5.exe, python pymedia库 for windows
Pymedia是一个C / C ++ / Python多媒体模块,允许以mp3,ogg,avi等格式编码/解码/播放多媒体信息。 基于ffmpeg,具有附加功能和简单的Python界面。 用于用Python编写的多媒体应用程序。
pymedia-1.3.7.3.tar.gz pymedia-1.3.7.3.tar.gz pymedia-1.3.7.3.tar.gz
该工程基于Python开发,需要安装Python及工程相关包:NumPy、SciPy、Pymedia、stft使用步骤下载并解压工程,解压后路径如E:Python\voiceMusicSeparation打开Python,把工程文件夹加入到搜索路径import syssys.path....
linux下基于python2.5,wxpython2.8,pymedia,自动歌曲下载器。添加试听功能。
此模块需要PyMedia的支持。 用于播放音乐的模块。 这个模块当中所有函数都有一个参数“wait”。 如果此参数设置为False,它将分配一个新线程来播放,不影响主进程。
为基于位图序列的电影创建(MPEG、AVI 等)... 感谢非常强大的 pymedia 模块。 还包括一些预览选项。 请同时授予 FFmpeg (http://www.ffmpeg.org/) 和 MPlayer/MEncoder (http://www.mplayerhq.hu/design7/news.html)。