| ffm_trim | R Documentation |
Trim the input so that the output keeps one continuous part of the input. If
start is NULL, the kept section starts at the beginning of the
input. If both end and duration are NULL, the kept
section ends at the end of the input. The glossary in
vignette("tidymedia") explains media terms such as stream copy.
ffm_trim(
object,
start = NULL,
end = NULL,
duration = NULL,
units = c("tds", "pts", "frame"),
setpts = TRUE
)
object |
An FFmpeg pipeline ( |
start |
The time of the start of the kept section, given in
|
end |
The time of the first frame that is dropped, given in
|
duration |
The maximum duration of the output, given in time duration syntax. |
units |
A string that says how |
setpts |
A logical that says whether the output timestamps change to
start at zero. If |
object with added instructions to trim the duration.
https://ffmpeg.org/ffmpeg-filters.html#trim
https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax
ffm_seek(), the faster cut by seeking, which can use stream copy.
ffm_trim() is the filter that cuts on exact frames.
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_scale(),
ffm_seek(),
ffm_vstack(),
print.tidymedia_ffm()
video <- system.file("extdata", "sample.mp4", package = "tidymedia")
ffm_files(video, "output.mp4") |>
ffm_trim(start = 1, end = 5) |>
ffm_compile()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.