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)):
96 exe = configreader.getpath('b25')
97 #doexe = exe.encode('utf-8') + u' \"' + pin.encode('utf-8') + u'\" \"' + pout.encode('utf-8') + u'\"'
98 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
99 doexe = "nice -n 17 " + doexe
102 logo=pin.replace(".ts.b25",".log")
103 txt = commands.getoutput(doexe)
115 txt = "\n####b25-log####\n"+stxt
119 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
121 shutil.move(pin,pout)
123 doexe = configreader.getpath("tssplitter") + " \""+ pin + "\" \""+ pout + "\" " + str(csch)
124 doexe = "nice -n 18 " + doexe
125 logo=pin.replace(".ts.tsmix",".log")
126 os.environ['LANG']="ja_JP.UTF-8"
127 txt = commands.getoutput(doexe)
129 txt = "\n####tssplit-log####\nCommand:"+doexe+"\nlog:\n"+stxt
134 if os.access(pout, os.F_OK):