使用 aCIFilter
和 anAVVideoComposition
时,如何在AVAsynchronousCIImageFilteringRequest
回调中访问当前帧号?
我能做的最好的就是估计当时的帧数:
^(AVAsynchronousCIImageFilteringRequest * _Nonnull request) {
double seconds = CMTimeGetSeconds(request.compositionTime);
double fps = [[_avAsset tracksWithMediaType:AVMediaTypeVideo] firstObject].nominalFrameRate;
int frame = round(seconds * fps);
// (Calculate filter parameters based on frame number)
}
但这对我来说还不够准确。有没有办法访问帧号?