Estoy tratando de obtener la cantidad de fotogramas por segundo de un archivo .gif, Estoy convirtiendo el archivo gif a NSData y de ese NSData tomo una matriz de marcos usando este código: - (NSMutableArray *) getGifFrames: (NSData *) datos {¿cómo puedo obtener la cantidad de fotogramas por segundo de un archivo gif?
NSMutableArray *frames = nil;
CGImageSourceRef src = CGImageSourceCreateWithData((CFDataRef)data, NULL);
if (src) {
size_t l = CGImageSourceGetCount(src);
frames = [NSMutableArray arrayWithCapacity:l];
for (size_t i = 0; i < l; i++) {
CGImageRef img = CGImageSourceCreateImageAtIndex(src, i, NULL);
if (img) {
[frames addObject:[UIImage imageWithCGImage:img]];
CGImageRelease(img);
}
}
CFRelease(src);
}
return frames;
}
es hay alguna forma de conseguir el FPS del gIF? Gracias
¿Eso significa un GIF efectivamente tiene una tasa de cuadros variable? – rjstelling
@rjstelling sí exactamente – AnthonyBlake
¡Gracias por su respuesta! – Legnus