| convert_audio_batch | R Documentation |
Extract or re-encode the audio track of many input files, using one jobs
table. This is the batch form of convert_audio(), for when you have
more than one file. Each row is one input. The input and
output columns are required. The function is a thin wrapper over
ffm_batch. It builds one reproducible command for each input.
Each command uses the same audio steps as convert_audio(), and the
function checks each audio_codec value in the same way. The glossary
in vignette("tidymedia") explains media terms such as codec and
stream.
convert_audio_batch(
jobs,
audio_codec = NULL,
audio_stream = NULL,
run = TRUE,
parallel = FALSE,
...
)
jobs |
A data frame with one row per input. It needs at least an
|
audio_codec |
The output audio codec applied to every row, unless
|
audio_stream |
The audio track to take, as a number that counts from |
run |
A logical: run each command through FFmpeg ( |
parallel |
A logical: process the jobs in parallel with furrr
( |
... |
Additional arguments forwarded to |
When a row names no audio_stream and its input has tracks that the output will not carry, the function warns once for the whole batch. The warning names every affected row. The check costs one FFprobe call per distinct input it has to probe. A repeated input is probed once, and a row that names a track is not probed at all. The warning is given when FFprobe is available and the input can be probed. Otherwise the check is skipped silently. Those probes run one at a time, before any row starts, so parallel does not reach them. A sweep long enough to look like a hang reports its progress. The check never runs under run = FALSE, never changes any compiled command, and is skipped entirely when every row names a track. Suppress it by class with suppressWarnings(classes = "tidymedia_dropped_audio").
To switch the check off and skip the whole sweep, use options(tidymedia.check_tracks = FALSE) for the session. Use withr::local_options(tidymedia.check_tracks = FALSE) for the rest of one function.
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.
convert_audio(), the single-input form it wraps. ffm_batch(),
the batch runner. extract_audio_batch() to stream-copy audio in batch.
Other task functions:
anonymize_video(),
anonymize_video_batch(),
compare_videos(),
compare_videos_batch(),
concatenate_videos(),
concatenate_videos_batch(),
convert_audio(),
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(),
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(),
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(),
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(input = c(video, video), output = c("a.mp3", "b.mp3"))
convert_audio_batch(jobs, run = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.