code: def overlay_onto_background_video(
      video_path: str,
      background_path: str,
      output_path: Optional[str] = None,
      overlay_size: Optional[float] = 0.7,
      x_factor: float = 0.0,
      y_factor: float = 0.0,
      use_background_audio: bool = False,
      metadata: Optional[List[Dict[str, Any]]] = None,
  ) -> str:
      """
      Overlays the video onto a background video, pointed to by background_path.
  
      @param video_path: the path to the video to be augmented
  
      @param background_path: the path to the background video
  
      @param output_path: the path in which the resulting video will be stored.
          If not passed in, the original video file will be overwritten
  
      @param overlay_size: size of the overlaid media with respect to the background
          video. If set to None, the original size of the overlaid media is used
  
      @param x_factor: specifies where the left side of the overlaid media should be
          placed, relative to the video width
  
      @param y_factor: specifies where the top side of the overlaid media should be
          placed, relative to the video height
  
      @param use_background_audio: if set to True and the media type is a video, the
          audio of the background video will be used instead of the src video's audio
  
      @param metadata: if set to be a list, metadata about the function execution
          including its name, the source & dest duration, fps, etc. will be appended
          to the inputted list. If set to None, no metadata will be appended or returned
  
      @returns: the path to the augmented video
      """
      func_kwargs = helpers.get_func_kwargs(
          metadata, locals(), video_path
      )
  
      overlay(
          video_path=background_path,
          overlay_path=video_path,
          output_path=output_path or video_path,
          overlay_size=overlay_size,
          x_factor=x_factor,
          y_factor=y_factor,
          use_overlay_audio=not use_background_audio,
      )
  
      if metadata is not None:
          helpers.get_metadata(
              metadata=metadata,
              function_name="overlay_onto_background_video",
              **func_kwargs,
          )
  
      return output_path or video_path
  
imports: import functools
  import math
  import os
  import shutil
  import tempfile
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  from augly import audio, image, utils
  from augly.audio import utils
  from augly.video import helpers, utils
  from augly.video.augmenters import cv2, ffmpeg
label_desc: Use image node_id 27 for calling a global function with example usage: overlay_onto_background_video(video_path, background_path, output_path, overlay_size, x_factor, y_factor, use_background_audio, metadata) and returns: unknown