3 #import sys # モジュール属性 argv を取得するため
12 mypath = str(os.path.dirname(os.path.abspath(__file__))) + "/"
13 def tv2tsmix(pout, ch, time):
15 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
16 status.setBSCSRecording(status.getBSCSRecording() + 1)
18 status.setTERecording(status.getTERecording() + 1)
19 tv2b25ts(pout + ".b25", ch, time)
20 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
21 status.setBSCSRecording(status.getBSCSRecording()-1)
23 status.setTERecording(status.getTERecording()-1)
25 b252tsmix(pout + ".b25", pout)
26 #os.remove(pout+".b25")
27 if os.access(pout, os.F_OK):
29 os.remove(pout + ".b25")
32 def tv2ts(pout, ch, csch, time):
33 ext = os.path.splitext(pout)[1]#ext=".なんたら"
34 tempt = os.path.split(pout)
36 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
37 status.setBSCSRecording(status.getBSCSRecording() + 1)
39 status.setTERecording(status.getTERecording() + 1)
40 tv2b25ts(pout + ".b25", ch, time)
41 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
42 status.setBSCSRecording(status.getBSCSRecording()-1)
44 status.setTERecording(status.getTERecording()-1)
45 b252tsmix(pout + ".b25", pout + ".tsmix")
46 tsmix2ts(pout + ".tsmix", pout, csch)
47 #os.remove(path+"/"+t+"."+temp[1])
48 if os.access(pout, os.F_OK):
50 os.remove(path + "/" + t + ext)
53 def b252ts(pout, ch, csch):
54 ext = os.path.splitext(pout)[1]#ext=".なんたら"
55 #t=hashlib.md5(pout).hexdigest()
56 tempt = os.path.split(pout)
58 b252tsmix(pout + ".b25", pout + ".tsmix")
59 tsmix2ts(pout + ".tsmix", pout, csch)
60 if os.access(pout, os.F_OK):
62 os.remove(path + "/" + t + ext)
66 def tv2b25ts(pout, ch, time):
67 exe = configreader.getpath('recpt1')
68 #print [exe,ch,time,pout]
70 doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
72 def tv2b25ts_b25(pout, ch, time):
73 exe = configreader.getpath('recpt1')
74 doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
76 def b252tsmix(pin, pout):
77 exe = configreader.getpath('b25')
78 #doexe = exe.encode('utf-8') + u' \"' + pin.encode('utf-8') + u'\" \"' + pout.encode('utf-8') + u'\"'
79 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
80 doexe = "nice -n 17 " + doexe
83 txt = commands.getoutput(doexe)
84 f=open(pin+".log",'w')
87 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
90 shutil.move(pin, pout)
92 doexe = configreader.getpath("tssplitter_lite") + " \"" + pin + "\" \"" + pout + "\" " + str(csch)
93 doexe = "nice -n 18 " + doexe
98 if os.access(pout, os.F_OK):