On May 30, 2010, at 00:21:52, vade wrote:
> How are you accessing your frame from the movie? frameImageAtTime: ? if you
> request an NSImage, its very slow from my (limited) experience. Requesting a
> CVPixelBuffer or CIImage may be faster via frameImageAtTime: withAttributes,
> and you could even go with a QTVisualContext and stop the movie, and go to
> the next frame manually and extract the frame from your visual context via
> QTVisualContextCopyFrameForTime, which is very fast from my experience. The
> method commonly used for realtime rendering is using an
> QTOpenGLTextureContext, requesting CVOpenGLTextureRefs, and passing them to a
> QCRenderer that is initted with the same OpenGL context, or a shared context
> from the one you initted your Visual Context with. This guarantees texture
> sharing, but may be overkill. I suspect it will be pretty fast, even for
> stepping through and rendering "offline" compared to other methods.
I'm using -currentFrameImage and -currentTime, and -stepForward. Not important
that it be real time, but I was getting around one frame per second, on average
(it would speed up and slow down, presumably at keyframes).
> As far as sanctioned or not, well, looping like that will not let you process
> events in your main thread so you would not be able to pass in mouse
> events/etc to QC, but it sounds like you want offline rendering anyway,
> right? Theres more than one way to handle drawing to GL, NSOpenGLView, or a
> making your own NSOpenGLCOntext and CVDisplayLink, or an NSTimer, etc.
Oh, for sure, and I wasn't going to do that in the end, but that was the
example.
>
> On May 30, 2010, at 3:00 AM, Rick Mann wrote:
>
>> It's either a sanctioned way to draw, or it's not. The fact that they even
>> draw in a loop is more telling, because you can't do that in drawRect,
>> either.
>>
>> I'm processing videos by passing a single frame "through" a composition,
>> then taking that result and writing it to a new QTMovie. The view is just to
>> give some feedback to the user while this is going on.
>>
>> (It's terribly slow, getting a single frame out of the input movie at a
>> time, but I've gotten no response on the QT list as to why.)
>>
>> --
>> Rick
>>
>> On May 29, 2010, at 23:56:21, vade wrote:
>>
>>> Thats note is really more, bare bones, get something on the screen. Most
>>> dev examples either subclass drawRect, or use a timer/CVdisplay link to
>>> draw multiple frames at a video like framerate. If you only need to draw
>>> one frame, that method could work, but re-sizing your view you require a
>>> redraw, etc. What is your goal with this app?
>>>
>>> On May 30, 2010, at 2:53 AM, Rick Mann wrote:
>>>
>>>> Yet the docs clearly show the QCRenderer being initialized and then
>>>> immediately drawing to the view, which you wouldn't do in a drawRect
>>>> method, so what gives?
>>>>
>>>> On May 29, 2010, at 23:52:50, vade wrote:
>>>>
>>>>> "As with other views, you use your OpenGL view’s drawRect: method to draw
>>>>> the content of your view. When your drawRect: method is invoked, the
>>>>> environment is automatically configured for drawing using the OpenGL
>>>>> graphics context associated with your view."
>>>>>
>>>>> "To use an OpenGL view in your program, you create a subclass of
>>>>> NSOpenGLView and add that view to your window, either programmatically or
>>>>> using Interface Builder."
>>>>>
>>>>> file:///Developer/Documentation/DocSets/com.apple.adc.documentation.AppleSnowLeopard.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/CocoaDrawingGuide/QuartzOpenGL/QuartzOpenGL.html#//apple_ref/doc/uid/TP40003290-CH211-BAAECJDJ
>>>>>
>>>>> On May 30, 2010, at 1:46 AM, Rick Mann wrote:
>>>>>
>>>>>>
>>>>>> On May 29, 2010, at 17:17:26, vade wrote:
>>>>>>
>>>>>>> Is that code in your NSopenGLView, and are you rendering in drawRect?
>>>>>>> when is that actually happening? In init? In awake from nib? You
>>>>>>> probably want to move the rendering to drawRect in your NSOpenGLView,
>>>>>>> but without more details its hard to know.
>>>>>>
>>>>>> No, I do this call once, when I create the renderer (which is after the
>>>>>> user chooses a couple of files for processing).
>>>>>>
>>>>>> This is straight from the QCRenderer reference doc overview. Nothing
>>>>>> tells me I have to subclass the view and do this in the drawRect method,
>>>>>> and I don't think that is necessarily the right way to do this (is it?).
>>>>>>
>>>>>>>
>>>>>>> On May 29, 2010, at 8:07 PM, Rick Mann wrote:
>>>>>>>
>>>>>>>> I tried my first stab at rendering a simple composition with
>>>>>>>> QCRenderer:
>>>>>>>>
>>>>>>>> NSOpenGLContext* glCTX = self.outputFrameView.openGLContext;
>>>>>>>> if (mQCRenderer == nil)
>>>>>>>> {
>>>>>>>> NSOpenGLPixelFormat* pixelFormat =
>>>>>>>> self.outputFrameView.pixelFormat;
>>>>>>>> mQCRenderer = [[QCRenderer alloc]
>>>>>>>> initWithOpenGLContext: glCTX
>>>>>>>> pixelFormat: pixelFormat
>>>>>>>> file: mCompositionPath];
>>>>>>>> }
>>>>>>>>
>>>>>>>> bool success = [mQCRenderer renderAtTime: 0.0 arguments: nil];
>>>>>>>> [glCTX flushBuffer];
>>>>>>>>
>>>>>>>> But nothing appeared in my GL view. success was true.
>>>>>>>>
>>>>>>>> Any suggestions? Thanks!
>>>>>>>>
>>>>>>>> --
>>>>>>>> Rick
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>>> Quartzcomposer-dev mailing list
>>>>>>>> ([email protected])
>>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>> http://lists.apple.com/mailman/options/quartzcomposer-dev/doktorp%40mac.com
>>>>>>>>
>>>>>>>> This email sent to [email protected]
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]