For some odd reasons - currentFrameImage fails on a QTKit QTMovie(player) - when the latter is handling RTSP; though is fine when playing things like file::///.../some.h264
Relevant code
movie1 = [QTMovie movieWithURL:[NSURL URLWithString:@"rtsp://axiscam/..foo.h264"]
error:&error];
movie2 = [QTMovie movieWithURL:[NSURL URLWithString:@"file:////axis-capture.h264"]
error:&error];
...
movieView.movie = flag ? movie1 : movie2;
[movieView play:sender];
And code to 'snapshot':
-(IBAction)copy:(id)sender {
NSImage * image = [movieView.movie currentFrameImage];
if (!image) {
NSSound * snd = [NSSound soundNamed:@"Basso"];
[snd play];
return;
}
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
[pasteboard clearContents];
NSArray *copiedObjects = [NSArray arrayWithObject:image];
[pasteboard writeObjects:copiedObjects];
}
Things work fine on a saved stream of the camera; but I get a null (or black image) back when the same is applied to the RTSP stream (in the same H.264 format). Both play fine in the window. With the usual pause/etc working perfectly.
IS QTKit fundamentally unable to handle RTSP ?