extract_frames: Extract frames from video for classification

View source: R/video_processing.R

extract_framesR Documentation

Extract frames from video for classification

Description

This function can take

Usage

extract_frames(
  files,
  out_dir = tempfile(),
  out_file = NULL,
  fps = NULL,
  frames = NULL,
  file_col = "FilePath",
  parallel = FALSE,
  workers = 1,
  checkpoint = 1000
)

Arguments

files

dataframe of videos

out_dir

directory to save frames to

out_file

file to which results will be saved

fps

frames per second, otherwise determine mathematically

frames

number of frames to sample

file_col

string value indexing which column contains file paths

parallel

Toggle for parallel processing, defaults to FALSE

workers

number of processors to use if parallel, defaults to 1

checkpoint

if not parallel, checkpoint ever n files, defaults to 1000

Value

dataframe of still frames for each video

Examples

## Not run: 
frames <- extractFrames(videos, out_dir = "C:\\Users\\usr\\Videos\\", frames = 5)

## End(Not run)

icr-ctl/animl documentation built on Feb. 16, 2025, 11:33 p.m.