Skip to contents

Generic function to extract frames from a video file or all videos in a folder.

Usage

extract(extractor, verbose = TRUE, ...)

Arguments

extractor

An object of class VideoFrameExtractor or FolderExtractor.

verbose

logical. If TRUE, progress messages are printed.

...

Additional arguments.

Value

The original extractor object (either VideoFrameExtractor or FolderExtractor) returned invisibly. The object is updated with the paths to the extracted frames or the results of the batch processing.

Examples

video_file <- system.file("extdata", "sample.mp4", package = "photoextractor")
# Check if external tools are available
if (video_file != "" && av::av_media_info(video_file)$duration > 0) {
  extractor <- VideoFrameExtractor(video_file, output_dir = tempdir())
  # extract(extractor) # This requires exiftool to be installed
}
#> Using ExifTool version 13.53