videoToFrames: Extract Frames from a Video and Save as Images

View source: R/videoToFrames.r

videoToFramesR Documentation

Extract Frames from a Video and Save as Images

Description

This function is a wrapper that simplifies extracting frames from a video. It processes the video file and saves the frames as PNG images in the specified directory. By default, it extracts 15 frames per second.

Usage

videoToFrames(videoPath, outputDir, fps=15)

Arguments

videoPath

Path to the video file.

outputDir

Path to the directory where the extracted images will be saved.

fps

The number of frames shown per second in the video. By default, it extracts 15 frames per second.

Value

A list of file paths to the generated images.

Examples


# Not run:
videoPath <- system.file('extdata/video.mp4', package='BioTrajectory')
outputDir <- system.file('extdata/frames/', package='BioTrajectory')
images <- videoToFrames(videoPath, outputDir, fps=15)
print(images)  # Displays the paths to the generated images


BioTrajectory documentation built on June 8, 2025, 11:54 a.m.