Skip to contents

Add one or more raw FFmpeg output options to the pipeline, after any added before. Output options are the flags after the input and before the output file. Use this function for an option that has no pipeline function of its own. ffm_compile() still decides where the options go and how the rest of the command is quoted. So this is not the same as writing the command string yourself.

Usage

ffm_output_options(object, ...)

Arguments

object

An FFmpeg pipeline (ffm) object created by ffm_files().

...

One or more strings. Each string is a group of options separated by white space, for example "-q:v 1" or "-frames:v 1". They are added in the order given. When the command runs, each word between white space becomes one FFmpeg argument. So an option value must not contain spaces.

Value

object with the added output options.

Examples

video <- system.file("extdata", "sample.mp4", package = "tidymedia")
# Extract a single frame by adding a raw output option
ffm_files(video, "frame.png") |>
  ffm_output_options("-frames:v 1") |>
  ffm_compile()
#> [1] "-y -i \"/home/runner/work/_temp/Library/tidymedia/extdata/sample.mp4\" -frames:v 1 \"frame.png\""