From: Louis-Philippe Date: 2010-04-14T22:35:47+09:00 Subject: Re: QTKit glitchy on Snow Leopard Server - Help! --001636b2b03b82dff90484327438 Content-Type: text/plain; charset=ISO-8859-1 I can't identify your problem in the code, If that may help you find the bug, I had lot of trouble lately with timescales... behaviour is not consistent with the arrival of Quicktime-X... I would try to print debug info from my time values while the program is running, just to be sure they are what I think they are. 2010/4/13 Spencer Rogers > I have written a script to pull a frame image from a QuickTime Movie. It > works great on Snow Leopard, Leopard, and Leopard Server but I get weird > results on Snow Leopard Server. > > When pulling on the 3 working OSs I get the frame at the specified time. > However when I execute the exact same script with the exact same movie > on SL Server I get a completely black frame (not sure if its black > because of an error or because its pulling the first frame - which > happens to be black). Would you mind taking a look at my code and see if > I'm doing anything wrong? Has anybody else experienced weird results > with QTKit on SL Server? > > > require "osx/cocoa" > include OSX > OSX.require_framework 'QTKit' > > # set the save path > savePath = "test.png" > > # set the time code > timeCode = 1000 > > # initailize the movie > qtmovie = OSX::QTMovie.alloc.initWithFile_error("movie.mov", nil) > > # determine the timescale of the movie > timeScale = qtmovie.attributeForKey('QTMovieTimeScaleAttribute') > > # build a QTTime object using the timeCode and the timeScale > time = OSX::QTMakeTime(timeCode, timeScale) > > # pull the frame > frame = qtmovie.frameImageAtTime_withAttributes_error(time, > {QTMovieFrameImageType => QTMovieFrameImageTypeNSImage}, nil) > > # save the frame > properties = {NSImageGamma => 1.0, NSImageInterlaced => false} > bitmapRep = > OSX::NSBitmapImageRep.alloc.initWithData(frame.TIFFRepresentation) > blob = bitmapRep.representationUsingType_properties(NSPNGFileType, > properties) > blob.writeToFile_atomically(savePath, false) > -- > Posted via http://www.ruby-forum.com/. > > --001636b2b03b82dff90484327438--