From 4d7f1c26fcb69acdc8387679d87474a018e0f403 Mon Sep 17 00:00:00 2001 From: gn64_jp Date: Sun, 12 Feb 2012 23:32:24 +0000 Subject: [PATCH] fix mp4box IO Error. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@912 4e526526-5e11-4fc0-8910-f8fd03428081 --- rec10/trunk/src/tv2avi.py | 4 ++-- rec10/trunk/src/tv2mp4.py | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/rec10/trunk/src/tv2avi.py b/rec10/trunk/src/tv2avi.py index 9af76d2..ae5cfbc 100644 --- a/rec10/trunk/src/tv2avi.py +++ b/rec10/trunk/src/tv2avi.py @@ -61,8 +61,8 @@ def b252ts(pout, chtxt, btime, etime, opt): csch=chs['csch'] #print [ch,csch,chtxt] except: - ch=0 - csch=0 + ch="0" + csch="0" tv2ts.b252ts(pout + ".ts", ch, csch) tsout = pout aviin = pout + ".ts" diff --git a/rec10/trunk/src/tv2mp4.py b/rec10/trunk/src/tv2mp4.py index 40e7115..1facd36 100644 --- a/rec10/trunk/src/tv2mp4.py +++ b/rec10/trunk/src/tv2mp4.py @@ -20,7 +20,12 @@ import recdblist import configreader import status import tv2audio - +path = str(os.path.dirname(os.path.abspath(__file__))) + "/" +tmppath = configreader.getConfPath("tmp")+"/" +if tmppath=="/": + tmppath=path +if not os.path.exists(tmppath): + os.mkdir(tmppath) def ts2mp4(pin, pout, opt): dir=os.path.split(pout)[0] title=os.path.split(pout)[1] @@ -47,7 +52,7 @@ def raw2mp4(pin,pout,opt): duration="-fps 23.976023 " if re.search("I",opt): duration="-fps 29.970030 " - exe = configreader.getConfPath("mp4box") + exe = configreader.getConfPath("mp4box")+u" -tmp "+tmppath txt="" os.environ['LANG']="ja_JP.UTF-8" pints=pin.replace(".264",".ts") @@ -118,11 +123,11 @@ def addCaption(pts,pmp4):##字幕の追加を試みる。 recdblist.addCommandLogZip(pts, "mp4box_caption", "mp4box_caption", e0, logt) if os.path.exists(pincap): if os.path.getsize(pincap)>1000: - exe = configreader.getConfPath("mp4box") + exe = configreader.getConfPath("mp4box")+u" -tmp "+tmppath e1s=exe +u" -add \""+pincap+"\" \""+pmp4+"\"" addmp4(pincap,pmp4,e1s) def addAudio(pts,pmp4,opts):#オプションに応じた音声の追加を行う - exe = configreader.getConfPath("mp4box") + exe = configreader.getConfPath("mp4box")+u" -tmp "+tmppath if re.search("d",opts) or re.search("5",opts):#二カ国語放送/5.1ch放送の場合 paac1=pts.replace(".ts","_1.aac") paac2=pts.replace(".ts","_2.aac") -- 2.11.0