OSDN Git Service

fix installer
[rec10/rec10-git.git] / rec10 / trunk / src / tv2audio.py
index 6d50b8b..cc837e8 100644 (file)
@@ -2,8 +2,7 @@
 # coding: UTF-8\r
 # Rec10 TS Recording Tools\r
 # Copyright (C) 2009-2011 Yukikaze\r
-import os\r
-import re\r
+\r
 import commands\r
 import os\r
 import re\r
@@ -33,7 +32,7 @@ def wav2aac_nero(pin,pout):
             recdblist.addLog(pin, txt, u"Wav2aac_Lameログ-詳細")\r
 def wav2mp3_lame(pin,pout):\r
     os.environ['LANG']="ja_JP.UTF-8"\r
-    lame="lame"\r
+    lame=configreader.getConfPath('lame')\r
     exe=lame+" -b 128 \""+pin+"\" \""+pout+"\""\r
     try:\r
         txt=commands.getoutput(exe.encode('utf-8'))\r
@@ -44,7 +43,7 @@ def wav2mp3_lame(pin,pout):
 def ts2single_audio(pts,opts):\r
     paac=pts.replace(".ts",".aac")\r
     ffmpeg=configreader.getConfPath("ffmpeg")\r
-    e0=ffmpeg+" -i \""+pts+"\" -y -vn -f aac -acodec copy \""+paac+"\""\r
+    e0=ffmpeg+" -i \""+pts+"\" -y -vn -acodec copy \""+paac+"\""\r
     p0=subprocess.Popen(e0,shell=True)\r
     os.waitpid(p0.pid, 0)\r
     if p0.poll==None:#実行中\r
@@ -122,10 +121,8 @@ def ts2singlewav(pts,opts):
     exe = 'wine ' + bontsdemux + " -i \"" + bonpin + "\" "+delayt+" -nd -sound 0 -o \"" + bonpout + "\""\r
     #recdblist.printutf8(exe)\r
     recdblist.printutf8(exe)\r
-    p=subprocess.Popen(exe.encode('utf-8'),shell=True)\r
-    os.waitpid(p.pid, 0)\r
-    logt=unicode(p.communicate()[0], "UTF-8")\r
-    recdblist.addCommandLog(ots, u"BonTsDemux 音声取り出し", exe, logt)\r
+    txt=commands.getoutput(exe.encode('utf-8'))\r
+    recdblist.addCommandLog(pts, u"BonTsDemux 音声取り出し", exe, txt)\r
 def ts2single_mp3_ffmpeg(pts):\r
     pmp3=pts.replace(".ts",".mp3")\r
     ffmpeg=configreader.getConfPath("ffmpeg")\r
@@ -196,7 +193,7 @@ def ts2dualaudio_BonTsDemux(pin, delay,opts):
     ffpout22=ffpout2.replace(".wav",".mp3")\r
     useNero=0\r
     try:\r
-        if configreader.getConfPath("useNeroAAC")=="1" and os.path.exists(configreader.getConfPath("NeroAAC")):\r
+        if os.path.exists(configreader.getConfPath("NeroAAC")):\r
             useNero=1\r
     except:\r
         useNero=0\r
@@ -240,7 +237,7 @@ def ts2pentaaudio_BonTsDemux(pin, delay,opts):
     ffpout21=ffpout1.replace(".wav",".mp3")\r
     useNero=0\r
     try:\r
-        if configreader.getConfPath("useNeroAAC")=="1" and os.path.exists(configreader.getConfPath("NeroAAC")):\r
+        if os.path.exists(configreader.getConfPath("NeroAAC")):\r
             useNero=1\r
     except:\r
         useNero=0\r