code: def frames_to_ms(frames, fps):
      
      if fps <= 0:
          raise ValueError("Framerate must be positive number (%f)." % fps)
  
      return int(round(frames * (1000 / fps)))
docs: Convert frame-based duration to milliseconds.
      
      Arguments:
          frames: Number of frames (should be int).
          fps: Framerate (must be a positive number, eg. 23.976).
      
      Returns:
          Number of milliseconds (rounded to int).
          
      Raises:
          ValueError: fps was negative or zero.