From: gn64_jp Date: Thu, 6 May 2010 21:26:47 +0000 (+0000) Subject: try to fix caption system. X-Git-Url: http://git.osdn.net/view?p=rec10%2Frec10-git.git;a=commitdiff_plain;h=840a16f372617f58b653be9af4f5ec92db034b5d try to fix caption system. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@588 4e526526-5e11-4fc0-8910-f8fd03428081 --- diff --git a/rec10/trunk/src/tester.py b/rec10/trunk/src/tester.py index 4ad6427..b7cca96 100644 --- a/rec10/trunk/src/tester.py +++ b/rec10/trunk/src/tester.py @@ -38,7 +38,6 @@ import tv2mp4 path = str(os.path.dirname(os.path.abspath(__file__))) + "/" recpath = "/home/ftpusr/ftp-tmp/Recording/" ftpusr = "/home/ftpusr/ftp-tmp" -recordedpath = "/home/ftpusr/ftp5/Series-Finish/" if __name__ == "__main__": - "" \ No newline at end of file + tv2mp4.addCaption(recpath+"", recpath+"") \ No newline at end of file diff --git a/rec10/trunk/src/tv2mp4.py b/rec10/trunk/src/tv2mp4.py index f954a1a..cbbc256 100644 --- a/rec10/trunk/src/tv2mp4.py +++ b/rec10/trunk/src/tv2mp4.py @@ -106,21 +106,35 @@ def addCaption(pts,pmp4):##字幕の追加を試みる。 except: cap2ass="" if os.path.isfile(cap2ass): + print 1 e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pts+"\" \"Z:\\"+pincap+"\"" recdblist.printutf8(e0) + print 2 p0=subprocess.Popen(e0,shell=True,env="LANG=ja_JP.UTF-8",stdout=subprocess.PIPE) + print 3 time.sleep(120) + print p0.poll + print 4 if p0.poll==None:#実行中 + print "4a" if os.path.getsize(pincap)<1000:#2mで1kb以下の場合自動で終了 + print "5a" os.kill(p0.pid,signal.SIGKILL) else: + print "4b" os.waitpid(p0.pid, 0) - recdblist.addlog(pts,unicode(p0.communicate, "UTF-8"), "Caption-Log") - - if os.path.getsize(pincap)>1000: - exe = configreader.getpath("mp4box") - e1s=exe +u" -add \""+pincap+"\" \""+pout+"\"" - addmp4(pincap,pmp4,e1s) + print "5b" + logt=unicode(p0.communicate, "UTF-8") + recdblist.printutf8(logt) + recdblist.addlog(pts,logt, "Caption-Log") + print "6" + if os.path.getsize(pincap)>1000: + print "7" + exe = configreader.getpath("mp4box") + print "8" + e1s=exe +u" -add \""+pincap+"\" \""+pout+"\"" + print "9" + addmp4(pincap,pmp4,e1s) def addAudio(pts,pmp4,opt):#オプションに応じた音声の追加を行う exe = configreader.getpath("mp4box") if re.search("d",opt) or re.search("5",opt):#二カ国語放送/5.1ch放送の場合