This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CXEImageToVideo.swift | |
// VideoAPPTest | |
// | |
// Created by Wulei on 16/12/14. | |
// Copyright © 2016年 wulei. All rights reserved. | |
// | |
import Foundation | |
import AVFoundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func imageToAssetURL(url: URL) -> URL?{ | |
let pathExtention = url.pathExtension as CFString | |
let fileUIT = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtention, nil)?.takeRetainedValue() | |
if (UTTypeConformsTo(fileUIT!, kUTTypeImage)){ | |
let param = CXEEngineInitParam() | |
let movieMaker = CXEImageToVideo(videoWidth:Int(param.sequence.width), videoHeight: Int(param.sequence.height)) | |
let fileURL = movieMaker.createMovieFrom(url: url, duration: Int(CXPreparetValue.imageDuration)) | |
return fileURL | |
} | |
return url |