|
@@ -1293,26 +1293,19 @@ extension PQStuckPointEditerController {
|
|
|
|
|
|
// 处理最后一点视频素材不够卡点时长 e.g. 0.3 卡点时长0.5
|
|
|
if tempOut > CMTimeGetSeconds(asset.duration) {
|
|
|
- BFLog(message: "最后一点视频素材不够卡点时长要做变速C处理 差\(tempOut - CMTimeGetSeconds(asset.duration))")
|
|
|
// 最后一点素材时长
|
|
|
let lastAssetDuration = CMTimeGetSeconds(asset.duration) - lastOutTime
|
|
|
let pointDuration = timelineOut - tempTimelineIn
|
|
|
// 要适应到卡点内要使用的C速度
|
|
|
let needSpeed = lastAssetDuration / pointDuration
|
|
|
- // 当前卡点段为快速 快速都 C 速处理
|
|
|
- if tempSpeed >= 1 {
|
|
|
- if needSpeed >= 0.4 * Double(tempSpeed) {
|
|
|
- deepCopySticker?.speedRate = Float(needSpeed)
|
|
|
- }
|
|
|
- } else { // 当前卡点段为慢速
|
|
|
- if needSpeed >= 0.4 * Double(tempSpeed) && needSpeed >= 0.2 {
|
|
|
- deepCopySticker?.speedRate = Float(needSpeed)
|
|
|
- } else {
|
|
|
- continue
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ // 当前卡点段为快速 快速都用 C 速处理
|
|
|
+ BFLog(message: "最后一点视频素材不够卡点时长要做变速C处理 差\(tempOut - CMTimeGetSeconds(asset.duration)) \(needSpeed)")
|
|
|
+ deepCopySticker?.speedRate = Float(needSpeed)
|
|
|
tempOut = CMTimeGetSeconds(asset.duration)
|
|
|
+ if(needSpeed == 0){
|
|
|
+ BFLog(message: "needSpeed is 0 出现在时长和卡点正好相等")
|
|
|
+ continue
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
deepCopySticker?.model_in = tempModel_In
|
|
@@ -1481,12 +1474,6 @@ extension PQStuckPointEditerController {
|
|
|
// 快慢速 (2:快节奏,3:适中,4:慢节奏)
|
|
|
var tempMaxSpeed: Float = 1
|
|
|
var tempMinSpeed: Float = 1
|
|
|
- //速度有为0 会出现在切换模式时,目前是共用一个参数值,会清掉老值 TODO
|
|
|
-// if((maxSpeed == 0.0 && minSpeed == 0.0) && selectedDataCount != selectedImageDataCount && model == .createStickersModelSpeed){
|
|
|
-// BFLog(message: "速度参数有错误 要重新计算!!!")
|
|
|
-// dealWithDataSuccess()
|
|
|
-// return
|
|
|
-// }
|
|
|
if model == .createStickersModelSpeed {
|
|
|
// 改变速率,.只有快慢速且非只有图片素材时自动+1处理
|
|
|
if model == .createStickersModelSpeed && selectedDataCount != selectedImageDataCount {
|
|
@@ -1566,6 +1553,7 @@ extension PQStuckPointEditerController {
|
|
|
|
|
|
// 3,多补一个卡点 做 C级 速处理,要根据条件不满足 要删除最后一位,
|
|
|
if useAssestDurationTemp < assetDuration {
|
|
|
+ /*
|
|
|
// 下一个卡的的速度性质快、慢,e.g. sticker.clipCount = 5时 tempSpeed 应该是慢速。下面计算正确。
|
|
|
var tempSpeed: Float = 1.0
|
|
|
if model == .createStickersModelSpeed {
|
|
@@ -1598,6 +1586,7 @@ extension PQStuckPointEditerController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ */
|
|
|
}else {
|
|
|
//出现在第一个卡点X 倍速 > 原素材
|
|
|
finallyStuckPoints.removeLast()
|