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)
30 tv2b25ts(pout + ".b25", ch, time)
31 except Exception, inst:
32 recdblist.Commonlogex(u"Error",u"tv2ts(tv2ts.py)", str(type(inst)),str(inst))
33 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
34 status.changeBSCSRecording(-1)
36 status.changeTERecording(-1)
37 b252tsmix(pout + ".b25", pout + ".tsmix")
47 tsmix2ts(pout + ".tsmix", pout, tch)
48 if os.access(pout, os.F_OK):
50 #os.remove(path + "/" + t + ext)
54 def b252ts(pout, ch, csch):
55 ext = os.path.splitext(pout)[1]#ext=".なんたら"
56 tempt = os.path.split(pout)
58 b252tsmix(pout + ".b25", pout + ".tsmix")
68 tsmix2ts(pout + ".tsmix", pout, tch)
69 if os.access(pout, os.F_OK):
71 #os.remove(path + "/" + t + ext)
75 def tv2b25ts(pout, ch, time):
76 exe = configreader.getpath('recpt1')
77 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
78 status.changeBSCSRecording(1)
80 status.changeTERecording(1)
82 doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
83 recdblist.printutf8(doexe)
84 recdblist.addlog(pout, doexe, u"recpt1ログ-コマンド")
85 recdblist.addlog(pout, unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8'), u"recpt1ログ-詳細")
86 except Exception, inst:
87 recdblist.Commonlogex(u"Error",u"tv2b25ts(tv2ts.py)", str(type(inst)),str(inst))
88 if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
89 status.changeBSCSRecording(-1)
91 status.changeTERecording(-1)
92 def tv2b25ts_b25(pout, ch, time):
93 exe = configreader.getpath('recpt1')
94 doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
96 def b252tsmix(pin, pout):
97 if not (os.path.exists(pout) and os.path.getsize(pin)>os.path.getsize(pout)*0.95 and os.path.getsize(pin)<os.path.getsize(pout)*1.05):
99 if configreader.getpath('b25_remote')=="1":
101 exe = configreader.getpath('b25_env')+" && "
103 inst=u"b25_remoteがオンになっていますが、b25_envが設定されていないかコメントアウトされています。"
104 recdblist.Commonlogex(u"Error",u"b252tsmix(tv2ts.py)", "",inst)
105 exe = exe + "nice -n 17 " + configreader.getpath('b25')
106 doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
107 recdblist.printutf8(doexe)
108 txt = unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8')
109 recdblist.addlog(pin, doexe, u"b25ログ-コマンド")
110 recdblist.addlog(pin, txt, u"b25ログ-詳細")
111 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
112 doexe = configreader.getpath("tssplitter") + " \""+ pin + "\" \""+ pout + "\" " + str(csch)
113 doexe = "nice -n 18 " + doexe
114 os.environ['LANG']="ja_JP.UTF-8"
115 txt = unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8')
116 recdblist.addlog(pin, doexe, u"TsSplitログ-コマンド")
117 recdblist.addlog(pin, txt, u"TsSplitログ-詳細")
119 if os.access(pout, os.F_OK) and os.path.getsize(pout)>10*1000*1000: