| sample_frames_batch | R Documentation |
Sample many videos into numbered image sequences, using one jobs table. This
is the batch form of sample_frames(). Each row is one input video,
sampled at a fixed rate into its own image sequence. The function is a thin
wrapper over ffm_batch. It builds one reproducible command for
each input. The glossary in vignette("tidymedia") explains media terms
such as frame rate.
sample_frames_batch(
jobs,
fps = NULL,
interval = NULL,
outdir = NULL,
format = "png",
run = TRUE,
parallel = FALSE,
...
)
jobs |
A data frame with one row per input. It needs at least an
|
fps, interval |
The sampling rate applied to every row, as in
|
outdir |
An optional single output directory for all rows. An
|
format |
A string giving the output image file extension, as in
|
run |
A logical: run each input's command through FFmpeg ( |
parallel |
A logical passed to |
... |
Additional arguments forwarded to |
Supply the sampling rate once as the single fps or interval
argument, which applies to every row. Or supply it per row as an fps
or interval column, which overrides the argument of the same name.
Supply exactly one of the two, fps or interval, across arguments and
columns.
The tibble returned by ffm_batch: jobs with an added command column. When outdir was derived, it also has the resolved outdir column. When run = TRUE, it has a success column, plus any columns the forwarded arguments add, such as verified.
sample_frames() for the single-video form. ffm_batch() for the
batch runner and the arguments passed on through ....
extract_frame_batch() for the batch function that takes a list of
frames.
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(),
picture_in_picture_batch(),
sample_frames(),
segment_video(),
segment_video_batch(),
separate_audio_video(),
separate_audio_video_batch(),
standardize_video(),
standardize_video_batch(),
strip_metadata(),
strip_metadata_batch()
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
jobs <- tibble::tibble(
input = c(video, video),
outdir = c(file.path(tempdir(), "a"), file.path(tempdir(), "b"))
)
# run = FALSE compiles one command per input without calling FFmpeg
sample_frames_batch(jobs, fps = 2, run = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.