如何消除 QuickTime 流式视频中的延迟

发布于 2024-09-01 15:21:48 字数 1412 浏览 5 评论 0原文

我正在制作一个客户端原型,该客户端通过 Quicktime 客户端显示来自 HaiVision Barracuda 的流视频。我一直无法将缓冲区大小减少到 3.0 秒以下...对于此应用程序,我们需要网络允许的尽可能低的延迟,并且更喜欢视频丢失而不是延迟。我正在执行以下操作:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

    NSString *path = [[NSBundle mainBundle] pathForResource:@"haivision" ofType:@"sdp"];

    NSError *error = nil;
    QTMovie *qtmovie = [QTMovie movieWithFile:path error:&error];
    if( error != nil ) {
        NSLog(@"error: %@", [error localizedDescription]);
    }

    Movie movie = [qtmovie quickTimeMovie];
    long trackCount = GetMovieTrackCount(movie);
    Track theTrack = GetMovieTrack(movie,1);
    Media theMedia = GetTrackMedia(theTrack);
    MediaHandler theMediaHandler = GetMediaHandler(theMedia);
    QTSMediaPresentationParams myPres;

    ComponentResult c = QTSMediaGetIndStreamInfo(theMediaHandler, 1,kQTSMediaPresentationInfo,
                             &myPres);
    Fixed shortdelay = 1<<15;
    OSErr theErr = QTSPresSetInfo (myPres.presentationID,
                               kQTSAllStreams,
                               kQTSTargetBufferDurationInfo,
                                &shortdelay );
    NSLog(@"OSErr %d", theErr);

    [movieView setMovie:qtmovie];
    [movieView play:self];
}

尽管 ComponentResult 和 OSErr 都返回 -50,但我似乎一直在获取有效的对象/结构直至 QTSPres。流媒体视频播放正常,但缓冲区仍为 3.0 秒。任何帮助/见解表示赞赏。

J

I'm prototyping a client that displays streaming video from a HaiVision Barracuda through a quicktime client. I've been unable to reduce the buffer size below 3.0 seconds... for this application, we need as low a latency as the network allows, and prefer video dropouts to delay. I'm doing the following:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

    NSString *path = [[NSBundle mainBundle] pathForResource:@"haivision" ofType:@"sdp"];

    NSError *error = nil;
    QTMovie *qtmovie = [QTMovie movieWithFile:path error:&error];
    if( error != nil ) {
        NSLog(@"error: %@", [error localizedDescription]);
    }

    Movie movie = [qtmovie quickTimeMovie];
    long trackCount = GetMovieTrackCount(movie);
    Track theTrack = GetMovieTrack(movie,1);
    Media theMedia = GetTrackMedia(theTrack);
    MediaHandler theMediaHandler = GetMediaHandler(theMedia);
    QTSMediaPresentationParams myPres;

    ComponentResult c = QTSMediaGetIndStreamInfo(theMediaHandler, 1,kQTSMediaPresentationInfo,
                             &myPres);
    Fixed shortdelay = 1<<15;
    OSErr theErr = QTSPresSetInfo (myPres.presentationID,
                               kQTSAllStreams,
                               kQTSTargetBufferDurationInfo,
                                &shortdelay );
    NSLog(@"OSErr %d", theErr);

    [movieView setMovie:qtmovie];
    [movieView play:self];
}

I seem to be getting valid objects/structures all the way down to the QTSPres, though the ComponentResult and OSErr are both returning -50. The streaming video plays fine, but the buffer is still 3.0seconds. Any help/insight appreciated.

J

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫相离 2024-09-08 15:21:48

降低视频质量。这将导致发送的数据更少,从而使 3 秒缓冲区的发送速度更快。

Lower the video quality. This will result in less data to send allowing the 3s buffer to be sent faster.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文