I've got a couple of odd issues using QTKit to feed an image input
port on a QCRenderer in an OpenGL context.

Basically, I capture from a live camera using QTKit/QTCaptureSession.
When a frame arrives, I get the image using
captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection: and
convert to an NSImage. I then set the input port of my QCRenderer to
the image, then tell the QCRenderer to render the frame. It works ok,
except for two things:

1. Sometimes the video shown on screen lags noticeably behind, like 10
seconds or so behind. It tends to run very slowly for a short time,
then speed itself up to catch back up to realtime.

Is that something common to QTCaptureSession, or is it my QCRenderer
going too slowly and causing a backlog of frames to render? If it's
the latter, is there a way to find out if the last frame has finished
rendering so I can discard frames?

2. An odd openGL related bug. Sometimes I want to stop capturing, and
do post-processing on the current image. To do this, I do a
stopRunning on the QTCaptureSession to stop the camera, then set a
NSTimer to render at 30fps. To reactivate the camera, I invalidate the
timer, then start the capture session. It works sometimes, other times
I get a very odd glitch (or a major crash!). It always seems to fail
when stopping the camera. My log shows this:

2009-09-22 14:18:27.930 Resolve[512:10b] Camera inactive: starting
timer  [my message saying that capture has stopped, and the timer is
active]
2009-09-22 14:18:27.972 Resolve[512:ce03] *** Message from <QCSprite =
0x0F5C37C0 "Sprite_1">:
OpenGL error 0x0502 (invalid operation)
2009-09-22 14:27:19.162 Resolve[313:ce03] *** Message from <QCSprite =
0x0F5C3AA0 "Sprite_1">:
Execution failed at time 275318839.161 [plus several more of these]

In the window, sometimes the view flashes white for a second or so,
and then the view turns upside down and gets stretched a bit
vertically (this is extra bad news, because for this application I
doubt anyone would notice if the view was upside down and stretched,
but it would ruin the results!) The app continues to run with the
upside down image - turning the camera on/off more times has no effect
on the view, but in the log I see that sometimes works and sometimes
it causes errors. Example from log:

2009-09-22 14:27:19.165 Resolve[313:ce03] *** Message from <QCPatch =
0x0F50D1C0 "(null)">:
Execution failed at time 275318839.101 [last error - view is now inverted]
2009-09-22 14:27:32.676 Resolve[313:10b] Camera inactive: starting
timer [camera stopped, no issue]
2009-09-22 14:27:46.157 Resolve[313:10b] Camera inactive: starting
timer [camera stopped, no issue]
2009-09-22 14:27:46.213 Resolve[313:ce03] *** Message from <QCSprite =
0x0F5C3AA0 "Sprite_1">:
OpenGL error 0x0504 (stack underflow) [camera stopped, different error
this time]
2009-09-22 14:27:46.215 Resolve[313:ce03] *** Message from <QCSprite =
0x0F5C3AA0 "Sprite_1">:
Execution failed at time 275318866.213 [several more of these, then
the app works again]

Sometimes the app will crash. I have a backtrace if it'll help.

A couple of times, I've had it totally lock the OS (only the mouse can
be moved - the UI it totally unresponsive) and I had to do a hard
reboot. Nothing shows up in the console - the last even is my app
reporting that the camera has been turned off :(

I'm guessing I'm doing it wrong, any pointers? :)

Thanks

Chris
 _______________________________________________
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]

Reply via email to