AwemeLike
AwemeLike copied to clipboard
仿照抖音的特效相机,实现美颜、2D贴图、分屏、转场等
可以通过 AVPlayer 来加载文件, 滑动的时候用avplayer的seek , 图像来自于通过时间进行获取 CVPixelBufferRef _player = [[AVPlayer alloc]initWithURL:[NSURL fileURLWithPath:videoUrl]]; NSDictionary * pixelBufferDict = @{(__bridge NSString*)kCVPixelBufferPixelFormatTypeKey:@(kCVPixelFormatType_32BGRA)}; _videoOutput = [[AVPlayerItemVideoOutput alloc]initWithPixelBufferAttributes:pixelBufferDict]; [_player.currentItem addOutput:_videoOutput]; CMTime itemTime = _playerItem.currentTime; if ([_videoOutput...
内存和 cpu 高 持续增长
崩溃原因:Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) 在文件[HPVideoDecoder openFile] self->sampleRate = asbd->mSampleRate;  查询了下原因是在iOS13系统中, HPPlayer 与 HPSynchronizer 两个类没有释放,在点击特效->进入下一页->取消,再进入特效页反复两次就会发生崩溃.而且在iOS13系统中,生成缩略图的方法也出现了问题. 补充: 是HPVideoDecoder的asset为空造成的;