项目需求:生成一个倒序播放的视频文件
注:项目的需求,生成的视频文件不带原音轨道
+ (void)assetByReversingAsset:(NSURL *)assetUrl complition:(void (^)(NSURL *outputPath)) completionHandle{
NSError *error;
AVAsset *asset = [AVAsset assetWithURL:assetUrl];
AVAssetReader *reader = [[AVAssetReader alloc] initWithAsset:asset error:&error];
AVAssetTrack *videoTrack = [[asset tracksWithMediaType:AVMediaTypeVideo] lastObject];
NSDictionary *readerOutputSettings = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarFullRange], kCVPixelBufferPixelFormatTypeKey, nil];
AVAssetReaderTrackOutput* readerOutput = [AVAssetReaderTrackOutput assetReaderTrackOutputWithTrack:videoTrack
outputSettings:readerOutputSettings];
[reader addOutput:readerOutput];
[reader startRead