Rapid seeking with Quicktime

Using Quicktime on OSX and I think I’m doing something quicktime hates. I’m using a MovieSurfaceRef as a lookup texture and many times (hundreds) a frame I tell a quicktime movie to seek to a frame, which I then try to sample as a surface. I never actually ever tell the movie to play, just seeking.

It seems like I can do it when I access the frames in order, maybe because of some precision error that looks ok as long as it’s not off too much, but when I try to sample from many different places in rapid succession it seems to make a lot of mistakes. I’m guessing seeking isn’t instantaneous, but does anyone have workarounds? In the meantime also open to other formats or video players this might work better in. I’d love to avoid image sequences just to reduce how many files I’m messing with.


What codec are you using? Inter-frame codecs have to seek to a keyframe, then decode to somewhere near the frame you’re looking for. There’s tradeoff between accuracy of the seek, and the amount of time and CPU power it takes to get there. This tradeoff is tuneable in the QuickTIme SDK. For frame-accurate (and fast) seeking, you need to use a sequential codec like MJPEG or HAP. The simplest thing is to do MJPEG in a MOV and use Quicktime. If you’re still hitting performance issues, you can look into HAP.

I’m having trouble playing anything but ProRes back through Cinder native qtime implementation, and from what I understand I don’t think you have the option to keyframe every frame when exporting as ProRes. I’ve used hap before, but it’s a system where others will be adding videos, and asking them to download a new codec isn’t super friendly. Thanks for the advice, I’ll keep playing around with codecs.