[MPlayer-users] Python bindings: pymplb

Stefan Parviainen pafcu at iki.fi
Tue Oct 5 21:32:51 CEST 2010


Hi all,

I needed to play some videos from Python using mplayer, and because I had 
problems with the existing python bindings I made my own. The code can be 
found at http://github.com/pafcu/pymplb. The main feature is that the bindings 
are generated at run time by parsing the output of "mplayer -input cmdlist" 
and "mplayer -list-properties". Data types and min/max values are also 
enforced. Using the bindings looks something like this:
import pymplb
player = pymplb.MPlayer()
player.some_method(arg1,arg2,...)
player.p_some_property = value # Note p_ prefix
At the python prompt
>> help(player)
also works.

The bindings are licensed under the ISC license while mplayer itself is under 
the GPL. As far as I can see this shouldn't be a problem, but if someone 
thinks that it is, please let me know.

Any comments and ideas for improvements are of course welcome. Python3 is 
currently not supported but will be in the near future.

-- 
Stefan Parviainen


More information about the MPlayer-users mailing list