Save Video
VideoEditor SDK exports edited videos in the same resolution, as they were originally loaded into the editor, as long as no cropping operation was carried out. You can immediately display the received file/data URL. The final video is not stored in the camera roll. Instead, the VideoEditorResult.video
returns the video as a data URL or the URL to the exported video in the filesystem.
Configuration#
VideoEditor SDK for React Native offers some configuration options for the export operation of the video.
filename
#
filename
#The filename for the exported video. The correct filename extension will be automatically added based on the selected export format. It can be an absolute path or file URL or a relative path. If some relative path is chosen it will be created in a temporary system directory and overwritten if the corresponding file already exists. If the value is null an new temporary file will be created for every export.
Please make sure that the provided filename is valid for the different devices and that your application has the corresponding access rights to write to the desired location. For Android, you will want to make sure to set this inside one of the directories conforming to scoped storage:
- DCIM/
- Pictures/
- Movies/
format
#
format
#The video export format determines the file format in which the video should be exported.
codec
#
codec
#The video codec to use for the exported video.
bitRate
#
bitRate
#The bit rate in bits per second to use when exporting to VideoCodec.H264
.
quality
#
quality
#The video export quality determines the compression quality in which the video should be exported when exporting to VideoCodec.HEVC
. In this configuration example, the video only has an output compression quality of 50% - although this would not take any effect since the codec is set to VideoCodec.H264
.
import {Configuration,VideoCodec,VideoFormat,} from "react-native-videoeditorsdk";const configuration: Configuration = {export: {// The name of the exported file.// This needs to be a valid URI you have write access to.filename: "YOUR_VALID_FILENAME",video: {// The video export format determines the file format in which the video should be exported.// In this configuration example, the video should be exported as a MP4.format: VideoFormat.MP4,// The video codec to use for the exported video.// In this configuration example, the video should be exported with a `.h264` codec.codec: VideoCodec.H264,// The bit rate in bits per second to use when exporting to `VideoCodec.H264`.// In this configuration example, the bit rate is set to 3840.bitRate: 3840,// The video export quality determines the compression quality in which the video// should be exported when exporting to `VideoCodec.HEVC`.// In this configuration example, the video only has an output compression quality of 50% - although this// would not take any effect since the codec is set to `VideoCodec.H264`.quality: 0.5,},},};