Learn R Programming

BioTrajectory (version 1.1.0)

videoToFrames: 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)

Value

A list of file paths to the generated images.

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.

Examples

Run this code
# \donttest{
# 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
# }

Run the code above in your browser using DataLab