【问题标题】:HTTP Live Streaming of static file to iOS device静态文件的 HTTP 实时流式传输到 iOS 设备
【发布时间】:2012-03-01 11:10:03
【问题描述】:

我正在尝试了解 HTTP Live Streaming 将静态视频文件传输到 iOS 设备的“分块”方面。 视频文件的分块发生在哪里?

编辑:通过阅读HTTP LIve Streaming 和更多https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-07,听起来视频文件在服务器上被拆分为 .ts 段。或者 m3u8 播放列表可以在文件中指定字节偏移量(显然使用EXT-X-BYTERANGE)。

这是我在阅读Apple's HLS descriptionhttps://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-07后对这个过程的理解:

  • 我的服务器上有一个静态文件。它具有正确的音频/视频编码(H.264 和 AAC)。
  • 我会将m3u8 播放列表传递给我应用中的媒体播放器(MPMoviePlayer 或类似的)。
  • 应用程序将在媒体播放期间“重新加载索引”。换句话说,该应用将请求播放其他片段。
  • 每 10 秒的片段位于 MPEG Transport Stream 容器中。

我对这个过程的理解是不完整的(而且可能是不正确的)。非常感谢任何其他信息。

【问题讨论】:

    标签: mpmovieplayercontroller http-live-streaming chunked http-chunked streaming-video


    【解决方案1】:

    你要什么??信息??? - 应用程序不是重新加载索引而是播放它...使用切换正确编码文件的 M3U8 文件。这样,您只需要在 mediaPlayer 和“清单文件”之间建立连接...

    NSURL    *fileURL    =   [NSURL URLWithString:@"http://techxvweb.fr/html5/AppleOutput/2012-03-10-j23-dax-smr-mt1-m3u8-aapl.ism/manifest(format=m3u8-aapl)"];
    moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
    /* Inset the movie frame in the parent view frame. */
    CGRect viewInsetRect = CGRectInset ([self.view bounds],0.0, 0.0 );
    [[moviePlayerController view] setFrame: viewInsetRect ];
    [self.view addSubview:moviePlayerController.view];
    [moviePlayerController play];
    

    其中 NSUrl 是 manifestFile 的 url...请注意,我正在添加:

    /manifest(format=m3u8-aapl)

    到原始清单文件,将“ISM”文件解析为正确的 M3U8 语法

       NSURL    *fileURL    =   [NSURL URLWithString:@"http://techxvweb.fr/html5/AppleOutput/2012-03-10-j23-dax-smr-mt1-m3u8-aapl.ism/manifest(format=m3u8-aapl)"]; 
    

    【讨论】:

    • 您遇到过网速慢的问题吗?我也在做同样的事情,但视频无法在不良网络 (2G) 上播放,但音频仍在继续。请帮忙...
    • 我认为 Edge 不足以播放您的视频,您可能应该生成一个质量非常低的输出来支持它
    猜你喜欢
    • 2013-06-29
    • 1970-01-01
    • 2017-01-25
    • 1970-01-01
    • 2013-04-15
    • 1970-01-01
    • 1970-01-01
    • 2014-06-15
    • 2015-10-08
    相关资源
    最近更新 更多