Dynamic (Alternate) Text Overlay

kususe kususe at interfree.it
Fri Feb 24 11:40:19 PST 2012


I coded a function to perform dynamic text overlay, displaying lines from a
file.

def show_line(self):
		next_line = self.curr_line + 1
		self.line = self.lines[self.curr_line]
		y = self.line.split(' ')
		z = self.lines[next_line].split(' ')
		d1 = datetime.datetime.fromtimestamp(float(y[0]))
		d2 = datetime.datetime.fromtimestamp(float(z[0]))
		d3 = d2-d1	
		d3s = str(d3)
		sleep_time = int(float(d3s[6::]))*1000
		self.player.get_by_name("textoverlay").set_property("text", self.line)
		glib.timeout_add(sleep_time, self.show_line)
		self.curr_line += 1
		return False

where "line" is an array which contains the lines of the file (I used
readlines() ). 
In each of these lines, there is the timestamp, used to display the strings
on screen in according with the difference between two of them (d3). 
This function is called by another one. 

The problem is that is displayed the 1st line, 3rd one, 5th one and so on
and not respecting the timestamp


--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Dynamic-Alternate-Text-Overlay-tp4418428p4418428.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list