Diff of /trunk/tubetutor/tubetutor.py [r6] .. [r7]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/tubetutor/tubetutor.py
+++ b/trunk/tubetutor/tubetutor.py
@@ -121,6 +121,7 @@
 			for file in files:
 				if file.endswith(".mkv") or file.endswith(".txt"):
 					self.files.append(os.path.join(root, file))
+		self.files.sort()
 
 	# Output the main window
 	def refresh_display(self):
@@ -150,7 +151,11 @@
 
 
 		# re-add all widgets
-		self.add_label("description", text="Press <Ctrl+Alt+R> to start or end recording.")
+		if keyboard_loaded:
+			self.add_label("description", text="Press <Ctrl+Alt+R> to start or end recording.")
+		else:
+			self.add_label("description", text="Hotkey <Ctrl+Alt+R> only works when started as root!!!")
+                        
 
 		# Title of the video
 		self.start_frame()
@@ -280,6 +285,12 @@
 			r = ffmpeg.renderer()
 			r.resolution(resolution)
 		else:
+			params = " -scale %s!" % resolution.replace(":", "x")
+			params += " -font %s -weight 500 -pointsize 100" % ffmpeg.font
+			params += " -draw \"gravity northwest fill white text 100,775 '%s'\"" % self.get_title()
+			params += " -scale %s!" % resolution.replace(":", "x")
+			ffmpeg.convert_image(os.path.join("media", "intro.jpg"), os.path.join(path, "tmp", "intro.jpg"), params)
+
 			r = ffmpeg.renderer()
 			r.resolution(resolution)
 			r.add_image(os.path.join("media", "intro.png"))
@@ -300,11 +311,12 @@
 		videos.append(r.lastfilename)
 
 		# outro
-		r = ffmpeg.renderer()
-		r.resolution(resolution)
-		r.filename(os.path.join("media", "outro.mkv"))
-		r.process(os.path.join(path, "tmp", "outro.mkv"), "-vf scale=" + resolution)
-		videos.append(r.lastfilename)
+		if os.path.exists(os.path.join("media", "outro.mkv")):
+		        r = ffmpeg.renderer()
+		        r.resolution(resolution)
+		        r.filename(os.path.join("media", "outro.mkv"))
+		        r.process(os.path.join(path, "tmp", "outro.mkv"), "-vf scale=" + resolution)
+		        videos.append(r.lastfilename)
 
 		# mastering
 		outputfilename=self.get_title().replace(" ", "-").replace(".", "_").replace("\n", "") + ".mkv"