For a project I'm working on, I need to be able to grab all frames from
an rtsp video stream. This stream is produced by an Elphel 333 camera
<http://www.elphel.com>. The camera is reportedly able to produce 1
megapixel video at 30 fps...
As a first (naive...) approach I decided to use QTKit to try and capture
images as they come in. I play the stream in an off screen
NSWindow/QTMovieView, and register a callback on the Quicktime Movie
type to be notified when each frame is drawn. Then I grab the frame.
On my slow Powerbook I've been experimenting with an rtsp stream
(160*120
pixel mp4) from the internet. When I'm not grabbing frames it runs at ~
20 fps. Grabbing a frame only takes 0.04 Seconds on average, so I was
expecting to grab @ ~10fps. In practice I only achieve around 2fps,
so it
seems that grabbing frames somehow 'upsets' the playback of the stream.
On second thought, the problem may simply be that grabbing the frame
makes the movie become out of sync with the stream, and re-syncing
takes time.
The final product is going to run on a G5 @ 2.5 GHz with a GeForce 7800.
Also, I believe the rtsp stream from the camera will be mjpeg, not mp4.
I have a few questions:
- Am I taking the right approach to grabbing frames, could my Cocoa code
be improved?
- Could I improve performance by using Quicktime directly, instead of
using(/abusing) QTKit?
- Any pointers to other software or discussions on frame-grabbing would
be most welcome. I couldn't find Apple example code that relates to
grabbing frames from a network stream, but maybe I didn't look in the
right place.
TIA,
patrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden