| compose_layout | R Documentation |
Paints each named source into its slot's pixel rect on a black canvas, in
slot order (first = bottom). fit = "fill" covers the rect
(scale-up + center-crop, for heads); fit = "fit" contains
(scale-down + centered pad, for content). Every chain is normalized
(fps, square pixels, yuv420p), non-reference chains freeze their
last frame if shorter, and the output is cut frame-exactly to the
reference source's length. The output carries no audio.
compose_layout(sources, output, layout, reference = names(sources)[1],
overwrite = TRUE, dry_run = FALSE)
sources |
Named character vector or list of video paths, keyed by
slot name; must cover every slot in |
output |
Path for the output video file. |
layout |
A cornball layout: |
reference |
Slot name whose source defines the output frame rate and length (default the first source). |
overwrite |
If TRUE (default), overwrite the output file. |
dry_run |
If TRUE, return the FFmpeg command without executing. |
Invisibly returns the output path. If dry_run, returns the command string.
## Not run:
layout <- list(schema = 1L, name = "vertical", canvas = c(1080L, 1920L),
slots = list(
narrator = list(rect = c(0L, 0L, 1080L, 960L),
fit = "fill"),
visual = list(rect = c(0L, 960L, 1080L, 960L),
fit = "fit")))
compose_layout(c(narrator = "head.mp4", visual = "slides.mp4"),
"composed.mp4", layout, reference = "visual")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.