Skip to contents

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.

Usage

strip_metadata_batch(jobs, run = TRUE, parallel = FALSE, ...)

Arguments

jobs

A data frame with one row per input. It needs at least an input column, the source path. An optional output column names the destination. Without it, each row's output name adds _stripped to the input's base name and keeps its extension. For example, clip.mkv becomes clip_stripped.mkv. Any two rows with the same output path are rejected, so one file cannot silently overwrite another. That happens with a duplicated input and no output column, or with a repeated explicit output. 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 active future plan; TRUE under 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 as verify, manifest, checksums, and progress.

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.

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…