rawlist = glob.glob(path + "/*.264")\r
for fn in rawlist:\r
if int(time.time()-os.path.getmtime(fn))>3000:\r
- tspath=unicode(fn.replace(".264",".ts"),'utf-8')\r
m2vpath=unicode(fn.replace(".264",".m2v"),'utf-8')\r
x264path=fn\r
- x264path=re.sub("\\\[","\[",x264path)\r
+ x264path=re.sub("\\[","[",x264path)\r
x264path=re.sub("\[","\\\[",x264path)\r
- x264path=re.sub("\\\]","\]",x264path)\r
- x264path=re.sub("\]","\\\]",x264path)\r
+ x264path=re.sub("\\]","]",x264path)\r
+ x264path=re.sub("]","\\]",x264path)\r
#x264path=x264path.replace("[^\\]\]","\\\]")\r
+ tspath=unicode(x264path.replace(".264",".ts"),'utf-8')\r
+ m2vpath=unicode(x264path.replace(".264",".m2v"),'utf-8')\r
x264path=unicode(x264path,'utf-8')\r
os.environ['LANG']="ja_JP.UTF-8"\r
- ktmp=u"ps auxww | grep \""+x264path+u"\" | egrep -v grep | egrep -v \"sh -c\" | grep x264 | awk '{print $2}'"\r
+ ktmp=[]\r
+ ktmp.append(u"ps auxww | grep \""+x264path+u"\" | egrep -v grep | egrep -v \"sh -c\" | grep x264 | awk '{print $2}'")\r
+ ktmp.append(u"ps auxww | grep \""+tspath+u"\" | egrep -v grep | egrep -v \"sh -c\" | grep mencoder | awk '{print $2}'")\r
+ ktmp.append(u"ps auxww | grep \""+m2vpath+u"\" | egrep -v grep | egrep -v \"sh -c\" | grep ffmpeg | awk '{print $2}'")\r
recdblist.printutf8(u"エンコード処理異常終了タスク終了")\r
- recdblist.printutf8(ktmp)\r
- ktmt=commands.getoutput(ktmp.encode('utf-8'))\r
+ for istr in ktmp:\r
+ recdblist.printutf8(i)\r
+ ktmt=commands.getoutput(istr.encode('utf-8'))\r
if len(ktmt)>0:\r
ktmt=ktmt[0]\r
try:\r
if int(ktmt)>0:\r
- ktmp=u"kill -9 `"+ktmp+u"`"\r
- #recdblist.printutf8(ktmp)\r
+ ktmp=u"kill -9 `"+istr+u"`"\r
recdblist.printutf8(ktmp)\r
os.system(ktmp.encode('utf-8'))\r
except:\r