开发者

How to extract QTTracks of a streamed (RTSP) movie using QTMovie APIs?

Is anyone aware of how to get the QTTracks for a RTSP streamed movie using QTMovie (QTKit) APIs?

Basically I want to extract audio and video tracks from the movie and do some extra processing before playing them.

Following is a simplified code snippet, this works great for local movie files but fails for RTSP streams:

NSError* err = nil;
QTMovie* myMovie = [QTMovie movieWithURL: @"rtsp://example.com/123.mov" error: &err];
NSNumber* loadState = [mMovie attributeForKey: QTMovieLoadStateAttribute];

// This succeeds
if ( [loadState intValue] >= QTMovieLoadStatePlayable ) {

  // This fails - audioTracks returns a count of 0
  NSArray* audioTracks = [mMovie tracksOfMediaType: QTMediaTypeSound];
  if ( [a开发者_如何转开发udioTracks count] > 0 ) {
    [self processTrack: (QTTrack*)[audioTracks lastObject]];
  }
}

Thanks in advance for all your help.


With rtsp streams the actual file the QTMovie works on is a "stream media handler" container, about 10kb in size, you can verify by seeing if the QTMovieDataSizeAttribute key is under 200 or so, there is no way to get to the actual data in the stream (not even with the 10.7 AVCaptureInput api)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜