3 #import sys # モジュール属性 argv を取得するため
12 mypath = str(os.path.dirname(os.path.abspath(__file__))) + "/"
13 def tv2tsmix(pout, ch, time):
14 tv2b25ts(pout + ".b25", ch, time)
15 b252tsmix(pout + ".b25", pout)
16 #if os.access(pout, os.F_OK):
18 # os.remove(pout + ".b25")
21 def tv2ts(pout, ch, csch, time):
22 ext = os.path.splitext(pout)[1]#ext=".なんたら"
23 tempt = os.path.split(pout)
25 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
26 status.changeBSCSRecording(1)
28 status.changeTERecording(1)
29 tv2b25ts(pout + ".b25", ch, time)
30 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
31 status.changeBSCSRecording(-1)
33 status.changeTERecording(-1)
34 b252tsmix(pout + ".b25", pout + ".tsmix")
44 tsmix2ts(pout + ".tsmix", pout, tch)
45 if os.access(pout, os.F_OK):
47 #os.remove(path + "/" + t + ext)
51 def b252ts(pout, ch, csch):
52 ext = os.path.splitext(pout)[1]#ext=".なんたら"
53 tempt = os.path.split(pout)
55 b252tsmix(pout + ".b25", pout + ".tsmix")
65 tsmix2ts(pout + ".tsmix", pout, tch)
66 if os.access(pout, os.F_OK):
68 #os.remove(path + "/" + t + ext)
72 def tv2b25ts(pout, ch, time):
73 exe = configreader.getpath('recpt1')
74 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
75 status.changeBSCSRecording(1)
77 status.changeTERecording(1)
78 doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
80 txt="####recpt1-log####\n"
81 txt = txt + commands.getoutput(doexe)
82 logo=pout.replace(".ts.b25",".log")
86 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
87 status.changeBSCSRecording(-1)
89 status.changeTERecording(-1)
90 def tv2b25ts_b25(pout, ch, time):
91 exe = configreader.getpath('recpt1')
92 doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
94 def b252tsmix(pin, pout):
95 if not (os.path.exists(pout) and os.path.getsize(pin)==os.path.getsize(pout)):
97 if configreader.getpath('b25_remote')=="1":
99 exe = configreader.getpath('b25_enc')+" && "
101 print u"b25_remoteがオンになっていますが、b25_envが設定されていないかコメントアウトされています。"
102 exe = exe + configreader.getpath('b25')
103 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
104 doexe = "nice -n 17 " + doexe
107 logo=pin.replace(".ts.b25",".log")
108 txt = commands.getoutput(doexe)
120 txt = "\n####b25-log####\n"+stxt
124 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
126 shutil.move(pin,pout)
128 doexe = configreader.getpath("tssplitter") + " \""+ pin + "\" \""+ pout + "\" " + str(csch)
129 doexe = "nice -n 18 " + doexe
130 logo=pin.replace(".ts.tsmix",".log")
131 os.environ['LANG']="ja_JP.UTF-8"
132 txt = commands.getoutput(doexe)
134 txt = "\n####tssplit-log####\nCommand:"+doexe+"\nlog:\n"+stxt
139 if os.access(pout, os.F_OK):