HTTP实时流式传输静态文件到iOS设备

时间:2012-02-08 23:19:21

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

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

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

以下是我在阅读Apple's HLS descriptionhttp://tools.ietf.org/html/draft-pantos-http-live-streaming-07后对此过程的理解:

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

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

1 个答案:

答案 0 :(得分: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 ...请注意我正在添加:

<强> /清单(格式= M3U8-Apple)

到原始清单文件,将“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)"];