OSDN Git Service

fix Unicode Error.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 13 Oct 2010 23:32:57 +0000 (23:32 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 13 Oct 2010 23:32:57 +0000 (23:32 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@687 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/ts2x264.py

index 9731e4e..9f0d474 100644 (file)
@@ -181,7 +181,7 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
     recdblist.printutf8(encexe)
     txt=""
     try:
-        txt=unicode(commands.getoutput(encexe.encode('utf-8')),'utf-8')
+        txt=unicode(commands.getoutput(encexe.encode('utf-8')),'utf-8','ignore')
     except:
         ""
     os.system("rm "+streampath)
@@ -271,7 +271,7 @@ def encode_ffmpeg_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
     txt=""
     recdblist.printutf8(exe)
     try:
-        txt=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8')
+        txt=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
     except:
         ""
     recdblist.addCommandLog(pin, u"FFmpeg動画エンコード", exe, txt)
@@ -280,7 +280,7 @@ def getMovieBaseSize(pin):
     ffmpeg=configreader.getpath("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
-    txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8')
+    txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")
     sizeMaxX=0
     sizeMaxY=0
@@ -302,7 +302,7 @@ def getMoviePAR(pin):
     ffmpeg=configreader.getpath("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
-    txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8')
+    txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")
     #rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")
     sizeMaxX=0
@@ -331,7 +331,7 @@ def getMovieDAR(pin):
     ffmpeg=configreader.getpath("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
-    txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8')
+    txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")
     sizeMaxX=0
     darx=0