Skip to main content
Language

Serialization

VideoEditor SDK for iOS supports serialization and deserialization, allowing your users to save and revise their work at any time.

For the sake of this example, we create a video from a URL and present the video editor in a modal. Note, that we have to make the current class the delegate of the VideoEditViewController in order to handle export and cancellation there.

Save serialization#

In order to obtain a Data object of all edits that have been applied to the exported video, simply call serializedSettings on the videoEditViewController. You can optionally convert these settings to a JSON string or JSON dictionary. For details on the JSON structure you can download our schema.

Save video segments#

Introduced in VideoEditor SDK v11.3.0

The above serialization just stores the edit model and not the edited asset which could be either a single video or a video composition of multiple video segments. In order to be able to fully restore and continue a previous video editing session including the complete video composition state the original video size and the individual video segments need to be saved. Open Video From Multiple Videos shows how to initialize the editor with these video segments. The video size can be provided as an optional parameter when initializing a Video.

For further processing you can save the data to the local file system (compare Save Video to File System) or upload it to a remote server (compare Save Video To Remote Server) to make the editor state available on other devices as well.

The next section explains how to restore the editor state by deserializing these settings.