Difference between revisions of "MPlayer integration"
(general mplayer stuff) |
(bmovl example) |
||
Line 1: | Line 1: | ||
[[Category:Media Center]] | [[Category:Media Center]] | ||
Mplayer has become somewhat of a monolithic application in the linux world. Our use of mplayer will be to delegate to it the task which it does best, while retaining control over all other aspects. In particular the user interface provided by mplayer is somewhat primitive (athough extensible). It does however allow a bitmap overlay to be done in real to via a pipe. This enables another program to generate the interface and have mplayer display it. | Mplayer has become somewhat of a monolithic application in the linux world. Our use of mplayer will be to delegate to it the task which it does best, while retaining control over all other aspects. In particular the user interface provided by mplayer is somewhat primitive (athough extensible). It does however allow a bitmap overlay to be done in real to via a pipe. This enables another program to generate the interface and have mplayer display it. | ||
+ | |||
+ | =Design ideas= | ||
+ | Athough very well designed in general, [http://geexbox.org/ GeeXboX] does not do a good job at integrating with Mplayer. The menu system, while useable is not ideal. There is too much emphasis on layers of menus. It's possible to totally delegate the mplayer user interface to another program that feeds a bit map stream to mplayer. These bit maps are overlayed on the current video. | ||
+ | |||
+ | ''bmovl'' is mplayer's built in overlay engine. When invoking mplayer in slave mode you can use this command to begin to use the bitmap overlay | ||
+ | <pre> | ||
+ | bmovl=hidden:opaque:<fifo> | ||
+ | Read bitmaps from a FIFO and display them in window. | ||
+ | |||
+ | hidden: sets the default value of the 'hidden' flag (boolean) | ||
+ | opaque: flag switching between alphablended (transparent) and opaque (fast) mode | ||
+ | fifo: path/filename for the FIFO (named pipe connecting mplayer -vop bmovl to the controlling application) | ||
+ | |||
+ | FIFO commands are: | ||
+ | |||
+ | RGBA32 width height xpos ypos alpha clear | ||
+ | followed by width*height*4 bytes of raw RGBA32 data. | ||
+ | |||
+ | ABGR32 width height xpos ypos alpha clear | ||
+ | followed by width*height*4 bytes of raw ABGR32 data. | ||
+ | |||
+ | RGB24 width height xpos ypos alpha clear | ||
+ | followed by width*height*3 bytes of raw RGB32 data. | ||
+ | |||
+ | BGR24 width height xpos ypos alpha clear | ||
+ | followed by width*height*3 bytes of raw BGR32 data. <fifo> | ||
+ | </pre> | ||
+ | See the mplayer man page this information was taken from for more details. | ||
+ | |||
+ | |||
+ | There is a program called [http://rve.sourceforge.net/doc/ Realtime Video Effects] that makes it easy to feed Mplayer the correct bitmaps to display dynamic content over the top of video. | ||
+ | *http://rve.sourceforge.net/doc/ | ||
+ | |||
+ | vf_overlay is another program that does the same thing. | ||
+ | *http://urandom.ca/mebox/downloads.php | ||
+ | =Limitations= | ||
+ | Mplayer's codecs do not handle ''review'' well - that is visually seeking backwards through video. This is the fault of the MPEG format, as the compresion is not desiged to play backwards. | ||
+ | |||
+ | |||
=See also= | =See also= | ||
*http://www.mplayerhq.hu/ | *http://www.mplayerhq.hu/ |
Revision as of 09:40, 2 March 2007
Mplayer has become somewhat of a monolithic application in the linux world. Our use of mplayer will be to delegate to it the task which it does best, while retaining control over all other aspects. In particular the user interface provided by mplayer is somewhat primitive (athough extensible). It does however allow a bitmap overlay to be done in real to via a pipe. This enables another program to generate the interface and have mplayer display it.
Design ideas
Athough very well designed in general, GeeXboX does not do a good job at integrating with Mplayer. The menu system, while useable is not ideal. There is too much emphasis on layers of menus. It's possible to totally delegate the mplayer user interface to another program that feeds a bit map stream to mplayer. These bit maps are overlayed on the current video.
bmovl is mplayer's built in overlay engine. When invoking mplayer in slave mode you can use this command to begin to use the bitmap overlay
bmovl=hidden:opaque:<fifo> Read bitmaps from a FIFO and display them in window. hidden: sets the default value of the 'hidden' flag (boolean) opaque: flag switching between alphablended (transparent) and opaque (fast) mode fifo: path/filename for the FIFO (named pipe connecting mplayer -vop bmovl to the controlling application) FIFO commands are: RGBA32 width height xpos ypos alpha clear followed by width*height*4 bytes of raw RGBA32 data. ABGR32 width height xpos ypos alpha clear followed by width*height*4 bytes of raw ABGR32 data. RGB24 width height xpos ypos alpha clear followed by width*height*3 bytes of raw RGB32 data. BGR24 width height xpos ypos alpha clear followed by width*height*3 bytes of raw BGR32 data. <fifo>
See the mplayer man page this information was taken from for more details.
There is a program called Realtime Video Effects that makes it easy to feed Mplayer the correct bitmaps to display dynamic content over the top of video.
vf_overlay is another program that does the same thing.
Limitations
Mplayer's codecs do not handle review well - that is visually seeking backwards through video. This is the fault of the MPEG format, as the compresion is not desiged to play backwards.