          err = None
          loadtype = self.__class__.__name__
          if not self.folder:
              err = "ERROR: A {} folder must be specified".format(loadtype)
          elif not os.path.isdir(self.folder):
              err = ("ERROR: The {} folder {} could not be "
                     "found".format(loadtype, self.folder))
          if err:
              logger.error(err)
              exit(0)
  
 
</s> remove     def check_folder_exists(self):
        """ makes sure that the faces folder exists """
 </s> add     @property
    def count(self):
        """ Number of faces or frames """
        if self.vid_cap:
            retval = int(self.vid_cap.get(cv2.CAP_PROP_FRAME_COUNT))  # pylint: disable=no-member
        else:
            retval = len(self.file_list_sorted)
        return retval

    def check_input_folder(self):
        """ makes sure that the frames or faces folder exists
            If frames folder contains a video file return video capture object """ </s> remove             print("No " + command + " section found in file")
        return {command: opts}
 </s> add             print("No {} section found in file".format(command))
            logger.info("No  %s section found in file", command)
        retval = {command: opts}
        logger.debug(retval)
        return retval </s> remove         logger.verbose("Folder exists at '%s'", self.folder)
 </s> add         if (loadtype == "Frames" and
                os.path.isfile(self.folder) and
                os.path.splitext(self.folder)[1] in _video_extensions):
            logger.verbose("Video exists at : '%s'", self.folder)
            retval = cv2.VideoCapture(self.folder)  # pylint: disable=no-member
        else:
            logger.verbose("Folder exists at '%s'", self.folder)
            retval = None
        return retval </s> remove     def get_input_images(self):
        """ Return the list of images that are to be processed """
 </s> add     @property
    def images_found(self):
        """ Number of images or frames """
        if self.is_video:
            cap = cv2.VideoCapture(self.args.input_dir)  # pylint: disable=no-member
            retval = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))  # pylint: disable=no-member
            cap.release()
        else:
            retval = len(self.input_images)
        return retval

    def check_input_folder(self):
        """ Check whether the input is a folder or video """ </s> remove             sysbrowser = "save"
 </s> add             sysbrowser = ["save"]
        elif action == cli.DirOrFileFullPaths:
            sysbrowser = ["folder", "load"]
        elif not os.path.exists(self.folder):
            err = ("ERROR: The {} location {} could not be "
          err = None
          loadtype = self.__class__.__name__
          if not self.folder:
              err = "ERROR: A {} folder must be specified".format(loadtype)
        elif not os.path.exists(self.folder):
            err = ("ERROR: The {} location {} could not be "
        elif not os.path.exists(self.folder):
            err = ("ERROR: The {} location {} could not be "
                     "found".format(loadtype, self.folder))
          if err:
              logger.error(err)
              exit(0)
  
keep keep keep keep replace replace keep keep keep keep keep
 Add ability to extract from and convert from a video file (#559)

* Add ability to extract from and convert from a video file

* Update cli helptext. Add filebrowser button for GUI input

* Add video support to Alignments Tool 
tools/lib_alignments/media.py