              A single frame
          """
          logger.debug("Input is video. Capturing frames")
          vidname = os.path.splitext(os.path.basename(self._args.input_dir))[0]
          reader = imageio.get_reader(self._args.input_dir, "ffmpeg")
          for i, frame in enumerate(reader):
              # Convert to BGR for cv2 compatibility
              frame = frame[:, :, ::-1]
              filename = f"{vidname}_{i + 1:06d}.png"
              logger.trace("Loading video frame: '%s'", filename)  # type: ignore
              yield filename, frame
 
</s> remove             logger.trace("Loading video frame: '%s'", filename)  # type: ignore
 </s> add             logger.trace("Loading video frame: '%s'", filename)  # type:ignore[attr-defined] </s> remove         logger.trace("Loading video frame: %s", frame_no)  # type: ignore
        reader = imageio.get_reader(self._args.input_dir, "ffmpeg")
 </s> add         logger.trace("Loading video frame: %s", frame_no)  # type:ignore[attr-defined]
        reader = imageio.get_reader(self._args.input_dir, "ffmpeg")  # type:ignore[arg-type] </s> remove         frame = reader.get_next_data()[:, :, ::-1]
 </s> add         frame = reader.get_next_data()[:, :, ::-1]  # type:ignore[index] </s> remove         logger.trace("Loading image: '%s'", filename)  # type: ignore
 </s> add         logger.trace("Loading image: '%s'", filename)  # type:ignore[attr-defined] </s> remove                 logger.trace("Extracted frame_no %s from filename '%s'",  # type: ignore
                             frame_no, filename)
 </s> add                 logger.trace(  # type:ignore[attr-defined]
                    "Extracted frame_no %s from filename '%s'", frame_no, filename)
        reader = imageio.get_reader(self._args.input_dir, "ffmpeg")  # type:ignore[arg-type]
        for i, frame in enumerate(cast(Iterator[np.ndarray], reader)):
              A single frame
          """
          logger.debug("Input is video. Capturing frames")
          vidname = os.path.splitext(os.path.basename(self._args.input_dir))[0]
        reader = imageio.get_reader(self._args.input_dir, "ffmpeg")  # type:ignore[arg-type]
        for i, frame in enumerate(cast(Iterator[np.ndarray], reader)):
        reader = imageio.get_reader(self._args.input_dir, "ffmpeg")  # type:ignore[arg-type]
        for i, frame in enumerate(cast(Iterator[np.ndarray], reader)):
              # Convert to BGR for cv2 compatibility
              frame = frame[:, :, ::-1]
              filename = f"{vidname}_{i + 1:06d}.png"
              logger.trace("Loading video frame: '%s'", filename)  # type: ignore
              yield filename, frame
keep keep keep keep replace replace keep keep keep keep keep
 tests:
  - unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes 
scripts/fsmedia.py