| 
					
				 | 
			
			
				@@ -28,7 +28,7 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public var videoStickers = [PQEditVisionTrackMaterialsModel]() // 合成导出时计算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public var imageStickers = [PQEditVisionTrackMaterialsModel]() // 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public var titleStickers = [PQEditSubTitleModel]() // 字幕贴纸 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     var events = [WithDrawModel]() // 行为记录,方便撤销 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public var coverImg: UIImage? // 封面图 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -40,16 +40,16 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public var index = 0 // 素材index 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public var width = 0 // 素材宽 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public var height = 0 // 素材高 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public var videoDegress : UInt = 0  // 视频拍摄角度 90,270为横屏,180,0为竖屏 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public var videoDegress: UInt = 0 // 视频拍摄角度 90,270为横屏,180,0为竖屏 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     func initOriginData(phasset: PHAsset) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         width = phasset.pixelWidth 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         height = phasset.pixelHeight 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         materialDuraion = phasset.duration 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fetchCoverImage(phasset) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         fetchAVUrlAsset(phasset) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if phasset.mediaType == .image { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             mediaType = .IMAGE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             localPath = "image" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -57,7 +57,6 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             mediaType = .VIDEO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             fetchPlayItem(phasset) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     func fetchCoverImage(_ phasset: PHAsset) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -72,6 +71,11 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             // 设置首帧/封面 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if image != nil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 self?.coverImg = image 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if self?.mediaType == .IMAGE { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if let thumImage = image?.nx_scaleToSize(size: CGSize(width: 112, height: 200)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        self?.thumbImgs.append(thumImage) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 self?.fetchCoverImgCallBack?(image!) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -89,7 +93,7 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public func fetchAVUrlAsset(_ phasset: PHAsset) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        PQPHAssetVideoParaseUtil.parasToAVAsset(phAsset: phasset) {[weak self] asset, size, _, _ in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        PQPHAssetVideoParaseUtil.parasToAVAsset(phAsset: phasset) { [weak self] asset, _, _, _ in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             guard let sself = self else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -126,12 +130,12 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             dealedDurationRanges.append(SplitRecordRange(isRecord: false, range: range, index: -1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /// 视频分解成帧 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /// - parameter frames                          : 需要取的帧数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /// - parameter firstImagesCount             : 获取首先N张连续视频帧后先返回给调用方使用作为缓冲 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /// - parameter splitCompleteClosure    : 回调 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    func splitVideoFileUrlFps(frames: Int, firstImagesCount:Int = 0, maxSize:CGSize = CGSize(width: 200, height: 200), splitCompleteClosure: @escaping ((Bool, [UIImage]) -> Void)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    func splitVideoFileUrlFps(frames: Int, firstImagesCount: Int = 0, maxSize _: CGSize = CGSize(width: 200, height: 200), splitCompleteClosure: @escaping ((Bool, [UIImage]) -> Void)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         guard let urlAsset = videoAsset, urlAsset.duration.seconds > 0 else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -144,7 +148,7 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let start = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //        let end = Int(urlAsset.duration.seconds * Float64(fps)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         let fps = Double(frames) / urlAsset.duration.seconds 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for i in start..<frames { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for i in start ..< frames { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             let timeValue = NSValue(time: CMTimeMake(value: Int64(i * 1000), timescale: Int32(fps * 1000))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             times.append(timeValue) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -170,15 +174,15 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             case AVAssetImageGenerator.Result.succeeded: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 let framImg = UIImage(cgImage: image!) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 splitImages.append(framImg) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //            BFLog(1, message: "aaa: \(requestedTime.seconds) - \(actualTime.seconds)") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //            BFLog(1, message: "aaa: \(requestedTime.seconds) - \(actualTime.seconds)") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             @unknown default: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 break 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if cocu == firstImagesCount { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 splitCompleteClosure(false, splitImages) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-             
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if cocu == timesCount { // 最后一帧时 回调赋值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 splitCompleteClosure(true, splitImages) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 BFLog(1, message: "splitVideo: complete") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -204,5 +208,4 @@ public class BFRecordItemModel: NSObject { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return cgImg == nil ? nil : UIImage(cgImage: cgImg!) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |