Skip to contents

Compile all the instructions into one string, the FFmpeg command that runs them.

Usage

ffm_compile(object)

Arguments

object

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

Value

A string with the FFmpeg command that carries out all the instructions in the tidymedia pipeline.

Examples

video <- system.file("extdata", "sample.mp4", package = "tidymedia")
# ffm_compile() returns the reproducible FFmpeg command as a string
ffm_files(video, "output.mp4") |>
  ffm_trim(start = 1, end = 5) |>
  ffm_crop(width = 160, height = 120) |>
  ffm_codec(video = "libx264") |>
  ffm_compile()
#> [1] "-y -i \"/home/runner/work/_temp/Library/tidymedia/extdata/sample.mp4\" -vf \"trim=start=1:end=5,setpts=PTS-STARTPTS,crop=w=160:h=120:x=(in_w-out_w)/2:y=(in_h-out_h)/2\" -codec:v libx264 \"output.mp4\""