frames_clip: Encode a Numbered Frame Sequence as a Video Clip

View source: R/frames.R

frames_clipR Documentation

Encode a Numbered Frame Sequence as a Video Clip

Description

Encodes dir/pattern (a C-style numbered pattern such as "frame_%04d.png") into a video at fps. The sequence's frame count sets the clip length. Encode settings match still_clip, so stills and frame sequences concatenate cleanly.

Usage

frames_clip(dir, output, fps = 30, pattern = "frame_%04d.png", start = 1L,
            size = NULL, overwrite = TRUE, dry_run = FALSE)

Arguments

dir

Directory holding the frames.

output

Path for the output video file.

fps

Frame rate the sequence was drawn at (default 30).

pattern

C-style filename pattern of the frames (default "frame_%04d.png").

start

Number of the first frame (default 1).

size

Output dimensions as c(width, height), or NULL (default) to keep the source dimensions. Scaling ignores aspect; pass a size that preserves it (see pad for letterboxing instead).

overwrite

If TRUE (default), overwrite the output file.

dry_run

If TRUE, return the FFmpeg command without executing.

Value

Invisibly returns the output path. If dry_run, returns the command string.

Examples

## Not run: 
frames_clip("scene01/", "scene01.mp4", fps = 30)

## End(Not run)


compost documentation built on Aug. 4, 2026, 5:11 p.m.