code: def extract_frames_to_dir(
      video_path: str,
      output_dir: str,
      output_pattern: str = "raw_frame%08d.jpg",
      quality: int = 0,
      scale: float = 1,
  ) -> None:
      video_info = get_video_info(video_path)
  
      ffmpeg_command = [
          "-y",
          "-i",
          video_path,
          "-vf",
          f"scale=iw*{scale}:ih*{scale}",
          "-vframes",
          str(video_info["nb_frames"]),
          "-qscale:v",
          str(quality),
          "-preset",
          "ultrafast",
          os.path.join(output_dir, output_pattern),
      ]
      execute_vidgear_command(
          os.path.join(output_dir, output_pattern), ffmpeg_command
      )
  
imports: import math
  import os
  import shutil
  import tempfile
  from typing import Any, Dict, List, Optional
  import ffmpeg
  import numpy
  from augly.audio import utils
  from augly.utils import pathmgr, SILENT_AUDIO_PATH
  from augly.utils.ffmpeg import FFMPEG_PATH, FFPROBE_PATH
  from vidgear.gears import WriteGear
label_desc: Use image node_id 4 for calling a global function with example usage: extract_frames_to_dir(video_path, output_dir, output_pattern, quality, scale) without return types