| subclip | R Documentation |
Cut [start, start + duration] (or [start, end]) out of an audio
or video file via ffmpeg. Re-encodes by default for frame-accurate cuts; set
reencode = FALSE for a fast stream copy (cuts land on keyframes).
subclip(input, output, start = 0, duration = NULL, end = NULL, reencode = TRUE,
overwrite = TRUE, dry_run = FALSE)
input |
Path to input media. |
output |
Path for the extracted output; extension selects the format. |
start |
Start time in seconds (default 0). |
duration |
Length in seconds, or NULL to use |
end |
End time in seconds (ignored when |
reencode |
If TRUE (default), re-encode for accurate cuts; if FALSE, stream-copy (fast, keyframe-aligned). |
overwrite |
If TRUE (default), overwrite the output file. |
dry_run |
If TRUE, return the ffmpeg command without executing. |
Invisibly returns the output path. If dry_run, returns the command string.
## Not run:
subclip("audio.mp3", "chunk.mp3", start = 2.14, duration = 5.0)
subclip("clip.mp4", "head.mp4", start = 0, end = 3, reencode = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.