UGCKitRecordViewController.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright (c) 2019 Tencent. All rights reserved.
  2. #import <UIKit/UIKit.h>
  3. #import "UGCKitTheme.h"
  4. #import "UGCKitWatermark.h"
  5. #import "UGCKitResult.h"
  6. enum TXVideoAspectRatio : NSInteger;
  7. enum TXVideoResolution : NSInteger;
  8. enum TXAudioSampleRate : NSInteger;
  9. typedef NS_ENUM(NSUInteger, UGCKitRecordStyle) {
  10. UGCKitRecordStyleRecord, /// 纯录制模式
  11. UGCKitRecordStyleDuet, /// 分屏合拍模式
  12. UGCKitRecordStyleTrio /// 三屏合拍模式
  13. };
  14. @interface UGCKitRecordConfig : NSObject
  15. /// 画面比例,默认为9:16
  16. @property (assign, nonatomic) enum TXVideoAspectRatio ratio;
  17. /// 分辨率,默认为720p
  18. @property (assign, nonatomic) enum TXVideoResolution resolution;
  19. /// 比特率,默认为9600
  20. @property (assign, nonatomic) int videoBitrate;
  21. ///音频采样率
  22. @property (assign, nonatomic) enum TXAudioSampleRate audioSampleRate;
  23. /// 最小时长,单位秒,默认为5
  24. @property (assign, nonatomic) float minDuration;
  25. /// 最长时长,单位秒,默认为30
  26. @property (assign, nonatomic) float maxDuration;
  27. /// 每秒帧数,默认为15
  28. @property (assign, nonatomic) int fps;
  29. /// 关键帧间隔,单位秒,默认为3
  30. @property (assign, nonatomic) int gop;
  31. /// 视频水印
  32. @property (strong, nonatomic) UGCKitWatermark *watermark;
  33. /// 合唱视频
  34. @property (strong, nonatomic) NSArray<NSString *> *chorusVideos;
  35. /// 合拍模式(纯录制 / 分屏合拍 / 三屏合拍),默认是纯录制模式
  36. @property (assign, nonatomic) UGCKitRecordStyle recordStyle;
  37. /// 是否开启回声消除, 默认开启
  38. @property (assign, nonatomic) BOOL AECEnabled;
  39. /// 是否载入草稿
  40. @property (assign, nonatomic) BOOL recoverDraft;
  41. /// 录满时长后是否直接调用complete回调, 默认为YES
  42. @property (assign, nonatomic) BOOL autoComplete;
  43. @end
  44. /// 短视频录制VC
  45. @interface UGCKitRecordViewController : UIViewController
  46. - (instancetype)initWithConfig:(UGCKitRecordConfig *)config theme:(UGCKitTheme *)theme;
  47. @property (nonatomic,copy) void (^completion)(UGCKitResult *result);
  48. @end