/TLStoryCameraFramework/TLStoryCameraFramework/Class/Models/TLStoryConfiguration.swift

https://github.com/timelessg/TLStoryCamera · Swift · 82 lines · 38 code · 16 blank · 28 comment · 0 complexity · 68ecc8528430f961d27f5f0eebb69fb9 MD5 · raw file

  1. //
  2. // TLStoryConfiguration.swift
  3. // TLStoryCamera
  4. //
  5. // Created by GarryGuo on 2017/5/10.
  6. // Copyright © 2017年 GarryGuo. All rights reserved.
  7. //
  8. import UIKit
  9. class TLStoryConfiguration: NSObject {
  10. //是否开启美颜
  11. public static let openBeauty:Bool = false
  12. //最大录像时间
  13. public static let maxRecordingTime:TimeInterval = 10.0 * 60
  14. //最短录像时间(<此时间都是拍照)
  15. public static let minRecordingTime:TimeInterval = 30
  16. //最大镜头焦距
  17. public static let maxVideoZoomFactor:CGFloat = 20
  18. //视频输入
  19. public static let videoSetting:[String : Any] = [
  20. AVVideoCodecKey : AVVideoCodecH264,
  21. AVVideoWidthKey : 720,
  22. AVVideoHeightKey: 1280,
  23. AVVideoCompressionPropertiesKey:
  24. [
  25. AVVideoProfileLevelKey : AVVideoProfileLevelH264Main31,
  26. AVVideoAllowFrameReorderingKey : false,
  27. //码率
  28. AVVideoAverageBitRateKey : 720 * 1280 * 3
  29. ]
  30. ]
  31. //音频输入
  32. public static let audioSetting:[String : Any] = [
  33. AVFormatIDKey : kAudioFormatMPEG4AAC,
  34. AVNumberOfChannelsKey : 2,
  35. AVSampleRateKey : 16000,
  36. AVEncoderBitRateKey : 32000
  37. ]
  38. //视频采集格式
  39. public static let videoFileType:String = AVFileType.mov.rawValue
  40. //视频采集尺寸
  41. public static let captureSessionPreset:String = AVCaptureSession.Preset.hd1280x720.rawValue
  42. //输出的视频尺寸
  43. public static let outputVideoSize:CGSize = CGSize.init(width: 720, height: 1280)
  44. //输出的图片尺寸
  45. public static let outputPhotoSize:CGSize = CGSize.init(width: 1080, height: 1920)
  46. //视频路径
  47. public static let videoPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first?.appending("/storyvideo")
  48. //图片路径
  49. public static let photoPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first?.appending("/storyphoto")
  50. //最大笔触
  51. public static let maxDrawLineWeight:CGFloat = 30
  52. //最小笔触
  53. public static let minDrawLineWeight:CGFloat = 5
  54. //默认笔触
  55. public static let defaultDrawLineWeight:CGFloat = 5
  56. //最大字体大小
  57. public static let maxTextWeight:CGFloat = 60
  58. //最小字体大小
  59. public static let minTextWeight:CGFloat = 12
  60. //默认字体大小
  61. public static let defaultTextWeight:CGFloat = 30
  62. //导出水印
  63. public static let watermarkImage:UIImage? = UIImage.init(named: "watermark")
  64. //导出水印位置
  65. public static let watermarkPosition:UIEdgeInsets = UIEdgeInsets.init(top: 0, left: 0, bottom: 10, right: 10)
  66. }