OSDN Git Service

change caption2ass option.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 19 Feb 2010 12:37:50 +0000 (12:37 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 19 Feb 2010 12:37:50 +0000 (12:37 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@440 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/timerec.py
rec10/trunk/src/tv2mkv.py

index e94fb3e..265cf24 100644 (file)
@@ -351,7 +351,6 @@ def type_final(typetxt,chtxt,title,bt,et,opt):
             except:
                 iff=""
             newtime=bt
-            newtime=newtime+datetime.timedelta(seconds=10)
             newtitle=newtitle+u"_"+iff+newtime.strftime("%Y-%m-%dT%H-%M-%S")
         recdb.rec_reckey(typetxting, newtitle, chtxt, btime, etime, opt)
         recdblist.printutf8(u"録画開始 "+newtitle+" "+btime+" "+etime)
index b6b00d7..bd94120 100644 (file)
@@ -24,40 +24,16 @@ def avi2mkv(pin,pout,opt):
     dir=os.path.split(pout)[0]
     title=os.path.split(pout)[1]
     title=os.path.splitext(title)[0]
-    isvfr=0
     isdualaac=0
     ispentaaudio=0
-    if re.search("v", opt):
-        isvfr=1
     if re.search("d",opt):
-        isvfr=0
         isdualaac=1
     elif re.search("5",opt):
         ispentaaudio=1
     exe = configreader.getpath("mkvmerge")
     txt=""
     os.environ['LANG']="ja_JP.UTF-8"
-    if isvfr==1:
-        wineexe=configreader.getpath("wine")
-        cap2ass=configreader.getpath("Caption2Ass")
-        pints=pin.replace(".avi",".ts")
-        pincap=pin.replace(".avi",".srt")
-        pinaac=pin.replace(".avi",".aac")
-        e0="ffmpeg -i '"+pints+"' -vn -f aac -acodec copy '"+pinaac+"'"
-        #e1=wineexe+u" "+cfr2tc+u" '"+"Z:\\"+pin+"' '"+"Z:\\"+pin120+u"' '"+"Z:\\"+pintimecode+u"' 2"
-        e2=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" \"Z:\\"+pincap+"\""
-        #e3=exe +" -o '"+pout+u"'  --forced-track 0:no -d 0 -A -S '"+pin+"' --sync 0:-100 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0"
-        #e3s=exe +" -o '"+pout+u"'  --forced-track 0:no -d 0 -A -S '"+pin+"' --sync 0:-100 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --forced-track 0:no -s 0 -D -A '"+pincap+"' --track-order 0:0,1:0,2:0"
-        e3=exe +" -o '"+pout+u"'  --forced-track 0:no -d 0 -a 1 -S '"+pin+"' --sync 0:0 --track-order 0:0,0:1"
-        e3s=exe +" -o '"+pout+u"'  --forced-track 0:no -d 0 -a 1 -S '"+pin+"' --sync 0:0 --forced-track 0:no -s 0 -D -A '"+pincap+"' --track-order 0:0,0:1,1:0"
-        txt=txt+execcomd(e0)
-        #txt=txt+execcomd(e1)
-        txt=txt+execcomd(e2)
-        if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
-            txt=txt+execcomd(e3s)
-        else:
-            txt=txt+execcomd(e3)
-    elif isdualaac==1:
+    if isdualaac==1:
         wineexe=configreader.getpath("wine")
         pincap=pin.replace(".avi",".srt")
         cap2ass=configreader.getpath("Caption2Ass")
@@ -72,7 +48,8 @@ def avi2mkv(pin,pout,opt):
         e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" \"Z:\\"+pincap+"\""
         e1=exe +" -o \""+pout+u"\"  --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --track-order 0:0,1:1,2:1"
         e1s=exe +" -o \""+pout+u"\"  --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --forced-track 0:no -s 0 -D -A \""+pincap+"\" --track-order 0:0,1:1,2:1,3:0"
-        txt=txt+execcomd(e0)
+        if os.path.isfile(cap2ass):
+            txt=txt+execcomd(e0)
         if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
             txt=txt+execcomd(e1s)
         else:
@@ -92,7 +69,8 @@ def avi2mkv(pin,pout,opt):
         e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" \"Z:\\"+pincap+"\""
         e1=exe +" -o \""+pout+u"\"  --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --track-order 0:0,1:1,2:1"
         e1s=exe +" -o \""+pout+u"\"  --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --forced-track 0:no -s 0 -D -A \""+pincap+"\" --track-order 0:0,1:1,2:1,3:0"
-        txt=txt+execcomd(e0)
+        if os.path.isfile(cap2ass):
+            txt=txt+execcomd(e0)
         if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
             txt=txt+execcomd(e1s)
         else:
@@ -107,7 +85,8 @@ def avi2mkv(pin,pout,opt):
         e1="ffmpeg -i \""+pints+"\" -vn -f aac -acodec copy \""+pinaac+"\""
         e2=exe +" -o \""+pout+u"\"  --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 0 -D -S \""+pinaac+"\" --track-order 0:0,1:0"
         e2s=exe +" -o \""+pout+u"\"  --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 0 -D -S \""+pinaac+"\" --forced-track 0:no -s 0 -D -A \""+pincap+"\" --track-order 0:0,1:0,2:0"
-        txt=txt+execcomd(e0)
+        if os.path.isfile(cap2ass):
+            txt=txt+execcomd(e0)
         txt=txt+execcomd(e1)
         if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
             txt=txt+execcomd(e2s)