RDVECore來自銳動(dòng)的無UI,高度抽象化API的視頻編輯SDK--IOS版

1編寫目的

預(yù)期讀者:

有視頻編輯開發(fā)經(jīng)驗(yàn)或者無經(jīng)驗(yàn)的,打算或者正在使用“銳動(dòng)IOS版RDVECore”的相關(guān)工程師。

iOS軟件工程師。

產(chǎn)品經(jīng)理。

QA

2名詞解釋

分辨率:用于計(jì)算機(jī)視頻處理的圖像,以水平和垂直方向上所能顯示的像素?cái)?shù)來表示分辨率。常見視頻分辨率的有1080P即1920x1080,720P即1080x720,640x480等。

幀率:每秒的幀數(shù)(fps)或者說幀率表示圖形處理器處理場(chǎng)時(shí)每秒鐘能夠更新的次數(shù)。

碼率: 數(shù)據(jù)傳輸時(shí)單位時(shí)間傳送的數(shù)據(jù)位數(shù),一般我們用的單位是kbps即千位每秒。

寬高比:視頻分辨率的寬高比,常見的有16:9,4:3,1:1。銳動(dòng)視頻編輯SDK對(duì)各寬高比的視頻都支持編輯,導(dǎo)出的默認(rèn)分辨率是640x360,寬高比是16:9。

素材:來自系統(tǒng)相機(jī),其他app,電腦,網(wǎng)絡(luò)的照片,音樂,視頻等。

虛擬視頻(VirtualVideo): 管理編輯中的包含場(chǎng)景、字幕水印等,用于預(yù)覽或?qū)С鰰r(shí)的容器或管理者。

場(chǎng)景(Scene):包含編輯中的媒體對(duì)象。

視頻變速:對(duì)視頻播放速度調(diào)整,實(shí)現(xiàn)慢鏡頭或者快鏡頭效果。

視頻配樂:選取本地或者網(wǎng)絡(luò)音樂作為視頻的背景音樂。

視頻配音:通過mic phone對(duì)視頻配音。

視頻濾鏡:調(diào)整視頻的畫面顏色效果。

濾鏡特效:在視頻里面增加顫抖,心跳等效果

時(shí)間特效:在視頻里面增加慢動(dòng)作,重復(fù)等效果

3RDVECore功能概述

RDVECore是銳動(dòng)推出的無UI,高度抽象化API的視頻編輯SDK,支持以下功能:

3.1豐富的編輯功能

RDVECore包含了豐富的基礎(chǔ)功能,對(duì)于編輯中的視頻、圖片、音樂有各種 處理方式,并且可以根據(jù)實(shí)際的業(yè)務(wù)需求,進(jìn)行搭配組合,所有處理都可以精確 到毫秒級(jí),達(dá)到最專業(yè)的的要求,主要功能如下:

MVMV根據(jù)配置資源進(jìn)行混合以及動(dòng)畫,增強(qiáng)短視頻效果

濾鏡RDVEUISDK本身提供豐富的濾鏡效果讓開發(fā)者進(jìn)行選擇,同時(shí)用戶還可以根據(jù)自己的需求進(jìn)行濾鏡擴(kuò)展。

字幕特效字幕特效支持在指定位置,指定時(shí)間段顯示;實(shí)時(shí)預(yù)覽效果

配音、配樂支持指定時(shí)間段添加配音; 支持配音、配樂與視頻原音比例調(diào)節(jié); 支持本地添加更多配樂

截取、分割支持毫秒級(jí)截取、分割視頻; 支持快速預(yù)覽截取、分割后視頻

調(diào)速調(diào)整視頻的播放速度,快放或者慢放

轉(zhuǎn)場(chǎng)支持多種轉(zhuǎn)場(chǎng); 支持隨機(jī)轉(zhuǎn)場(chǎng)、指定轉(zhuǎn)場(chǎng)時(shí)長(zhǎng)等擴(kuò)展設(shè)置

其它編輯功能支持多種比例裁剪; 支持90、180、270度旋轉(zhuǎn)視頻畫面; 支持左右鏡像、上下鏡像; 支持輸出比例調(diào)整;

3.2完善的視頻拍攝功能

·實(shí)時(shí)美顏可以在拍攝過程中實(shí)時(shí)人臉美膚,提亮、美白等效果,達(dá)到人臉美化,同時(shí)支持美化程度的調(diào)節(jié)

·人臉貼紙/掛件支持人臉識(shí)別及貼紙/掛件顯示

·拍攝自由定義

· RDVECore在拍攝過程中,可以根據(jù)具體的錄制需求,進(jìn)行自由化的設(shè)定,擁有更佳優(yōu)異的拍攝錄制效果。

多段拍攝一個(gè)視頻可以分多段次拍攝

攝像頭切換前、后攝像頭自由切換,中間無卡頓

多比例支持支持1:1 、9:16、16:9多個(gè)比例錄制

變焦、對(duì)焦通過相應(yīng)手勢(shì)可以縮放攝像頭采集畫面及清晰度

·濾鏡

在拍攝過程中,除了實(shí)時(shí)美顏,同時(shí)還可以實(shí)時(shí)添加濾鏡效果,RDVEUISDK本身提供豐富的濾鏡效果讓開發(fā)者進(jìn)行選擇,同時(shí)用戶還可以根據(jù)自己的需求進(jìn)行濾鏡擴(kuò)展。

·照片當(dāng)前攝像頭畫面保存到圖片

RDVECore架構(gòu)圖:

RDVECore簡(jiǎn)要流程圖:

4XCode集成步驟

4.1運(yùn)行環(huán)境

SDK支持iOS7.0及以上版本的設(shè)備,兼容iPhone、iPad、iPod touch

4.2注冊(cè)申請(qǐng)AppKey和APPSecret

4.2.1打開http://www.rdsdk.com/,在銳動(dòng)官網(wǎng)首頁選擇登錄或注冊(cè),新用戶先注冊(cè),老用戶直接登錄。

4.2.2登錄完成后,進(jìn)入視頻云管理點(diǎn)擊“+新增”,填寫您應(yīng)用的名稱等,點(diǎn)擊“提交”,應(yīng)用創(chuàng)建完成。

4.2.3創(chuàng)建應(yīng)用完成后會(huì)自動(dòng)跳轉(zhuǎn)至個(gè)人中心頁面,此時(shí)會(huì)獲取到該應(yīng)用的 AppKey 和 AppSecret。

4.3下載并導(dǎo)入SDK

4.3.1添加靜態(tài)庫libRDVECore.a和頭文件

4.3.2添加RDVECore.bundle

4.3.3工程設(shè)置

TARGETS的Deployment Info僅勾選豎屏(Portrait),橫屏(LandscapeLeft、LandscapeRight)不勾選:

IOS10適配

在 Info.plist 中 添 加 NSCameraUsageDescription 、

NSMicrophoneUsageDescription、NSPhotoLibraryUsageDescription。

添加引用蘋果官方庫

如果錄制時(shí)使用faceU,還需要引用庫Accelerate.framework

設(shè)置 Other Linker Flags

在 TARGETS->Build Settings->Other Linker Flags 中加入-ObjC。

4.4編輯視頻

4.4.1引入頭文件及初始化

#import "RDVECore.h"

/** 初始化對(duì)象

*

* @param appkey 在銳動(dòng)SDK官網(wǎng)(http://www.rdsdk.com/)中注冊(cè)的應(yīng)用Key。

* @param appsecret 在銳動(dòng)SDK官網(wǎng)(http://www.rdsdk.com/)中注冊(cè)的應(yīng)用秘鑰。

* @param size 視頻分辨率

* @param fps 視頻幀率(1-30)

* @param resultFailBlock 初始化失敗的回調(diào)[error:初始化失敗的錯(cuò)誤碼]

*/

- (instancetype) initWithAPPKey:(NSString *)appkey

APPSecret:(NSString *)appsecret

videoSize:(CGSize)size

fps:(int)fps

resultFail:(void (^)(NSError *error))resultFailBlock;

4.4.2構(gòu)造虛擬視頻并添加到播放器

1、 構(gòu)造一個(gè)或多個(gè)場(chǎng)景,并設(shè)置場(chǎng)景的相應(yīng)屬性

NSMutableArray *scenes = [NSMutableArray new];

RDScene *scene = [[RDScene alloc] init];

(設(shè)置場(chǎng)景的相應(yīng)屬性)

[scenes addObject:scene];

2、 將場(chǎng)景添加到播放器中

[_videoCoreSDK addScenes:scenes];

3、 設(shè)置播放器屬性

_videoCoreSDK.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.width);

_videoCoreSDK.delegate = self;

_videoCoreSDK.shouldRepeat = YES;

4、 構(gòu)造虛擬視頻

[_videoCoreSDK build];

5、 將播放器添加到視圖中

[self.view addSubview:_videoCoreSDK.view];

4.4.3MV

1、 初始化MV

NSMutableArray *selectMVEffects = [NSMutableArray array];

VVMovieEffect *mvEffect = [[VVMovieEffect alloc] init];

[selectMVEffects addObject:mvEffect];

2、 設(shè)置MV屬性

//MV路徑

@property (nonatomic,strong) NSURL* _Nullable url;

//MV顯示時(shí)長(zhǎng)

@property (nonatomic,assign) CMTimeRange timeRange;

//MV類型

@property (nonatomic,assign) RDVideoMVEffectType type;

3、 將MV添加到播放器中,或者將MV從播放器中移除

1) 添加[_videoCoreSDK addMVEffect:selectMVEffects];

2) 移除[_videoCoreSDK addMVEffect:nil];

4、 重新構(gòu)造虛擬視頻

[_videoCoreSDK build];

4.4.4配樂

1、 初始化配樂

RDMusic *music = [[RDMusic alloc] init];

2、 設(shè)置配樂屬性

/**音樂總時(shí)間范圍

*/

@property (nonatomic, assign) CMTimeRange timeRange;

/**音樂截取時(shí)間范圍

*/

@property (nonatomic, assign) CMTimeRange clipTimeRange;

/**音樂名稱

*/

@property (nonatomic, strong) NSString *_Nullable name;

/**音量(0.0-1.0),默認(rèn)為1.0

*/

@property (nonatomic, assign) float volume;

/**是否重復(fù)播放

*/

@property (nonatomic, assign) BOOL isRepeat;

3、 將配樂添加到播放器中,或者將配樂從播放器中移除

1) 添加:[_videoCoreSDK addMusic:music];

2) 移除:[_videoCoreSDK addMusic:nil];

4、 重新構(gòu)造虛擬視頻

[_videoCoreSDK build];

4.4.5配音

1、 初始化配音

NSMutableArray *dubbingArr = [NSMutableArray array];

RDMusic *music = [[RDMusic alloc] init];

[dubbingArr addObject:music];

2、 設(shè)置配音屬性:同配樂

3、 將配音添加到播放器中,或者將配音從播放器中移除

1) 添加:[_videoCoreSDK addDubbingMusics:dubbingArr];

2) 移除:[_videoCoreSDK addDubbingMusics:nil];

4、 重新構(gòu)造虛擬視頻

[_videoCoreSDK build];

4.4.6字幕、特效

1、 在初始化播放器時(shí)設(shè)置

_videoCoreSDK.frameLayerBlock = ^(CMTime currentTime, CALayer *layer) {

[weakSelf addSubLayerToFront:layer time:currentTime];

};

2、 初始化字幕(特效)

NSMutableArray *effects = [NSMutableArray array];

RDCaption *caption = [[RDCaption alloc] init];

[effects addObject:caption];

3、 設(shè)置字幕(特效)屬性

/**字幕中心坐標(biāo)點(diǎn)比例

*/

@property (nonatomic ,assign) CGPoint captionCenter;

/**字幕寬度點(diǎn)比例

*/

@property (nonatomic ,assign) CGFloat widthProportion;

/**字幕幀率

*/

@property (nonatomic ,assign) CGFloat fps;

/**字幕時(shí)間范圍

*/

@property (nonatomic ,assign) CMTimeRange timeRange;

/**字幕旋轉(zhuǎn)角度

*/

@property (nonatomic ,assign) float angle;

/**字幕縮放大小

*/

@property (nonatomic ,assign) float scale;

/**id

*/

@property (nonatomic ,assign) NSInteger pid;

/**貼圖類型 0 帶文字,1 不帶文字

*/

@property (nonatomic ,assign) NSInteger type;

/** 字幕圖片文件路徑

*/

@property (nonatomic ,copy) NSString *_Nullable path;

/**圖片前綴名字

*/

@property (nonatomic ,copy) NSString *_Nullable name;

/**持續(xù)時(shí)間

*/

@property (nonatomic ,assign) float duration;

/**多少圖片

*/

@property (nonatomic ,assign) NSInteger count;

/**圖片區(qū)域

*/

@property (nonatomic ,assign) CGRect frame;

/**原始圖片大小

*/

@property (nonatomic ,assign) CGSize size;

/**圖片文字

*/

@property (nonatomic ,copy) NSString *_Nullable pText;

/** 文字圖片

*/

@property (nonatomic ,strong) UIImage *_Nullable tImage;

/**文字字體名稱

*/

@property (nonatomic ,copy) NSString *_Nullable tFontName;

/**文字字體大小

*/

@property (nonatomic ,assign) float tFontSize;

/** 文字旋轉(zhuǎn)度數(shù)

*/

@property (nonatomic ,assign) float tAngle;

/**文字顏色

*/

@property (nonatomic ,strong) UIColor *_Nullable tColor;

/**文字描邊顏色

*/

@property (nonatomic ,strong) UIColor * _Nullable strokeColor;

/**文字描邊寬度

*/

@property (nonatomic ,assign) float strokeWidth;

/** 文字區(qū)域

*/

@property (nonatomic ,assign) CGRect tFrame;

/**文字開始時(shí)間

*/

@property (nonatomic ,assign) float tBegin;

/**文字結(jié)束時(shí)間

*/

@property (nonatomic ,assign) float tEnd;

/**幀動(dòng)畫

*/

@property (nonatomic ,strong) NSArray *_Nullable frames;

/**時(shí)間動(dòng)畫

*/

@property (nonatomic ,strong) NSArray *_Nullable times;

/** 字幕是否支持拉伸

*/

@property (nonatomic, assign) BOOL tStretching;

/**字幕拉伸的

*/

@property (nonatomic ) UIEdgeInsets edgeInsets;

/**字幕拉伸的

*/

@property (nonatomic ) CGRect contentsCenter;

/**音樂

*/

@property (nonatomic , strong) RDMusic *_Nullable music;

4、 初始化CaptionLayer

CaptionLayer* captionLayer = [[CaptionLayer alloc] initWithCaption:caption videoSize:videoSize];

* videoSize:初始化播放器時(shí),設(shè)置的視頻分辨率

5、 在字幕(特效)的顯示范圍(timeRange)內(nèi),將captionLayer添加到1、中的layer上。

具體參照RDVEUISDK。

4.4.7濾鏡

1、 添加所有的濾鏡

NSMutableArray *globalFilters = [NSMutableArray array];

1) 初始化濾鏡

RDFilter* filter = [RDFilter new];

[globalFilters addObject:filter];

2) 設(shè)置濾鏡屬性

/**濾鏡類型

*/

@property (nonatomic,assign)NSInteger type;

/**濾鏡名稱

*/

@property (nonatomic,copy )NSString *name;

/**濾鏡acv地址

*/

@property (nonatomic,copy )NSString *acvPath;

3) 添加所有濾鏡

[_videoCoreSDK addGlobalFilters:globalFilters];

2、 設(shè)置濾鏡

[_videoCoreSDK setGlobalFilter:selectFilterIndex];

4.4.8倒放

/** 倒序

*params: url 視頻源地址

*params: outputUrl 輸出路徑

*params: timeRange 倒序時(shí)間范圍

*params: videoSpeed 視頻速度

*params: progressBlock 倒序進(jìn)度回調(diào)

*params: finishBlock 結(jié)束回調(diào)

*params: failBlock 失敗回調(diào)

*params: cancel 是否取消

*/

+ (void)exportReverseVideo:(NSURL *)url

outputUrl:(NSURL *)outputUrl

timeRange:(CMTimeRange)timeRange

videoSpeed:(float)speed

progressBlock:(void (^)(NSNumber *prencent))progressBlock

callbackBlock:(void (^)())finishBlock

fail:(void (^)())failBlock

cancel:(BOOL *)cancel;

4.4.9水印

/**添加水印

* @param image 水印圖片

* @param point 水印在視頻中相對(duì)于左上角的位置(值為:0.0~1.0)

* @param scale 水印的縮放比例,默認(rèn)為1(圖片的原始大小)

*/

- (void) addWaterMark:(UIImage *)image withPoint:(CGPoint)point scale:(CGFloat)scale;

/**添加文字水印

* @param waterText 水印文字

* @param waterColor 水印文字的顏色

* @param waterFont 水印文字的字體

* @param point 水印在視頻中相對(duì)于左上角的位置(值為:0.0~1.0)

*/

- (void) addWaterMark:(NSString *)waterText color:(UIColor *)waterColor font:(UIFont *)waterFont withPoint:(CGPoint)point;

/**移除水印

*/

- (void)removeWaterMark;

/**添加片尾LOGO

* @param logoImage LOGO圖片

* @param userName 用戶名

* @param showDuration 展示時(shí)長(zhǎng)

* @param fadeDuration 淡入時(shí)長(zhǎng)

*/

- (void) addEndLogoMark:(UIImage *)logoImage userName:(NSString *)userName showDuration:(float)showDuration fadeDuration:(float)fadeDuration;

/**移除片尾LOGO

*/

- (void)removeEndLogoMark;

4.4.10獲取縮略圖

/**獲取某個(gè)時(shí)間點(diǎn)的縮略圖

*/

- (UIImage*)getImageAtTime:(CMTime) outputTime scale:(float) scale;

4.4.11導(dǎo)出視頻

/** 導(dǎo)出視頻

*params: movieURL 輸出路徑

*params: size 分辨率大小

*params: bitrate 碼率(例:設(shè)置為5M碼率,傳值為5)

*params: fps 幀率

*params: maxExportVideoDuration 最大導(dǎo)出時(shí)長(zhǎng) 默認(rèn)為0 不限制

*params: progress 導(dǎo)出進(jìn)度

*params: success 完成

*params: fail 失敗

*/

- (void)exportMovieURL:(NSURL*) movieURL

size:(CGSize) size

bitrate:(int)bitrate

fps:(int)fps

maxExportVideoDuration:(float)maxExportVideoDuration

progress:(void(^)(float))progress

success:(void(^)())success

fail:(void(^)(NSError*))fail;

/** 取消導(dǎo)出

*/

- (void)cancelExportMovie:(void(^)())cancelBlock;

4.4.12編輯完成后釋放

[_videoCoreSDK stop];

_videoCoreSDK.delegate = nil;

_videoCoreSDK = nil;

4.5錄制視頻

4.5.1引入頭文件及初始化

#import "RDCameraManager.h"

/** 初始化對(duì)象

*

* @param appkey 在銳動(dòng)SDK官網(wǎng)(http://www.rdsdk.com/)中注冊(cè)的應(yīng)用Key。

* @param appsecret 在銳動(dòng)SDK官網(wǎng)(http://www.rdsdk.com/)中注冊(cè)的應(yīng)用秘鑰。

* @param resultFailBlock 初始化失敗的回調(diào)[error:初始化失敗的錯(cuò)誤碼]

*/

- (instancetype) initWithAPPKey:(NSString *)appkey

APPSecret:(NSString *)appsecret

resultFail:(void (^)(NSError *error))resultFailBlock;

4.5.2錄制前設(shè)置錄制相關(guān)參數(shù)

/** 錄制之前準(zhǔn)備,用于設(shè)置錄制相關(guān)參數(shù)。

* @param frame 錄制預(yù)覽視圖位置大小

* @param superview 源視圖控制器

* @param bitrate 錄制碼率

* @param fps 錄制幀率

* @param mode 錄制視頻方式:YES:正方形 NO:全屏

* @param size 錄制視頻分辨率

* @param isFront 是否是前置攝像頭錄制

* @param faceU 是否使用faceU

*/

- (void) prepareRecordWithFrame:(CGRect)frame

superview:(UIView *)superview

bitrate: (int) bitrate

fps: (int) fps

mode: (BOOL) mode

writerSize: (CGSize) size

isFront:(BOOL) isFront

faceU:(BOOL) faceU;

//左右滑動(dòng)錄制預(yù)覽視圖時(shí),是否切換濾鏡。默認(rèn)為YES(切換)

@property (nonatomic, assign) BOOL swipeScreenIsChangeFilter;

//美顏狀態(tài)

@property (nonatomic , assign) BeautifyState beautifyState;

/** 設(shè)置對(duì)焦圖片

*/

- (void) setfocus;

4.5.3錄制

/** 啟用預(yù)覽

*/

- (void) startCamera;

/** 關(guān)閉預(yù)覽

*/

- (void) stopCamera;

/** 開始錄制

*/

- (void) beginRecording;

/** 停止錄制

*/

- (void) stopRecording;

/** 拍照

*/

- (void) takePhoto:(int)orientation block:(void(^)(UIImage* image)) func;

/** 聚焦

*/

- (void) focus:(UITapGestureRecognizer *)tap;

/** 切換錄制視頻方式

* @parma mode:YES:正方形 NO:全屏

* @parma frame:錄制預(yù)覽視圖位置大小

*/

- (void) changeMode:(BOOL) mode cameraScreenFrame:(CGRect)frame;

4.5.4錄制回調(diào)

/** 滑動(dòng)切換到的當(dāng)前濾鏡Index

*/

- (void) sendFilterIndex:(NSInteger) index;

/** 聚焦時(shí)回調(diào)

*/

- (void) tapTheScreenFocus;

/** 啟用預(yù)覽(startCamera)后回調(diào)。

* 可用于收到此回調(diào)前,界面上錄制相關(guān)按鈕不可用。

*/

- (void) cameraScreenDid;

/** 當(dāng)前錄制時(shí)間

*/

- (void) currentTime:(float) time;

/** 滑動(dòng)錄制預(yù)覽視圖開始

* @params swipDirection (0 :左劃 1:右劃)

*/

- (void) swipeScreenBegin:(NSInteger)swipDirection;

/** 滑動(dòng)錄制預(yù)覽視圖中

* @param percent 滑動(dòng)動(dòng)預(yù)覽視圖中的位置

* @param swipDirection (0 :左劃 1:右劃)

*/

- (void) swipeScreenChanging:(float)percent swipDirection:(NSInteger)swipDirection;

/** 滑動(dòng)錄制預(yù)覽視圖結(jié)束

* @params swipDirection (0 :左劃 1:右劃)

*/

- (void) swipeScreenChangeEnd:(NSInteger)swipDirection;

/** 錄制開始

*/

- (void) movieRecordBegin;

/** 錄制取消

*/

- (void) movieRecordCancel;

/** 錄制結(jié)束

*/

- (void) movieRecordingCompletion:(NSURL *) videoUrl;

4.5.5faceU

//人臉道具貼紙證書

@property (nonatomic , assign) void* faceUAuth;

//人臉道具貼紙證書長(zhǎng)度

@property (nonatomic , assign) unsigned int faceUAuthlength;

//瘦臉 0.0~1.0 默認(rèn)0.68

@property (nonatomic , assign) float cheekThinning;

//大眼 0.0~2.0 默認(rèn)1.53

@property (nonatomic , assign) float eyeEnlarging;

//美白 0.0~1.0 默認(rèn)0.48

@property (nonatomic , assign) float colorLevel;

//磨皮 1 2 3 4 5 6 默認(rèn)3

@property (nonatomic , assign) float blurLevel;

//瘦臉等級(jí) 0.0 ~ 1.0 默認(rèn)1.0

@property (nonatomic , assign) float faceShapeLevel;

//瘦臉類型

@property (nonatomic , assign) float faceShape;

/** 切換FaceUItem

*/

- (void) changeFaceUItem:(NSString*) itemString withName:(NSString*)name;

4.5.6錄制時(shí)播放音樂

/**使用音樂路徑

*/

- (void)setMusic:(NSURL *)musicUrl;

/** 播放音樂 rate(極慢:1.0/3.0 慢:1.0/2.0 正常:1.0 快:2.0 極快:3.0)

*/

- (void)playMusic:(float)rate;

/** 暫停音樂

*/

- (void)pauseMusic;

/** 停止播放音樂

*/

- (void)stopMusic;

4.5.7濾鏡

/** 添加濾鏡組

*/

- (void) addFilters:(NSArray *) filters;

/** 設(shè)置濾鏡

*/

- (void) setFilterAtIndex:(NSInteger ) index;

/** 移除濾鏡組

*/

- (void) removeFilters;

4.5.8合并及倒序

/** 合并錄制文件

*/

- (void)mergeAndExportVideosAtFileURLs:(NSArray *)fileArray

progress:(void(^)(NSNumber *progress))progressBlock

finish:(void(^)(NSURL *videourl))finish

fail:(void(^)(NSError *error))fail

cancel:(void(^)())cancel;

/** 取消合并

*/

- (void)cancelMerge;

/** 倒序

*params: url 視頻源地址

*params: outputUrl 輸出路徑

*params: timeRange 倒序時(shí)間范圍

*params: progressBlock 倒序進(jìn)度回調(diào)

*params: callbackBlock 結(jié)束回調(diào)

*params: failBlock 失敗回調(diào)

*/

- (void)exportReverseVideo:(NSURL *)url

outputUrl:(NSURL *)outputUrl

timeRange:(CMTimeRange)timeRange

progressBlock:(void (^)(NSNumber *prencent))progressBlock

callbackBlock:(void (^)())callbackBlock

fail:(void (^)())failBlock;

4.5.9獲取帶濾鏡效果的截圖

/** 獲取帶濾鏡的縮略圖

*/

+(void) returnImageWith:(UIImage *)inputImage

Filter:(RDFilter *)obj

withCompletionHandler:(void (^)(UIImage *processedImage))block;

4.5.10錄制完成后釋放

[_cameraManager stopCamera];

[_cameraManager deleteItems];

_cameraManager.delegate = nil;

_cameraManager = nil;

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容