Contact us

tel:15797766463

mail:business@seeshiontech.com

中文
English
中文
登录/注册

{user.username}

ID: {user.id}

VE Development document

Render Template

Update time : 2019-10-16 16:07:55

Render template to video

  1. Create an instance of SXTemplate by calling its contructor, pass template package folder path and SXTemplateUsage::SXTemplateUsageRender as arguments.

  2. Pass user asset files to SXTemplate instance by calling its setReplaceableFilePaths method.

  3. Create an instance of SXTemplateRender by calling its constructor initWithTemplate, and passing your SXTemplate instance as an argument, you can also set a audio file as background audio by passing its file path as second argument.

  4. Call commit method of your SXTemaplate instance.

  5. (Optional) You can accesss assets and layers by their UI Keys.

  6. (Optional) Set the outputPath property for the SXTemplateRender instance. The output file path must be a absolute file path that ends with .mp4 extension.

  7. Set the delegate property for the SXTemplateRender instance.

  8. Call the start method of your SXTemplateRender instance to start rendering.

  9. After rendering finished, set your SXTemplateRender instance and SXTemplate instance to nil to free memory.

Example Codes

SXTemplate *sxTemplate = [[SXTemplate alloc] init:@\"Your template path\" type:SXTemplateUsageRender];
[sxTemplate setReplaceableFilePaths:@[@\"asset path\"]];
SXTemplateRender *render = [[SXTemplateRender alloc] initWithTemplate:sxTemplate audioPath:@\"audio path\"];
render.delegate = self;
[sxTemplate commit];
[render start];

Remarks