ffm_scale: Scale (Resize) Frames in an FFmpeg Pipeline

View source: R/ffm.R

ffm_scaleR Documentation

Scale (Resize) Frames in an FFmpeg Pipeline

Description

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.

See Also

ffm_crop() to crop instead of resize. standardize_video() is the task function built on ffm_scale().

Other pipeline functions: ffm_batch(), ffm_codec(), ffm_compile(), ffm_concat(), ffm_copy(), ffm_crop(), ffm_drawbox(), ffm_drop(), ffm_files(), ffm_fps(), ffm_hstack(), ffm_jobs(), ffm_loudnorm(), ffm_map(), ffm_output_options(), ffm_overlay(), ffm_pixel_format(), ffm_run(), ffm_seek(), ffm_trim(), ffm_vstack(), print.tidymedia_ffm()

Examples

video <- system.file("extdata", "sample.mp4", package = "tidymedia")
ffm_files(video, "output.mp4") |>
  ffm_scale(width = 160, height = 120) |>
  ffm_compile()

tidymedia documentation built on Oct. 11, 2026, 5:08 p.m.