Pyxine - Python bindings for xine


Pages: Home README  SourceForge: Project Info Downloads SVN  Links: xine freshmeat

README: Pyxine

Overview

Pyxine is a Python package which provides Python bindings for libxine, the backend of the xine media player. Using Pyxine, it is possible to write simple (or complex) user-interfaces to xine. This makes it much easier for one to write custom xine UIs.

Pyxine is very much a work-in-progress. It seems to work for me (but consider yourself lucky if you can get it to work without a hitch.) The API is subject to change without notice.

For the latest news and updates, make sure to check the Pyxine web page.

Requirements

To build and install this package, you'll need:

  • Python 2.2 or better. (2.1 might work?)
  • Modern GNU gcc/g++
  • xine-lib-1-beta4 (or better)

If you want to hack the source, you'll also probably need:

  • SWIG (I'm using version 1.1)
  • GNU make

Installation

Installation (hopefully) is as simple as:

python setup.py install

See also: Installing Python Modules.

Usage

Playing an audio file can be as simple as:

>>> import pyxine
>>> xine = pyxine.Xine()
>>> stream = xine.stream_new()
>>> stream.open("music.mp3")
>>> stream.play()

To play a movie, it will probably take a little more work in order to properly initialize the video output driver. For now, have a look at tkplayer.py and player.py in the examples subdirectory.

E.g., if you have the Tkinter package installed:

# python tkplayer.py some_movie.avi

might actually play a movie for you. (Hit p to start playback.)

FIXME: need more here

Bugs & Questions

Feel free to ask questions and make bug reports. You may e-mail me directly, or better yet, (especially if your question is one others might be interested in) post it to the pyxine-devel mailing list, <mailto:pyxine-devel@lists.sourceforge.net>.

Roadmap

Here's the beginnings of an outline to the internals of Pyxine.

pyxine.libxine

This module is a raw interface to libxine which is more-or-less automatically generated by SWIG.

You should probably not use this module directly, as the rest of the pyxine package provides a friendlier object-oriented wrapper over the the functions in this module.

pyxine.pxlib, pyxine.pxlibc

This is some support code written in C++, along with its SWIG generated wrappers. It handles some of the dirty details associated with running a xine in an X11 window.

The code in pxlib catches ShmCompletion and Exposure events and passes them on to xine. It also provides some glue for the callbacks frame_output_cb and dest_size_cb, as well as providing for the caching of return values from those callback.

FIXME: need more here

the rest

The rest of the code in the package is a higher-level, object-oriented wrapper over the interface presented by libxine.

FIXME: need more here