简体   繁体   English

通过HTTP Live Streaming在iPhone上显示DVR摄像机视频

[英]Show DVR cameras video on iPhone by HTTP Live Streaming

I searching a lot but cant find coding part. 我搜索了很多,但找不到编码部分。 HTTP LIVE VIDEO STREAMING INTRO . HTTP实时视频流介绍

ts文件图像

In this Link i want to know how to make index file and '.ts' file and how to implement in iPhone. 在此链接中,我想知道如何制作索引文件和“ .ts”文件,以及如何在iPhone中实现。 I have done that coding. 我已经完成了编码。

   -(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]; 

 }

but i dont want that. 但是我不想要那个。 I want This 我要这个

在此处输入图片说明

It is really a difficult part first you have to download http live streaming tool from apple developing site. 首先,您必须从Apple开发网站下载http live流工具,这确实是一个困难的部分。 Then it will install some tools you can use media file segmenter to convert mp4 or any video to .ts and .m3u8 file by ( In terminal write-> mediafilesegmenter -t 10 fileName.mp4) that will convert ts file and m3u8 file. 然后它将安装一些工具,您可以使用媒体文件分段器,通过(在终端中的write-> mediafilesegmenter -t 10 fileName.mp4中)将mp4或任何视频转换为.ts和.m3u8文件,这将转换ts文件和m3u8文件。 Then you can use in html and in vlc to check your index file. 然后,您可以在html和vlc中使用它来检查索引文件。 and check out this link 并查看链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM