【问题标题】:Show DVR cameras video on iPhone by HTTP Live Streaming通过 HTTP Live Streaming 在 iPhone 上显示 DVR 摄像机视频
【发布时间】:2012-08-10 19:01:51
【问题描述】:

我搜索了很多,但找不到编码部分。 HTTP LIVE VIDEO STREAMING INTRO

在此链接中,我想知道如何制作索引文件和“.ts”文件以及如何在 iPhone 中实现。我已经完成了编码。

   -(void)replayVedio
{
         NSURL *url = [NSURL URLWithString:@"http://www.cwtmedia.se/cwtiphone/cwtvideo.mp4"];
    moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
    [moviePlayer setControlStyle:MPMovieControlStyleDefault];
    moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
    CGRect frame;
    if(self.interfaceOrientation ==UIInterfaceOrientationPortrait)
        frame = CGRectMake(0, 0, 320,400);
    //    else if(self.interfaceOrientation ==UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation ==UIInterfaceOrientationLandscapeRight)
    //        frame = CGRectMake(0,0, 210, 170);
    [moviePlayer.view setFrame:frame];  // player's frame must match parent's
    [self.view addSubview: moviePlayer.view];
    [self.view bringSubviewToFront:moviePlayer.view];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(moviePlayBackDidFinish:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:moviePlayer];


    [moviePlayer prepareToPlay];
    [moviePlayer play]; 

 }

但我不想那样。我要这个

【问题讨论】:

    标签: iphone ios media-player http-live-streaming


    【解决方案1】:

    这确实是一个困难的部分,首先你必须从苹果开发网站下载http直播工具。然后它将安装一些工具,您可以使用媒体文件分段器将 mp4 或任何视频转换为 .ts 和 .m3u8 文件(在终端写入-> mediafilesegmenter -t 10 fileName.mp4),这些工具将转换 ts 文件和 m3u8 文件。然后您可以在 html 和 vlc 中使用来检查您的索引文件。并查看this链接

    【讨论】:

      猜你喜欢
      • 2012-08-11
      • 2011-02-12
      • 2011-01-31
      • 2013-07-31
      • 1970-01-01
      • 1970-01-01
      • 2013-07-16
      • 2016-06-01
      • 1970-01-01
      相关资源
      最近更新 更多