code: def sample_video(
      input_path,
      output_patt,
      frames=None,
      fps=None,
      max_fps=None,
      size=None,
      min_size=None,
      max_size=None,
      original_frame_numbers=True,
      verbose=False,
      **kwargs,
  ):
      """Samples the video into a directory of per-frame images according to the
      provided parameters using ``ffmpeg``.
  
      Args:
          input_path: the path to the input video
          output_patt: a pattern like ``/path/to/images/%%06d.jpg`` specifying
              the filename/format to write the sampled frames
          frames (None): an iterable of frame numbers to sample. If provided,
              ``fps`` and ``max_fps`` are ignored
          fps (None): an optional frame rate at which to sample the frames
          max_fps (None): an optional maximum frame rate. Videos with frame rate
              exceeding this value are downsampled
          size (None): an optional ``(width, height)`` for each frame. One
              dimension can be -1, in which case the aspect ratio is preserved
          min_size (None): an optional minimum ``(width, height)`` for each
              frame. A dimension can be -1 if no constraint should be applied.
              The frames are resized (aspect-preserving) if necessary to meet
              this constraint
          max_size (None): an optional maximum ``(width, height)`` for each
              frame. A dimension can be -1 if no constraint should be applied.
              The frames are resized (aspect-preserving) if necessary to meet
              this constraint
          original_frame_numbers (True): whether to use the original frame
              numbers when writing the output frames (True) or to instead reindex
              the frames as 1, 2, ... (False)
          verbose (False): whether to log the ``ffmpeg`` command that is executed
          **kwargs: keyword arguments for ``eta.core.video.FFmpeg(**kwargs)``
      """
      _transform_video(
          input_path,
          output_patt,
          frames=frames,
          fps=fps,
          max_fps=max_fps,
          size=size,
          min_size=min_size,
          max_size=max_size,
          sample_frames=True,
          original_frame_numbers=original_frame_numbers,
          force_reencode=True,
          verbose=verbose,
          **kwargs,
      )
  
imports: import itertools
  import json
  import logging
  import os
  import eta.core.frameutils
  import eta.core.image
  import eta.core.numutils
  import eta.core.utils
  import eta.core.video
  import fiftyone
  import fiftyone.core.metadata
  import fiftyone.core.storage
  import fiftyone.core.utils
  import fiftyone.core.validation
label_desc: Use image node_id 7 for calling a global function with example usage: sample_video(input_path, output_patt, frames, fps, max_fps, size, min_size, max_size, original_frame_numbers, verbose) without return types