Skip to contents

Remove one or more streams from the media file. For example, remove the video, audio, subtitles or data stream from a media file. The glossary in vignette("tidymedia") explains media terms such as stream.

Usage

ffm_drop(object, streams = c("video", "audio", "subtitles", "data"))

Arguments

object

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

streams

A character vector with one or more of these strings: "video", "audio", "subtitles" and "data".

Value

object with an added instruction to drop these streams from the output file when the pipeline runs.

Examples

video <- system.file("extdata", "sample.mp4", package = "tidymedia")
# Drop the audio stream (keep video only)
ffm_files(video, "output.mp4") |>
  ffm_drop(streams = "audio") |>
  ffm_compile()
#> [1] "-y -i \"/home/runner/work/_temp/Library/tidymedia/extdata/sample.mp4\" -an \"output.mp4\""