3 #import sys # モジュール属性 argv を取得するため
12 mypath = str(os.path.dirname(os.path.abspath(__file__))) + "/"
13 def tv2tsmix(pout, ch, time):
14 #if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
15 # status.changeBSCSRecording(1)
17 # status.changeTERecording(1)
18 tv2b25ts(pout + ".b25", ch, time)
19 #if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
20 # status.changeBSCSRecording(-1)
22 # status.changeTERecording(-1)
23 b252tsmix(pout + ".b25", pout)
24 #if os.access(pout, os.F_OK):
26 # os.remove(pout + ".b25")
29 def tv2ts(pout, ch, csch, time):
30 ext = os.path.splitext(pout)[1]#ext=".なんたら"
31 tempt = os.path.split(pout)
33 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
34 status.changeBSCSRecording(1)
36 status.changeTERecording(1)
37 tv2b25ts(pout + ".b25", ch, time)
38 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
39 status.changeBSCSRecording(-1)
41 status.changeTERecording(-1)
42 b252tsmix(pout + ".b25", pout + ".tsmix")
52 tsmix2ts(pout + ".tsmix", pout, tch)
53 if os.access(pout, os.F_OK):
55 #os.remove(path + "/" + t + ext)
59 def b252ts(pout, ch, csch):
60 ext = os.path.splitext(pout)[1]#ext=".なんたら"
61 tempt = os.path.split(pout)
63 b252tsmix(pout + ".b25", pout + ".tsmix")
73 tsmix2ts(pout + ".tsmix", pout, tch)
74 if os.access(pout, os.F_OK):
76 #os.remove(path + "/" + t + ext)
80 def tv2b25ts(pout, ch, time):
81 exe = configreader.getpath('recpt1')
82 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
83 status.changeBSCSRecording(1)
85 status.changeTERecording(1)
86 doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
88 txt="####recpt1-log####\n"
89 txt = txt + commands.getoutput(doexe)
90 logo=pout.replace(".ts.b25",".log")
94 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
95 status.changeBSCSRecording(-1)
97 status.changeTERecording(-1)
98 def tv2b25ts_b25(pout, ch, time):
99 exe = configreader.getpath('recpt1')
100 doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
102 def b252tsmix(pin, pout):
103 if not (os.path.exists(pout) and os.path.getsize(pin)==os.path.getsize(pout)):
104 exe = configreader.getpath('b25')
105 #doexe = exe.encode('utf-8') + u' \"' + pin.encode('utf-8') + u'\" \"' + pout.encode('utf-8') + u'\"'
106 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
107 doexe = "nice -n 17 " + doexe
110 logo=pin.replace(".ts.b25",".log")
111 txt = commands.getoutput(doexe)
123 txt = "\n####b25-log####\n"+stxt
127 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
129 shutil.move(pin,pout)
131 doexe = configreader.getpath("tssplitter") + " \""+ pin + "\" \""+ pout + "\" " + str(csch)
132 doexe = "nice -n 18 " + doexe
133 logo=pin.replace(".ts.tsmix",".log")
134 os.environ['LANG']="ja_JP.UTF-8"
135 txt = commands.getoutput(doexe)
137 txt = "\n####tssplit-log####\nCommand:"+doexe+"\nlog:\n"+stxt
142 if os.access(pout, os.F_OK):