      attempts = 3
      for attempt in range(attempts):
          try:
              logger.debug("attempt: %s of %s", attempt + 1, attempts)
              proc = subprocess.Popen(cmd,
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.STDOUT,
                                      shell=iswin)
              out, _ = proc.communicate(timeout=timeout)
              logger.debug("Succesfully communicated with FFMPEG")
              break
          except subprocess.CalledProcessError as err:
              out = err.output.decode(errors="ignore")
              raise RuntimeError("FFMEG call failed with {}:\n{}".format(err.returncode, out))
 
</s> remove             proc.kill()
 </s> add  </s> remove     for line in out.splitlines():
 </s> add     for line in reversed(out.splitlines()):
            out = subprocess.check_output(cmd,
                                          stderr=subprocess.STDOUT,
                                          shell=iswin,
                                          timeout=timeout)
      attempts = 3
      for attempt in range(attempts):
          try:
              logger.debug("attempt: %s of %s", attempt + 1, attempts)
            out = subprocess.check_output(cmd,
                                          stderr=subprocess.STDOUT,
                                          shell=iswin,
                                          timeout=timeout)
            out = subprocess.check_output(cmd,
                                          stderr=subprocess.STDOUT,
                                          shell=iswin,
                                          timeout=timeout)
            out = subprocess.check_output(cmd,
                                          stderr=subprocess.STDOUT,
                                          shell=iswin,
                                          timeout=timeout)
            out = subprocess.check_output(cmd,
                                          stderr=subprocess.STDOUT,
                                          shell=iswin,
                                          timeout=timeout)
            out = subprocess.check_output(cmd,
                                          stderr=subprocess.STDOUT,
                                          shell=iswin,
                                          timeout=timeout)
              logger.debug("Succesfully communicated with FFMPEG")
              break
          except subprocess.CalledProcessError as err:
              out = err.output.decode(errors="ignore")
              raise RuntimeError("FFMEG call failed with {}:\n{}".format(err.returncode, out))
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 bugfix: Get correct frame count from videos 
lib/utils.py