From 532e50be5abdeb004e375b437c924c33d0df8a66 Mon Sep 17 00:00:00 2001 From: gn64_jp Date: Thu, 6 May 2010 21:19:59 +0000 Subject: [PATCH] fix encode. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@587 4e526526-5e11-4fc0-8910-f8fd03428081 --- rec10/trunk/src/auto_move.py | 11 ++++++----- rec10/trunk/src/checker.py | 2 +- rec10/trunk/src/tester.py | 5 ++--- rec10/trunk/src/tv2audio.py | 2 +- rec10/trunk/src/tv2mp4.py | 6 ++++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/rec10/trunk/src/auto_move.py b/rec10/trunk/src/auto_move.py index be8df04..0ba7344 100644 --- a/rec10/trunk/src/auto_move.py +++ b/rec10/trunk/src/auto_move.py @@ -47,11 +47,12 @@ def search_file(temppath,recpath,ext): title = os.path.split(avif)[1] title = title.replace(ext, "") avipath = os.path.join(dir, title + ext) - dtime = time.time()-os.path.getmtime(avipath) - dtime = int(dtime) - if dtime > 300: - if veryfySize(avipath): - ret.append(title) + if os.path.exists(avipath): + dtime = time.time()-os.path.getmtime(avipath) + dtime = int(dtime) + if dtime > 300: + if veryfySize(avipath): + ret.append(title) return ret def get_move_dest_path(title,temppath,recpath,ext): dstpath=os.path.join(recpath,title+ext) diff --git a/rec10/trunk/src/checker.py b/rec10/trunk/src/checker.py index cfb6131..78086a1 100644 --- a/rec10/trunk/src/checker.py +++ b/rec10/trunk/src/checker.py @@ -17,7 +17,7 @@ def checkB25Decode(b25filepath, decodedfilepath , csch): if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)): ret = 1 else: - if (compareFilesize(b25filepath, decodedfilepath, 90) and minimizeCheck(decodedfilepath, 800)): + if (compareFilesize(b25filepath, decodedfilepath, 80) and minimizeCheck(decodedfilepath, 800)): ret = 1 else: time.sleep(30) diff --git a/rec10/trunk/src/tester.py b/rec10/trunk/src/tester.py index 3dca330..4ad6427 100644 --- a/rec10/trunk/src/tester.py +++ b/rec10/trunk/src/tester.py @@ -34,12 +34,11 @@ import rec10d #import zenhan #import auto_process import datetime -__author__ = "yukikaze" +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__": - import profile - profile.run(rec10d.main()) \ No newline at end of file + "" \ No newline at end of file diff --git a/rec10/trunk/src/tv2audio.py b/rec10/trunk/src/tv2audio.py index ee05bca..41b9d51 100644 --- a/rec10/trunk/src/tv2audio.py +++ b/rec10/trunk/src/tv2audio.py @@ -42,7 +42,7 @@ def ts2single_audio(pts): e0=ffmpeg+" -i \""+pts+"\" -y -vn -f aac -acodec copy \""+paac+"\"" p0=subprocess.Popen(e0,shell=True) time.sleep(60) - if p0.poll==-1:#実行中 + if p0.poll==None:#実行中 if os.path.getsize(paac)<1000:#1mで1kb以下の場合自動で終了 os.kill(p0.pid,signal.SIGKILL) os.remove(paac) diff --git a/rec10/trunk/src/tv2mp4.py b/rec10/trunk/src/tv2mp4.py index 96a14da..f954a1a 100644 --- a/rec10/trunk/src/tv2mp4.py +++ b/rec10/trunk/src/tv2mp4.py @@ -108,13 +108,15 @@ def addCaption(pts,pmp4):##字幕の追加を試みる。 if os.path.isfile(cap2ass): e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pts+"\" \"Z:\\"+pincap+"\"" recdblist.printutf8(e0) - p0=subprocess.Popen(e0,shell=True) + p0=subprocess.Popen(e0,shell=True,env="LANG=ja_JP.UTF-8",stdout=subprocess.PIPE) time.sleep(120) - if p0.poll==-1:#実行中 + if p0.poll==None:#実行中 if os.path.getsize(pincap)<1000:#2mで1kb以下の場合自動で終了 os.kill(p0.pid,signal.SIGKILL) else: 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+"\"" -- 2.11.0