|
@@ -53,7 +53,7 @@ public class PQCompositionExporter {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public func prepare(videoSize: CGSize) -> Bool {
|
|
|
+ public func prepare(videoSize: CGSize,videoAverageBitRate:Int = 0) -> Bool {
|
|
|
guard !FileManager.default.fileExists(atPath: exportURL.absoluteString) else {
|
|
|
return false
|
|
|
}
|
|
@@ -96,11 +96,11 @@ public class PQCompositionExporter {
|
|
|
print("Couldn't process movie with error: \(error)")
|
|
|
}
|
|
|
BFLog(message: "export mShowVidoSize is \(String(describing: input?.mShowVidoSize))")
|
|
|
-
|
|
|
+
|
|
|
let videoEncodingSettings: [String: Any] = [
|
|
|
AVVideoCompressionPropertiesKey: [
|
|
|
AVVideoExpectedSourceFrameRateKey: 30,
|
|
|
- AVVideoAverageBitRateKey: (input?.mShowVidoSize.width ?? 0) * (input?.mShowVidoSize.height ?? 0) * 4,
|
|
|
+ AVVideoAverageBitRateKey: videoAverageBitRate == 0 ? Int(input?.mShowVidoSize.width ?? 0) * Int(input?.mShowVidoSize.height ?? 0) * 2 : videoAverageBitRate,
|
|
|
AVVideoProfileLevelKey: AVVideoProfileLevelH264HighAutoLevel,
|
|
|
AVVideoH264EntropyModeKey: AVVideoH264EntropyModeCABAC,
|
|
|
],
|