|
@@ -80,11 +80,14 @@ public class BFRecordExport {
|
|
|
}
|
|
|
}
|
|
|
for srange in drangs {
|
|
|
- let range = srange.range
|
|
|
- let sticker = splitBaseMaterial(timelineIn: totalDur + subDur, model_in: range.start.seconds, duration: range.duration.seconds)
|
|
|
- sticker.volumeGain = 0
|
|
|
- itemModel.videoStickers.append(sticker)
|
|
|
- subDur += range.duration.seconds
|
|
|
+ if let localPath = itemModel.localPath {
|
|
|
+ let range = srange.range
|
|
|
+ let sticker = splitBaseMaterial(timelineIn: totalDur + subDur, model_in: range.start.seconds, duration: range.duration.seconds)
|
|
|
+ sticker.locationPath = localPath
|
|
|
+ sticker.volumeGain = 0
|
|
|
+ itemModel.videoStickers.append(sticker)
|
|
|
+ subDur += range.duration.seconds
|
|
|
+ }
|
|
|
}
|
|
|
totalDur += subDur
|
|
|
}
|
|
@@ -131,9 +134,6 @@ public class BFRecordExport {
|
|
|
bgMovieInfo.volumeGain = 1
|
|
|
bgMovieInfo.aptDuration = bgMovieInfo.timelineOut
|
|
|
bgMovieInfo.duration = bgMovieInfo.timelineOut
|
|
|
- if let localPath = data?.first?.localPath {
|
|
|
- bgMovieInfo.locationPath = localPath
|
|
|
- }
|
|
|
BFLog(1, message: "hhh- timIn:\(timelineIn), modIn:\(model_in), dur:\(duration)")
|
|
|
|
|
|
return bgMovieInfo
|
|
@@ -206,7 +206,7 @@ public class BFRecordExport {
|
|
|
var orgeBitRate = Int(outputSize.width * outputSize.height * 3)
|
|
|
|
|
|
for stick in videoStickers {
|
|
|
- if stick.type == StickerType.VIDEO.rawValue {
|
|
|
+ if stick.type == StickerType.VIDEO.rawValue, stick.locationPath.count > 0 {
|
|
|
let asset = AVURLAsset(url: URL(fileURLWithPath: stick.locationPath), options: avAssertOptions)
|
|
|
|
|
|
let cbr = asset.tracks(withMediaType: .video).first?.estimatedDataRate
|