# HG changeset patch # User mdd # Date 1511905781 -3600 # Node ID 3a9fd72717df1aaf27d3055860ac68d5e445e7e2 # Parent 91cf8d348c748eb90938a1ac45cf1b979db2e7e5 estimate eta on concat protocol diff -r 91cf8d348c74 -r 3a9fd72717df ts2mkv.py --- a/ts2mkv.py Tue Nov 28 22:35:35 2017 +0100 +++ b/ts2mkv.py Tue Nov 28 22:49:41 2017 +0100 @@ -353,15 +353,17 @@ if len(inputs) > 1: # use ffmpeg input concat function # attention, ffmpeg concat protocol doesnt like escape sequences - fn["in"] = "\"concat:" + \ - "|".join(inputs)\ - .replace(r"\ ", " ")\ - .replace(r"\'", "'")\ - + "\"" + for tmp in range(len(inputs)): + inputs[tmp] = inputs[tmp].replace(r"\ ", " ").replace(r"\'", "'")\ + + fn["in"] = "\"concat:" + "|".join(inputs) + "\"" # no ETA calculation possible since we have only the length of first file - # TODO: we COULD estimate by multiplying with factor generated by input file sizes - print "No ETA info possible yet on split input" - self.info["frames_total"] = 0 + # we could estimate by multiplying with factor generated by input file sizes + totalbytes = 0.0 + for tmp in inputs: + totalbytes += os.path.getsize(tmp) + print "estimating total frames for ETA based on file sizes (we have multiple inputs here)" + self.info["frames_total"] *= totalbytes / os.path.getsize(inputs[0]) idx = 0 for tmp in inputs: