ov_video_frame: Extract one or more specific frames from a video file

View source: R/ffmpeg_utils.R

ov_video_frameR Documentation

Extract one or more specific frames from a video file

Description

Extract one or more specific frames from a video file

Usage

ov_video_frame(
  video_file,
  t,
  n,
  format = "jpg",
  debug = FALSE,
  framerate,
  method = "auto"
)

Arguments

video_file

string: path to the video file

t

numeric: the times of the frames to extract (in seconds)

n

integer: the frame numbers of the frames to extract. Ignored if t is provided. Frame numbering is 1-based (first frame at t = 0 is frame n = 1)

format

string: "jpg" or "png"

debug

logical: if TRUE, echo the ffmpeg output to the console

framerate

numeric: the framerate of the video. If not supplied, it will be found using [av::av_video_info]

method

string: the method to use, either "ffmpeg", "av", or "auto". "ffmpeg" is faster than "av" but requires that ffmpeg is available on your system path. If method is "auto", "ffmpeg" will be used if available and "av" if not

Value

The paths to the frame image files

See Also

ov_video_frames()

Examples

video_file <- ov_example_video(1)
img <- ov_video_frame(video_file, t = 5)
img <- ov_video_frame(video_file, n = 150)

openvolley/ovideo documentation built on March 19, 2024, 9:52 p.m.