From 35563fa95c33e2ecc3b75a68a9f14315ffb66ce7 Mon Sep 17 00:00:00 2001 From: billycub Date: Mon, 25 Feb 2008 02:41:30 +0000 Subject: [PATCH] add raw copy and make full mpeg4 a little better. mpeg4 still has audio/video sync issues. drat! git-svn-id: https://tivo4tiny.svn.sourceforge.net/svnroot/tivo4tiny/trunk@6 c644a8e9-8a45-0410-89dd-c1efe9da1145 --- tivo4tiny | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/tivo4tiny b/tivo4tiny index 8d3206f..13ea7aa 100755 --- a/tivo4tiny +++ b/tivo4tiny @@ -39,9 +39,10 @@ import tempfile # BB Curve screen is portrait, so scale 240:-10. Others are landscape, so scale -10:240. # BB Curve can only handle 15fps well. Others can attempt 30fps, so just use native fps. CONVERSIONS = [ - ["iPod/iPhone/BB Curve" , ".avi", "-vf pp=md,scale=-10:240 -ovc lavc -oac lavc -lavcopts vcodec=mp3g4:vbitrate=230:acodec=mp3:abitrate=128"], - ["BlackBerry Pearl" , ".avi", "-vf pp=md,scale=240:-10 -ofps 15 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:vbitrate=230:acodec=mp3:abitrate=64"], - ["Full MPEG4" , ".avi", "-ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=mp3:abitrate=192"] + ["iPod/iPhone/BB Curve" , ".avi", "-vf pp=md,scale=-10:240 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:vbitrate=230:acodec=mp3:abitrate=128"], + ["BlackBerry Pearl" , ".avi", "-vf pp=md,scale=240:-10 -ofps 15 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:vbitrate=230:acodec=mp3:abitrate=128"], + ["Full-size MPEG-4" , ".avi", "-vf scale=0:0 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=mp3:abitrate=192"], + ["Raw Copy (MPEG-2)" , ".mpg", "xxx"] ] # Tree model columns @@ -308,8 +309,14 @@ class TivoSucker: deviceformat = self.ComboFormat.get_model()[item][1] deviceoptions = self.ComboFormat.get_model()[item][2] - cmd = "nice -n 10 mencoder "+filedecoded.name+" -o \"" + filefinal + deviceformat + "\" -of avi " + deviceoptions - print cmd + # If we're just doing a raw copy, this part is easy: + if (devicename[:8] == "Raw Copy"): + cmd = "mv "+filedecoded.name + " \"" + filefinal + deviceformat + "\"" + + # But anything other than a raw copy needs a call to mencoder: + else: + cmd = "nice -n 10 mencoder "+filedecoded.name+" -o \"" + filefinal + deviceformat + "\" -of avi " + deviceoptions + print cmd cmdin, cmdout = os.popen4(cmd) @@ -318,7 +325,7 @@ class TivoSucker: k = cmdout.readline() if (k[:4]=="Pos:"): pr = k[k.find("("):k.find("%")] -# print pr +# print pr msg = "Transcoding " + pr + "%)" gtk.gdk.threads_enter() @@ -336,7 +343,10 @@ class TivoSucker: self.labelStatus.set_markup("Completed "+title+".") gtk.gdk.threads_leave() - filedecoded.close() + # Can't close the temp file if we already moved it ;-) + if (devicename[:8] != "Raw Copy"): + filedecoded.close() + self.ConverterLock.release() @@ -353,8 +363,8 @@ class TivoSucker: # Run avahi-browse cmd = 'avahi-browse -l -r -t _tivo-videos._tcp' - cmdin, cmdout = os.popen4(cmd) -# cmdout = open("/home/billy/dev/tivo4tiny/avahi.txt") +## cmdin, cmdout = os.popen4(cmd) + cmdout = open("/home/billy/dev/tivo4tiny/avahi.txt") k = "line" foundativo = "" -- 2.11.4.GIT