| segment_video_batch | R Documentation |
Cut segments across many input files from a single jobs tibble. This is the
batch (table-driven) form of segment_video(), for when your segments
span more than one input. Each row is one segment; the four required columns
name its source, destination, and cut points. This is a thin wrapper over
ffm_batch: one reproducible compiled command per segment. The
glossary in vignette("tidymedia") explains media terms such as codec,
keyframe and stream copy.
segment_video_batch(
jobs,
reencode = TRUE,
video_codec = NULL,
audio_codec = "copy",
hardware = c("none", "nvenc", "videotoolbox"),
fallback = FALSE,
quality = NULL,
audio_stream = NULL,
run = TRUE,
parallel = FALSE,
...
)
jobs |
A data frame with one row per segment and (at least) the columns
|
reencode |
A logical passed to |
video_codec |
A string naming the output video codec, applied to every
row lacking a |
audio_codec |
A string naming the output audio codec, 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 |
audio_stream |
The audio track to carry into each output, as a number that counts from |
run |
A logical: run each segment's command through FFmpeg
( |
parallel |
A logical passed to |
... |
Additional arguments forwarded to |
The tibble returned by ffm_batch: jobs with an added command column. When output was derived, it also has the resolved output column. When run = TRUE, it has a success column, plus any columns the forwarded arguments add, such as verified.
https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax
segment_video() for the single-input, parallel-vector form.
ffm_batch() for the batch runner and the arguments forwarded through
.... has_hardware_encoder() for the hardware argument.
ffm_seek() for the cut trade-off.
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(),
sample_frames_batch(),
segment_video(),
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(),
picture_in_picture_batch(),
segment_video(),
separate_audio_video(),
separate_audio_video_batch(),
standardize_video(),
standardize_video_batch()
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
jobs <- tibble::tibble(
input = c(video, video),
output = c("a.mp4", "b.mp4"),
start = c(0, 0.5),
end = c(0.5, 1)
)
# run = FALSE compiles one command per segment without calling FFmpeg
segment_video_batch(jobs, run = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.