View previous topic :: View next topic |
Author |
Message |
feesta Newbie
Joined: 04 Nov 2005 Posts: 9 Location: Pittsburgh
|
Posted: Thu Dec 08, 2005 7:10 am Post subject: Multiple monitors in pymedia? |
|
|
If I have two monitors running in X, using pymedia, can I output video to them seperately? I'm setting up kind of a video jukebox with multiple screens.
Thanks! |
|
Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Thu Dec 08, 2005 9:43 am Post subject: |
|
|
pymedia itself does not define the video where you want the data to be rendered.
Instead you can create video surfaces on a display of your choice and play video there. See player.py example in a latest pymedia.
Code: | class PlayerCallback:
# ------------------------------------
def __init__( self ):
self.overlay= None
# ------------------------------------
def removeOverlay( self ):
# Remove overlay if any
self.overlay= None
# ------------------------------------
def createOverlay( self, vfr ):
# Create overlay if any
self.overlay= pygame.Overlay( YV12, vfr.size )
# Locate overlay on the screen
res= pygame.display.get_surface().get_size()
self.overlay.set_location( (0,0)+res )
# ------------------------------------
# Process incoming audio data ( usefull for visualization or sound post processing )
# You can return audio stream as a string once you did something to it
def onAudioReady( self, afr ):
pass
# ------------------------------------
def onVideoReady( self, vfr ):
if not self.overlay:
self.createOverlay( vfr )
# Display it
try:
# Part for a new pydfb and pygame syntax
self.overlay.set_data( vfr.data )
self.overlay.display()
except:
# old pygame syntax if any
self.overlay.display( vfr.data ) |
So open player instance and pass the callback which will render to an appropriate monitor... |
|
Back to top |
|
 |
|