0

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 ?

Dirk-Willem van Gulik
  • 7,566
  • 2
  • 35
  • 40
  • The URL begins with rtps instead of rtsp in your example. I used rtsp in QTKit, the playback worked fine. – Davyd Geyl May 14 '13 at 11:50
  • Sorry - that just a typo in the example. The real url is passed from the bonjour advertizing of the camera. And playback works just fine. The issue I am having is grabbing a *single* frame. – Dirk-Willem van Gulik May 14 '13 at 12:30
  • This may not be supported. I needed to capture movie from rtsp stream, but there was no interface for that. When I asked Apple engineers from the Quicktime team they said it was not supported. I had a feeling that they supported rtsp at some stage to the certain degree, but it is very limited compare to usual movie processing. Also, there is hardly any chance they would improve Quicktime at all. AVFoundation is the successor for normal movies, when HTML5 movie tag for streaming. – Davyd Geyl May 15 '13 at 00:26
  • Aye - and AVFoundation seems to be slanted towards HLS even more - with RTSP even more of an afterthought. – Dirk-Willem van Gulik May 15 '13 at 08:37

0 Answers0