Save Video
By default, VideoEditor SDK exports edited video in the same resolution, as it was originally loaded into the editor, as long as no cropping operation was carried out. The frame rate of the exported video is the same as the input video and cannot be modified. VideoEditorSaveSettings
holds all the settings related to exporting and saving the video. Upon export, the Uri
of the exported video can be obtained from EditorSDKResult.resultUri
.
Output mode#
VideoEditor SDK supports three OutputMode
s:
EXPORT_ALWAYS
- Default mode. The editor will always export the video. For a successful export, theEditorSDKResult.resultStatus
would beEXPORT_DONE
.EXPORT_IF_NECESSARY
- The editor will only export if there are any modifications made to the video. TheEditorSDKResult.resultStatus
would beDONE_WITHOUT_EXPORT
if an export attempt was made without any modifications to the video.EXPORT_ONLY_SETTINGS_LIST
- The editor will not export the video. This is useful if you only need the dump of theSettingsList
(viaEditorSDKResult.settingsList
) for serialization or background export. TheEditorSDKResult.resultStatus
would beDONE_WITHOUT_EXPORT
if an export attempt was made.
The output mode can be set in VideoEditorSaveSettings.outputMode
.
Export format#
VideoEditor SDK supports exporting videos in MP4 (H.264) or WEBM (VP8) format. To ensure maximum cross-platform compatibility, we recommend using MP4, which is set by default.
The export format can be set using VideoEditorSaveSettings.setVideoExportFormat()
.
Quality#
Bit rate - By default, the exported video has the same bit rate as the input video. It can be set in
VideoEditorSaveSettings.bitRate
.Bits per pixel (BPP) - Setting
VideoEditorSaveSettings.bitsPerPixel
is a better option than setting the bit rate as it takes into account the size of the video. When this is set to a non-null value,VideoEditorSaveSettings.bitRate
is ignored. The resultant bitrate is calculated by multiplying the BPP with the width, height, and frame rate of the video. A common value for good quality/size balance with H.264 is0.08f
and sensible values are from 0.04f to 0.25f while VP8 looks good on lower values as well.I-frame interval - By default, the i-frame interval is set to 2 seconds. It can be set in
VideoEditorSaveSettings.iFrameIntervalInSeconds
.