OverlayVideo

OverlayVideo[background,o]

gives the result of overlaying o onto a background video or image background.

OverlayVideo[background,{o1,o2,}]

gives the result of overlaying o1, o2, .

Details

  • OverlayVideo is also known as picture in picture.
  • Video overlay is typically used to give a talking head together with a presentation, add logos and other graphics onto a video, or replace a background with another video.
  • The background can be a video or an image.
  • The overlays oi can be any of the following:
  • imagean Image or Graphics placed at the bottom-right corner
    videoa Video object placed at the bottom-right corner
    Placed[expr,pos]an object placed at pos
    Placed[expr,{pos,opos}]places position opos in expr at position pos
    Placed[expr,{pos,Inherited}]uses specified position pos for opos
  • The position pos in background or the position opos in overlay can be specified in the following ways:
  • {x,y}absolute pixel offset from the bottom-left corner
    Scaled[{sx,sy}]scaled position from 0 to 1 across the object
    {posx,posy}named positions Top, Bottom, Left, Right or Center
  • OverlayVideo always gives a video with the same pixel size as background.
  • The following options can be given:
  • CompressionLevelAutomaticcompression level to use
    FrameRateAutomaticthe frame rate to use
    GeneratedAssetFormatAutomaticthe format of the result
    GeneratedAssetLocation$GeneratedAssetLocationthe location of the result
    OverwriteTargetFalsewhether to overwrite an existing file
    VideoEncodingAutomaticvideo encoding to use
  • Audio and subtitle tracks of all input video objects are copied over to the resulting video.

Examples

open allclose all

Basic Examples  (3)

Overlay an image onto a video:

Specify the position of the overlay:

Overlay a video on another video:

Overlay the videos and display the result:

Scope  (7)

Basic Uses  (2)

Overlay a video on top of an Image:

Overlay two images on top of a video:

Position Specification  (5)

By default the overlay is placed at the bottom-right corner of the background:

Specify a position for the center of the overlay:

Specify a named position for the center of the overlay:

Specify which point of the overlay aligns with the specified background position:

Specify a scaled position for the center of the overlay:

Applications  (1)

Add a logo as a watermark on every frame of a video:

Wolfram Research (13), OverlayVideo, Wolfram Language function, https://reference.wolfram.com/language/ref/OverlayVideo.html.

Text

Wolfram Research (13), OverlayVideo, Wolfram Language function, https://reference.wolfram.com/language/ref/OverlayVideo.html.

CMS

Wolfram Language. 13. "OverlayVideo." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OverlayVideo.html.

APA

Wolfram Language. (13). OverlayVideo. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OverlayVideo.html

BibTeX

@misc{reference.wolfram_2021_overlayvideo, author="Wolfram Research", title="{OverlayVideo}", year="13", howpublished="\url{https://reference.wolfram.com/language/ref/OverlayVideo.html}", note=[Accessed: 24-January-2022 ]}

BibLaTeX

@online{reference.wolfram_2021_overlayvideo, organization={Wolfram Research}, title={OverlayVideo}, year={13}, url={https://reference.wolfram.com/language/ref/OverlayVideo.html}, note=[Accessed: 24-January-2022 ]}