| picture_in_picture_batch | R Documentation |
Composite an inset (overlay) video onto a main video for many outputs from a
single jobs tibble. This is the batch (table-driven) form of
picture_in_picture(), for when you have more than one to produce. Its two
inputs have distinct roles, so jobs carries fixed main and
overlay columns (not a list-column) plus an output column.
This is a thin wrapper over ffm_batch: one reproducible overlay
command per row, sharing the pipeline with picture_in_picture(). The
glossary in vignette("tidymedia") explains media terms such as codec,
encoder and stream copy.
picture_in_picture_batch(
jobs,
position = c("topright", "topleft", "bottomright", "bottomleft", "center"),
scale = 0.25,
margin = 16,
audio_input = NULL,
video_codec = NULL,
audio_codec = "copy",
hardware = c("none", "nvenc", "videotoolbox"),
fallback = FALSE,
quality = NULL,
run = TRUE,
parallel = FALSE,
...
)
jobs |
A data frame with one row per output and (at least) |
position, scale, margin |
Defaults applied to every row lacking the
corresponding column. |
audio_input |
The input file whose audio to keep, as a number that counts from |
video_codec |
A string naming the output video codec, applied to every
row lacking a |
audio_codec |
A string naming the codec for the carried audio track,
applied to every row lacking an |
hardware, fallback |
The encoder backend and its fallback behavior, applied to the whole batch. They are a property of the machine, not of a row, so neither is read as a |
quality |
A number, or |
run |
A logical: run each command through FFmpeg ( |
parallel |
A logical: process the jobs in parallel with furrr
( |
... |
Additional arguments forwarded to |
The jobs tibble with an added command column. When run = TRUE, it also has a success column, plus verified or a provenance manifest, each when requested through .... See ffm_batch.
picture_in_picture(), the one-output function it wraps;
ffm_batch(), the batch runner; has_hardware_encoder() for the
hardware argument. concatenate_videos_batch() and
compare_videos_batch(), the other batch functions that take several
inputs per row.
Other task functions:
anonymize_video(),
anonymize_video_batch(),
compare_videos(),
compare_videos_batch(),
concatenate_videos(),
concatenate_videos_batch(),
convert_audio(),
convert_audio_batch(),
crop_video(),
crop_video_batch(),
extract_audio(),
extract_audio_batch(),
extract_frame(),
extract_frame_batch(),
format_for_web(),
format_for_web_batch(),
normalize_audio(),
normalize_audio_batch(),
picture_in_picture(),
sample_frames(),
sample_frames_batch(),
segment_video(),
segment_video_batch(),
separate_audio_video(),
separate_audio_video_batch(),
standardize_video(),
standardize_video_batch(),
strip_metadata(),
strip_metadata_batch()
Other audio selection functions:
anonymize_video(),
anonymize_video_batch(),
audio_stream,
compare_videos(),
compare_videos_batch(),
convert_audio(),
convert_audio_batch(),
crop_video(),
crop_video_batch(),
extract_audio(),
extract_audio_batch(),
format_for_web(),
format_for_web_batch(),
normalize_audio(),
normalize_audio_batch(),
picture_in_picture(),
segment_video(),
segment_video_batch(),
separate_audio_video(),
separate_audio_video_batch(),
standardize_video(),
standardize_video_batch()
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
jobs <- tibble::tibble(main = video, overlay = video, output = "pip.mp4")
picture_in_picture_batch(jobs, run = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.