去掉无用的注释代码
This commit is contained in:
parent
975a4cdfb4
commit
5f4db76679
@ -60,22 +60,6 @@ class SpatialVideoConvertor {
|
|||||||
)
|
)
|
||||||
assetReader.add(output_video)
|
assetReader.add(output_video)
|
||||||
//加载音频轨道
|
//加载音频轨道
|
||||||
// let outputSettings_Audio:[String:Any] = [
|
|
||||||
// AVFormatIDKey:kAudioFormatLinearPCM,
|
|
||||||
// AVLinearPCMIsBigEndianKey:false,
|
|
||||||
// AVLinearPCMIsFloatKey:false,
|
|
||||||
// AVLinearPCMBitDepthKey:16
|
|
||||||
// ]
|
|
||||||
// let outputSettings_Audio = [
|
|
||||||
// AVFormatIDKey: kAudioFormatLinearPCM,
|
|
||||||
// AVSampleRateKey: 44100,
|
|
||||||
// AVNumberOfChannelsKey: 2,
|
|
||||||
//// AVEncoderBitRateKey: 128000,
|
|
||||||
// AVLinearPCMIsBigEndianKey:false,
|
|
||||||
// AVLinearPCMIsFloatKey:false,
|
|
||||||
// AVLinearPCMBitDepthKey:16
|
|
||||||
// ] as [String : Any]
|
|
||||||
|
|
||||||
let outputSettings_Audio = [
|
let outputSettings_Audio = [
|
||||||
AVFormatIDKey: kAudioFormatLinearPCM, // 指定未压缩格式
|
AVFormatIDKey: kAudioFormatLinearPCM, // 指定未压缩格式
|
||||||
AVSampleRateKey: 44100,
|
AVSampleRateKey: 44100,
|
||||||
@ -94,13 +78,7 @@ class SpatialVideoConvertor {
|
|||||||
print("添加音频read output失败。。。。")
|
print("添加音频read output失败。。。。")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// let output_audio = AVAssetReaderAudioMixOutput(audioTracks: asset.tracks(withMediaType: .audio), audioSettings: nil)
|
|
||||||
// assetReader.add(output_audio)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
assetReader.startReading()
|
assetReader.startReading()
|
||||||
|
|
||||||
let duration = try await asset.load(.duration)
|
let duration = try await asset.load(.duration)
|
||||||
@ -161,7 +139,6 @@ class SpatialVideoConvertor {
|
|||||||
let time = CMSampleBufferGetOutputPresentationTimeStamp(nextSampleBuffer)
|
let time = CMSampleBufferGetOutputPresentationTimeStamp(nextSampleBuffer)
|
||||||
|
|
||||||
if vw == nil {
|
if vw == nil {
|
||||||
// vw = VideoWriter(url: outputFile, width: Int(cwidth), height: Int(cheight), orientation: orientation, sessionStartTime: CMTime(value: 1, timescale: 30 ), isRealTime: true, queue: .main)
|
|
||||||
vw = VideoWriter(url: outputFile, width: Int(cwidth), height: Int(cheight), orientation: orientation, sessionStartTime: CMTimeMake(value: 0, timescale: 1), isRealTime: true, queue: .main)
|
vw = VideoWriter(url: outputFile, width: Int(cwidth), height: Int(cheight), orientation: orientation, sessionStartTime: CMTimeMake(value: 0, timescale: 1), isRealTime: true, queue: .main)
|
||||||
}
|
}
|
||||||
_ = vw!.add(image: newpb!, presentationTime: time)
|
_ = vw!.add(image: newpb!, presentationTime: time)
|
||||||
@ -251,19 +228,6 @@ class SpatialVideoConvertor {
|
|||||||
right.draw(in: CGRect(x:imgWidth/2, y:0, width:imgWidth/2, height:imgHeight))
|
right.draw(in: CGRect(x:imgWidth/2, y:0, width:imgWidth/2, height:imgHeight))
|
||||||
let image = UIGraphicsGetImageFromCurrentImageContext()!
|
let image = UIGraphicsGetImageFromCurrentImageContext()!
|
||||||
UIGraphicsEndImageContext();
|
UIGraphicsEndImageContext();
|
||||||
|
|
||||||
// DispatchQueue.main.async {
|
|
||||||
// var iv:UIImageView? = KWindow?.viewWithTag(9988) as? UIImageView
|
|
||||||
// if let imgv = iv {
|
|
||||||
// imgv.image = image
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// iv = UIImageView(frame: CGRect(origin: CGPoint(x: 0, y: 400), size: CGSize(width: KScreenWidth, height: image.size.height*KScreenWidth/image.size.width)))
|
|
||||||
// iv!.tag = 9988
|
|
||||||
// KWindow?.addSubview(iv!)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
let ci = CIImage(cgImage: image.cgImage!)
|
let ci = CIImage(cgImage: image.cgImage!)
|
||||||
return ci
|
return ci
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user