OSDN Git Service

fix audio error.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 8 Oct 2010 15:12:48 +0000 (15:12 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 8 Oct 2010 15:12:48 +0000 (15:12 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@681 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/tv2audio.py
rec10/trunk/src/tv2mp4.py

index 32743e1..a68fb53 100644 (file)
@@ -57,10 +57,15 @@ def ts2single_audio(pts):
                 aout=pts.replace(".ts",".aac")
                 ain=pts.replace(".ts",".wav")
                 tv2audio.wav2aac_nero(ain,aout)
+                if os.path.exists(aout):
+                    aout=pts.replace(".ts",".mp3")
+                    ain=pts.replace(".ts",".wav")
+                    tv2audio.wav2mp3_lame(ain,aout)
             else:
                 aout=pts.replace(".ts",".mp3")
                 ain=pts.replace(".ts",".wav")
                 tv2audio.wav2mp3_lame(ain,aout)
+
         else:
             logt=unicode(p0.communicate()[0], "UTF-8")
             recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
@@ -81,6 +86,7 @@ def ts2single_audio(pts):
             aout=pts.replace(".ts",".mp3")
             ain=pts.replace(".ts",".wav")
             tv2audio.wav2mp3_lame(ain,aout)
+
 def ts2singlewav(pts):
     bontsdemux = configreader.getpath('bontsdemux')
     bonpin = "Z:\\" + pts[1:]
index 72781e1..7574105 100644 (file)
@@ -135,15 +135,18 @@ def addAudio(pts,pmp4,opt):#オプションに応じた音声の追加を行う
             paac2=pts.replace(".ts","_2.mp3")\r
         e1a1=exe +u" -add \""+paac1+"\" \""+pmp4+"\""\r
         e1a2=exe +u" -add \""+paac2+"\" \""+pmp4+"\""\r
-        addmp4(paac1, pmp4, e1a1)\r
-        addmp4(paac2, pmp4, e1a2)\r
+        if os.path.exists(paac1):\r
+            addmp4(paac1, pmp4, e1a1)\r
+        if os.path.exists(paac2):\r
+            addmp4(paac2, pmp4, e1a2)\r
     else:\r
         tv2audio.ts2single_audio(pts)\r
         pinaac=pts.replace(".ts",".aac")\r
         if not os.path.exists(pinaac):\r
             pinaac=pinaac.replace(".aac",".mp3")\r
         e1a=exe +u" -add \""+pinaac+"\" \""+pmp4+"\""\r
-        addmp4(pinaac, pmp4, e1a)\r
+        if os.path.exists(pinaac):\r
+            addmp4(pinaac, pmp4, e1a)\r
 def execmp4box(pin,pout,cmd):\r
     title=os.path.splitext(os.path.split(pin)[1])[0]\r
     nt=base64.b16encode(title.encode('utf-8'))\r