SLAvEditExport.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // SLAvEditExport.h
  3. // DarkMode
  4. //
  5. // Created by wsl on 2019/10/14.
  6. // Copyright © 2019 wsl. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #import <AVFoundation/AVFoundation.h>
  11. NS_ASSUME_NONNULL_BEGIN
  12. /// 导出编辑的音视频 默认AVFileTypeMPEG4
  13. @interface SLAvEditExport : NSObject
  14. /// 输出路径
  15. @property (nonatomic, strong) NSURL * _Nonnull outputURL;
  16. /// 音视频裁剪范围 默认不裁剪
  17. @property (nonatomic, assign) CMTimeRange timeRange;
  18. /// 速率 默认1.0 推荐设置范围:0.5~2.0
  19. @property (nonatomic, assign) float rate;
  20. /// 是否保留原生音频 默认YES
  21. @property (nonatomic, assign) BOOL isNativeAudio;
  22. /// 添加音频
  23. @property (nonatomic, strong, nullable) NSArray <NSURL *>*audioUrls;
  24. /// 涂鸦层
  25. @property (nonatomic, strong, nullable) CALayer *graffitiLayer;
  26. /// 贴图 和文本 层集合
  27. @property (nonatomic, strong, nullable) NSMutableArray <CALayer *>*stickerLayers;
  28. /// 初始化
  29. - (id)initWithAsset:(AVAsset *)asset;
  30. /// 导出编辑后的视频
  31. - (void)exportAsynchronouslyWithCompletionHandler:(void (^)(NSError *error))handler progress:(void (^)(float progress))exportProgress;
  32. @end
  33. NS_ASSUME_NONNULL_END