code: def apply_cv2_augmenter(
      distractor: ac.BaseCV2Augmenter,
      video_path: str,
      output_path: Optional[str],
      **kwargs,
  ) -> None:
      video_path, output_path = helpers.validate_input_and_output_paths(
          video_path, output_path
      )
  
      with tempfile.TemporaryDirectory() as tmpdir:
          video_tmp_path = os.path.join(
              tmpdir, os.path.basename(video_path)
          )
          shutil.copyfile(video_path, video_tmp_path)
  
          fps = (
              helpers.get_video_fps(video_tmp_path)
              or utils.DEFAULT_FRAME_RATE
          )
          aug_frame_temp_dir = distractor.augment(
              video_tmp_path, fps, **kwargs
          )
  
          audio_path = None
          if helpers.has_audio_stream(video_path):
              audio_path = os.path.join(tmpdir, "audio.aac")
              helpers.extract_audio_to_file(video_path, audio_path)
  
          helpers.combine_frames_and_audio_to_file(
              os.path.join(aug_frame_temp_dir, "raw_frame*.jpg"),
              audio_path,
              video_tmp_path,
              fps,
          )
          shutil.move(video_tmp_path, output_path)
          shutil.rmtree(aug_frame_temp_dir)
  
file_path: AugLy/augly/video/utils.py
imports: import functools
  import os
  import shutil
  import tempfile
  from typing import Callable, Dict, List, Optional, Union
  from augly import utils
  from augly.video import helpers
  from augly.video.augmenters import cv2
label_desc: Use image node_id 3 for calling a global function with example usage: apply_cv2_augmenter(distractor, video_path, output_path) without return types