View Single Post
  #1  
Old 09-01-2005, 12:51 AM
Gilliard Gilliard is offline
Member
 
Join Date: Jul 2005
Location: Switzerland
Posts: 7
How to synchronize play/pause of 2 video streams in stereo

I prepare an application in which both left and right channels in stereo mode must display different avi (or mpeg) video streams.
The video must be started / stopped, of course both channels exactly on the same frame.
But, due to the fact that 2 python commands are needed to play/pause the 2 "cameras", it sometimes happens that one stops or starts before the other, in which case both streams are no more synchronized.

Is there a mean to play / pause 2 video streams exactly on the same frame ?

Here an excerpt of my code :
Code:
..............
	self.leftcam = viz.add(self.leftEyeMovie, viz.TEX_RECT)
	self.rightcam = viz.add(self.rightEyeMovie,viz.TEX_RECT)
	leftquad.texture(self.leftcam)
	rightquad.texture(self.rightcam)
.............

def play(self): 
	if self.playBoth: ## 2 commands cannot always act at the same time
		self.leftcam.play()
		self.rightcam.play()
	elif self.playLeft:
		self.leftcam.play()
	elif self.playRight:
		self.rightcam.play()

def pause(self):
	if self.playBoth:
		self.leftcam.pause()
		self.rightcam.pause()
	elif self.playLeft:
		self.leftcam.pause()
	elif self.playRight:
		self.rightcam.pause()
__________________
Bertrand Gilliard
Reply With Quote