[英]Show DVR cameras video on iPhone by HTTP Live Streaming
我搜索了很多,但找不到编码部分。 HTTP实时视频流介绍 。
在此链接中,我想知道如何制作索引文件和“ .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];
}
但是我不想要那个。 我要这个
首先,您必须从Apple开发网站下载http live流工具,这确实是一个困难的部分。 然后它将安装一些工具,您可以使用媒体文件分段器,通过(在终端中的write-> mediafilesegmenter -t 10 fileName.mp4中)将mp4或任何视频转换为.ts和.m3u8文件,这将转换ts文件和m3u8文件。 然后,您可以在html和vlc中使用它来检查索引文件。 并查看此链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.