segment_video: Segment Video

View source: R/ffmpeg.R

segment_videoR Documentation

Segment Video

Description

Use FFmpeg to quickly break a single video file into multiple smaller video files (with the same encoding) based on pairs of start and stop timestamps. Segment video files will be named by taking the name of infile and appending a suffix of an underscore (_) and an integer indicating which segment (based on the order provided in ts_start and ts_stop).

Usage

segment_video(infile, ts_start, ts_stop, outfiles = NULL, run = TRUE, ...)

Arguments

infile

A string containing the path to a video file.

ts_start

A vector containing one or more timestamps indicating the start of each segment to create. Can be either a numeric vector indicating seconds or a character vector with time duration syntax. Must have the same length as ts_stop.

ts_stop

A vector containing one or more timestamps indicating the stop of each segment to create. Can be either a numeric vector indicating seconds or a character vector with time duration syntax. Must have the same length as ts_start.

outfiles

Either NULL or a character vector indicating the filename (with extension) for each segment to create. If NULL, will append a zero-padded integer to infile. If not NULL, must have the same length as ts_start.

run

A logical indicating whether to run the command or just create it.

...

Not currently used

References

https://ffmpeg.org/ffmpeg-utils.html#time-duration-syntax


jmgirard/tidymedia documentation built on June 15, 2024, 1:52 p.m.