Skip to content

Interface: TrimOptions ​

Options for headless (non-UI) trim operations.

Extends ​

Properties ​

PropertyTypeDescriptionInherited from
enablePreciseTrimmingbooleanWhen true, FFmpeg re-encodes the video using the platform's hardware encoder (h264_videotoolbox on iOS, h264_mediacodec on Android) for frame-accurate trimming. When false (default), uses stream copy (-c copy) which is much faster but can only cut at keyframes, so the actual start/end may drift by several seconds. Note: if the user applies any transform (flip/rotate/crop), re-encoding already happens regardless of this flag, so precise trimming comes for free in that case.BaseOptions.enablePreciseTrimming
endTimenumberEnd time of the trim range in milliseconds.-
outputExtstringOutput file extension (e.g. "mp4", "wav").BaseOptions.outputExt
removeAfterFailedToSavePhotobooleanWhether to remove the output file if saving to the photo library fails.BaseOptions.removeAfterFailedToSavePhoto
removeAfterSavedToPhotobooleanWhether to remove the output file after it has been saved to the photo library.BaseOptions.removeAfterSavedToPhoto
removeAudiobooleanWhen true, strips the audio track from the output. Default false. In the editor, playback also starts muted, and the output has no audio even if the user unmutes.BaseOptions.removeAudio
saveToPhotobooleanWhether to save the output file to the device's photo library.BaseOptions.saveToPhoto
speednumberPlayback speed multiplier applied during export. 1.0 is normal speed, 2.0 is double speed, 0.5 is half speed. Valid range: 0.25–4.0. When not 1.0, re-encoding is forced regardless of enablePreciseTrimming.BaseOptions.speed
startTimenumberStart time of the trim range in milliseconds.-
typestringMedia type: "video" or "audio".BaseOptions.type

Released under the MIT License.