|
@@ -1157,13 +1157,13 @@ extension PQStuckPointEditerController {
|
|
|
BFLog(message: "stuckPoints count is \(finallyStuckPoints.count)")
|
|
|
|
|
|
|
|
|
- var totalClipNum: Int = 0
|
|
|
+
|
|
|
for sticker in section.sectionTimeline!.visionTrack!.getEnableVisionTrackMaterials() {
|
|
|
if sticker.type == StickerType.VIDEO.rawValue {
|
|
|
let asset: AVURLAsset = AVURLAsset(url: URL(fileURLWithPath: documensDirectory + sticker.locationPath), options: nil)
|
|
|
BFLog(message: "单个视频\(sticker.locationPath)时长::\(CMTimeGetSeconds(asset.duration)) ,clipNum is:\(sticker.clipCount)")
|
|
|
var lastOutTime: Float64 = 0.0
|
|
|
- for clipindex in 0 ... sticker.clipCount {
|
|
|
+ for _ in 0 ... sticker.clipCount {
|
|
|
|
|
|
let deepCopyStickerDecoderTime: TimeInterval = Date().timeIntervalSince1970
|
|
|
|
|
@@ -1176,16 +1176,16 @@ extension PQStuckPointEditerController {
|
|
|
|
|
|
var tempSpeed: Float = 1.0
|
|
|
if model == .createStickersModelSpeed {
|
|
|
- tempSpeed = (totalClipNum + clipindex) % 2 == 0 ? maxSpeed : minSpeed
|
|
|
+ tempSpeed = (stickers.count % 2) == 0 ? maxSpeed : minSpeed
|
|
|
}
|
|
|
|
|
|
- if totalClipNum + clipindex + 1 < finallyStuckPoints.count {
|
|
|
+ if stickers.count + 1 < finallyStuckPoints.count {
|
|
|
deepCopySticker?.speedRate = tempSpeed
|
|
|
|
|
|
|
|
|
- let tempTimelineIn:Float64 = Float64(String(format: "%.6f",finallyStuckPoints[totalClipNum + clipindex])) ?? 0.0
|
|
|
+ let tempTimelineIn:Float64 = Float64(String(format: "%.6f",finallyStuckPoints[stickers.count])) ?? 0.0
|
|
|
|
|
|
- let timelineOut:Float64 = Float64(String(format: "%.6f",finallyStuckPoints[totalClipNum + 1 + clipindex])) ?? 0.0
|
|
|
+ let timelineOut:Float64 = Float64(String(format: "%.6f",finallyStuckPoints[stickers.count + 1])) ?? 0.0
|
|
|
|
|
|
|
|
|
let tempModel_In = lastOutTime
|
|
@@ -1232,17 +1232,15 @@ extension PQStuckPointEditerController {
|
|
|
stickers.append(deepCopySticker!)
|
|
|
}
|
|
|
}
|
|
|
- totalClipNum = totalClipNum + sticker.clipCount
|
|
|
} else if sticker.type == StickerType.IMAGE.rawValue {
|
|
|
- if totalClipNum + 1 >= finallyStuckPoints.count {
|
|
|
+ if stickers.count + 1 >= finallyStuckPoints.count {
|
|
|
BFLog(message: "数据出现错误!!!查正")
|
|
|
break
|
|
|
}
|
|
|
sticker.generateDefaultValues()
|
|
|
|
|
|
- sticker.timelineIn = Float64(String(format: "%.6f",finallyStuckPoints[totalClipNum])) ?? 0.0
|
|
|
- sticker.timelineOut = Float64(String(format: "%.6f",finallyStuckPoints[totalClipNum + 1])) ?? 0.0
|
|
|
- totalClipNum = totalClipNum + 1
|
|
|
+ sticker.timelineIn = Float64(String(format: "%.6f",finallyStuckPoints[stickers.count])) ?? 0.0
|
|
|
+ sticker.timelineOut = Float64(String(format: "%.6f",finallyStuckPoints[stickers.count + 1])) ?? 0.0
|
|
|
stickers.append(sticker)
|
|
|
BFLog(message: "测试人员创建 sticker crilp is in 图片 \(String(format: "%.6f", sticker.model_in)) out \(String(format: "%.6f", sticker.out)) ,分段素材时长:\(String(format: "%.6f", (sticker.out) - (sticker.model_in))) ,分段显示时长:\(String(format: "%.6f", (sticker.timelineOut) - (sticker.timelineIn))), timelineIN: \(String(format: "%.6f", sticker.timelineIn)) timelineOUT:\(String(format: "%.6f", sticker.timelineOut)) speedRate:\(sticker.speedRate)")
|
|
|
}
|