Skip to contents

Set the pixel format of the output with FFmpeg's -pix_fmt option. For example, use "yuv420p" for broad player compatibility. The glossary in vignette("tidymedia") explains media terms such as pixel format.

Usage

ffm_pixel_format(object, format)

Arguments

object

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

format

A string that names the pixel format of the output file.

Value

object with an added instruction to set the pixel format.

Examples

video <- system.file("extdata", "sample.mp4", package = "tidymedia")
ffm_files(video, "output.mp4") |>
  ffm_pixel_format("yuv420p") |>
  ffm_compile()
#> [1] "-y -i \"/home/runner/work/_temp/Library/tidymedia/extdata/sample.mp4\" -pix_fmt yuv420p \"output.mp4\""