简体   繁体   English

视频播放时如何访问avplayer视频缓冲区帧

[英]How to access avplayer video buffer frames while video is playing

If I have a video file that is playing, what is the most efficient way to add a video filter? 如果我正在播放视频文件,添加视频过滤器的最有效方法是什么? I know I can use generateCGImagesAsynchronouslyForTimes, but I'd like to do it in real time. 我知道我可以使用generateCGImagesAsynchronouslyForTimes,但我想实时进行。

RosyWriter in Apple's Docs show how you can do it for live video before the buffer frame is displayed to the user. Apple Docs中的RosyWriter展示了如何在向用户显示缓冲帧之前对实时视频进行处理。 I'd like to do the same thing for a video that is already recorded, while it is playing 对于播放中的已录制视频,我想做同样的事情

I use "SCPlayer" - subclass of AVPlayer from https://github.com/rFlex/SCRecorder It provides great way to perform groups of CIFilters, so you can even change it when video is playing :) Here you also can find custom ExportSession to save video with filter. 我使用“ SCPlayer”-来自https://github.com/rFlex/SCRecorder的AVPlayer的子类它提供了执行CIFilter组的好方法,因此您甚至可以在播放视频时更改它:)在这里,您还可以找到自定义ExportSession使用过滤器保存视频。 To use this you need to init your video as AVAsset. 要使用此功能,您需要将视频初始化为AVAsset。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM