De-identify many files, using one jobs table. This is the batch form of
strip_metadata(), for when you have more than one file to scrub. Each row
is one input, and the only required column names its source. The function
is a thin wrapper over ffm_batch. It builds one reproducible
stream-copy strip command for each input. Each command uses the same steps
as strip_metadata(), so it is bit-exact and drops the same metadata.
The glossary in vignette("tidymedia") explains media terms such as
stream and stream copy.
Arguments
- jobs
A data frame with one row per input. It needs at least an
inputcolumn, the source path. An optionaloutputcolumn names the destination. Without it, each row's output name adds_strippedto the input's base name and keeps its extension. For example,clip.mkvbecomesclip_stripped.mkv. Any two rows with the same output path are rejected, so one file cannot silently overwrite another. That happens with a duplicatedinputand nooutputcolumn, or with a repeated explicitoutput. Any other columns are ignored, because the scrub has no per-row settings.- run
A logical: run each input's command through FFmpeg (
TRUE, default) or only compile them for inspection (FALSE).- parallel
A logical passed to
ffm_batch: scrub in parallel with furrr (TRUE) or sequentially (FALSE, default). Parallelism follows the activefutureplan;TRUEunder the default sequential plan runs one input at a time and warns. Set a plan first, e.g.future::plan(future::multisession).- ...
Additional arguments forwarded to
ffm_batch, such asverify,manifest,checksums, andprogress.
Value
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.
See also
strip_metadata() for the single-input form; ffm_batch() for the
batch runner and the arguments forwarded through ...;
standardize_video_batch() and anonymize_video_batch() for the other
batch task functions.
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(),
segment_video_batch(),
separate_audio_video(),
separate_audio_video_batch(),
standardize_video(),
standardize_video_batch(),
strip_metadata()
Examples
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
jobs <- tibble::tibble(input = video, output = "clean.mp4")
# run = FALSE compiles one command per input without calling FFmpeg
strip_metadata_batch(jobs, run = FALSE)
#> # A tibble: 1 × 3
#> input output command
#> <chr> <chr> <chr>
#> 1 /home/runner/work/_temp/Library/tidymedia/extdata/sample.mp4 clean.mp4 "-y -i…