ignore bad cropdetect, cancel crop when detection suggests X cropping

Thu, 07 Dec 2017 16:15:40 +0100

author
mdd
date
Thu, 07 Dec 2017 16:15:40 +0100
changeset 25
078802773343
parent 24
a1bc75496992
child 26
361f76cd60ee

ignore bad cropdetect, cancel crop when detection suggests X cropping

ts2mkv.py file | annotate | diff | comparison | revisions
--- a/ts2mkv.py	Thu Nov 30 00:20:52 2017 +0100
+++ b/ts2mkv.py	Thu Dec 07 16:15:40 2017 +0100
@@ -204,6 +204,14 @@
         failcount = 0
         for line in lines:
             tmp = line[line.find(" crop="):].strip()
+            # crop=1920:804:0:138
+            if len(tmp.split(":")) != 4:
+                print "Warning, invalid cropdetect: %s" % tmp
+                return None
+            if tmp.split(":")[2] != "0":
+                print "!!! X crop detected, disabling autocrop (%s)" % tmp
+                self.info["msg_prepare"] += "WARNING: cropdetect suggested X crop, disabling autocrop\n"
+                return None
             #print "DEBUG: " + tmp
             if not option:
                 option = tmp

mercurial