Subclip
FFmpeg supports extracting a portion of a media file - a subclip - by seeking to a start time and optionally stopping at an end time. In ffmpeg-studio you can do the same from your high-level classes:
VideoFile("path/to/video.mp4").subclip(start, end)
AudioFile("path/to/audio.mp3").subclip(start, end)
Under The Hood
subclip set flags internally to be used at command generation to only requested time range of the original file. It does not modify the original file; it instructs FFmpeg to seek and only use the requested portion when you run the pipeline or export.
subclip
Defines a subclip from the video file by setting the start and duration. This will not make a new copy until exported.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
float | str
|
The start time of the subclip. |
required |
duration
|
float | str
|
The duration of the subclip. |
required |
Returns:
| Type | Description |
|---|---|
VideoFile
|
The updated VideoFile object with the subclip flags set. |