View Full Version : OpenGLView > NSImage > QuickTime conversion

Jul 16, 2009, 10:10 PM
From what i can tell, to make a QT Movie you can just keep appending an image to an instance of a QTMovie specifying the time the image should appear for (although i think last time i tried this getting the correct time was a giant mission)

If you want the QT Movie to be based on something you've been outputting to an NSOpenGLView how do you get the NSImage out from that? i've been looking through the docs but i can't seem to find something...

basically the question is...
I made an animation in openGL, how do i export that as a quicktime?

Jul 16, 2009, 11:50 PM
I think what you want is glReadPixels()

Jul 19, 2009, 05:47 PM

i found this page here:

which appears to tell me how to to use glReadPixels, it appears that it takes screen shots though..(or is it for the active thin that the gl commands are working on?) that would be bad if the window gets hidden by other windows or i want to render out something larger than my screen resolution allows

also it converts the data to a UIImage, but i assume i can convert the CGImageRef into data to initialize a NSImage?

Jul 20, 2009, 06:06 PM
well the cool thing is is that i got a picture to be exported as a quicktime clip

the bad news is is that it wont read from the other frames, it just keeps appending the first frame over and over again

the more bad news is that the export is most likely goign to be totally out of sync with the original audio track because QTTime is a load of crap, it's impossible to get the frames to display at the the correct frame rate.

can anyone make sense of the QTMakeTime method?

nevermind, i found someone's blog about QTTime http://jongampark.wordpress.com/2008/10/27/qttime-qtstringtime-and-smpte/

but the question still remains.... how do i get it to render the next frame in the sequence... of course i don't expect anyone to answer this! :p
this is some fault in the original programming... guess i'll just have to keep bashing away at this... :(

ok... i think everything is sorted... yay! thanks kainjow