Skip to contents

Scale (resize) the input video's frames to a width and height in pixels, or with an FFmpeg expression.

Usage

ffm_scale(object, width, height)

Arguments

object

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

width

The width of the output video, in pixels. Give a positive real number or a string that contains an FFmpeg expression.

height

The height of the output video, in pixels. Give a positive real number or a string that contains an FFmpeg expression.

Value

object with an added instruction to resize the frames.

Examples

video <- system.file("extdata", "sample.mp4", package = "tidymedia")
ffm_files(video, "output.mp4") |>
  ffm_scale(width = 160, height = 120) |>
  ffm_compile()
#> [1] "-y -i \"/home/runner/work/_temp/Library/tidymedia/extdata/sample.mp4\" -vf \"scale=w=160:h=120\" \"output.mp4\""