|
@@ -188,16 +188,17 @@ public class BFRecordExport {
|
|
|
if voiceCount > 0 || videoStickers.count > 1 {
|
|
|
let (audioMix, composition) = mergeAudio(videoStickers: videoStickers, audios: voiceList, synthesisAll: synthesisAll)
|
|
|
|
|
|
- let filter = videoStickers.map { sticker in
|
|
|
- PQMovieFilter(movieSticker: sticker)
|
|
|
+ var filters:[PQBaseFilter] = Array.init()
|
|
|
+ for sticker in videoStickers {
|
|
|
+ filters.append(PQMovieFilter(movieSticker: sticker))
|
|
|
}
|
|
|
-
|
|
|
- exporter = PQCompositionExporter(asset: composition, videoComposition: nil, audioMix: audioMix, filters: filter, animationTool: nil, exportURL: outPutMP4URL)
|
|
|
-
|
|
|
-// let asset = data?.first?.baseMaterial // 可能为空
|
|
|
-
|
|
|
- let size = UIScreen.main.bounds.size // getVideoSize(asset: asset!)
|
|
|
- var orgeBitRate = Int(size.width * size.height * 3)
|
|
|
+ let outputSize:CGSize = CGSize(width: 1080.0, height: 1080 * CGFloat(Int(UIScreen.main.bounds.size.height / UIScreen.main.bounds.size.width)))
|
|
|
+ BFLog(message: "输出视频大小:\(outputSize)")
|
|
|
+ filters.append(PQSubTitleFilter.init(st: titleStickers, inputSize: outputSize))
|
|
|
+
|
|
|
+ exporter = PQCompositionExporter(asset: composition, videoComposition: nil, audioMix: audioMix, filters: filters, animationTool: nil, exportURL: outPutMP4URL)
|
|
|
+
|
|
|
+ var orgeBitRate = Int(outputSize.width * outputSize.height * 3)
|
|
|
|
|
|
for stick in videoStickers {
|
|
|
if stick.type == StickerType.VIDEO.rawValue {
|
|
@@ -212,7 +213,7 @@ public class BFRecordExport {
|
|
|
|
|
|
BFLog(message: "导出设置的码率为:\(orgeBitRate)")
|
|
|
|
|
|
- if exporter!.prepare(videoSize: size, videoAverageBitRate: orgeBitRate) {
|
|
|
+ if exporter!.prepare(videoSize: outputSize, videoAverageBitRate: orgeBitRate) {
|
|
|
exporter!.start(playeTimeRange: CMTimeRange(start: CMTime.zero, end: synthesisAll ? CMTime(seconds: totalDuration, preferredTimescale: 100) : composition.duration))
|
|
|
}
|
|
|
exporter?.progressClosure = { [weak self] _, _, progress in
|