在观看时记录HTTP直播视频到文件? [英] Record HTTP Live Streaming Video To File While Watching?

查看:127
本文介绍了在观看时记录HTTP直播视频到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我正在开发的应用中创建流媒体视频DVR功能。我有一个HTTP Live Stream,我已成功在iPad上播放。我希望用户能够按下录制按钮,并开始录制当前正在播放的视频。可以从应用程序或相机胶卷访问此视频文件。目前,我正在使用MPMoviePlayerController对象来播放视频流。我没有看到任何从Apple文档中的对象访问数据的方法。以下是我对如何解决此问题的一些想法。

I am trying to create a streaming video DVR like functionality in an app I am developing. I have an HTTP Live Stream that I have successfully gotten to play on the iPad. I want the user to be able to push the "Record" button, and begin recording the video that is currently playing from that point. This video file will be accessible from the app or from the camera roll. Currently, I am using the MPMoviePlayerController object to play the video stream. I do not see any methods of accessing the data from the object in Apple's documentation. Here are some thoughts I had on ways of going about this.

1)以某种方式从MPMoviePlayerController访问视频数据,并将其写入文件。或者使用其他类型的播放器对象,这将允许我播放视频并访问当前播放的数据。

1) Somehow access the video data from MPMoviePlayerController, and write this to a file. Or use another type of player object that will allow me to play the video and access the currently playing data.

2)实现某种获取视频的屏幕截图录制捕获iPad的屏幕。这将允许我以屏幕截图的方式录制视频。

2) Implement some sort of screen capture recording that gets a video capture of the iPad's screen. This would allow me to record the video in a "screenshot" sort of way.

3)找到MPMoviePlayerController存储它们的HTTP直播视频片段。据推测,他们需要存放在iPad上的某个地方进行播放。有没有办法访问这些文件?

3) Locate the HTTP Live Streaming video segments where they are stored by MPMoviePlayerController. Presumably they need to be stored somewhere on the iPad for playback. Is there a way of accessing these files?

4)在流式传输文件时,通过http手动下载流视频片段。这似乎不太理想,因为流必须下载两次。

4) Manually download the stream video segments over http while streaming the file. This seems like its not ideal since the stream would have to be downloaded twice.

5)这可能有效。定期将视频片段下载到iPhone。在iPhone上设置本地http服务器并将视频服务器提供给MPMoviePlayerController。通过这种方式,可以将视频片段标记为录制并组合成视频。

5) This could work. Periodically download the video segments to the iPhone. Set up a local http server on the iPhone and server the videos to the MPMoviePlayerController. This way the video segments could be marked for recording and assembled into a video.

6)我确实可以控制流媒体服务器。我可以编写一些服务器端代码来记录服务器端的视频,然后将视频发送到iPad。我宁愿不这样做。

6) I do have control of the streaming server. I could write some server side code to record the video on the server end, then send the video to the iPad after the fact. I would rather not do this.

有没有人做过这些事情?理想情况下,iPhone只能以某种方式访问​​视频数据并轻松记录。如果我不需要,我宁愿不进入选项4,5或6(上面)。

Has anyone done any of these things? Ideally the iPhone would just be able to access the video data somehow and easily record it. I would rather not get into options 4, 5, or 6 (above) if I don't have to.

提前致谢。

推荐答案

由于可用空间有限以及电池寿命,处理能力,用户停止后的清理程序等其他因素,设备上的DVR有些不受鼓励dvr等。

DVR on the device is somewhat not encouraged, due to the limited space available and other factors like battery life, processing power, cleanup procedures after the user stops the dvr, etc.

如果你想在iOS设备(或使用HLS的其他设备)上实现DVR播放,我建议你保留视频服务器端。已经捕获了实时流并对服务器端进行了分段,所有您需要做的就是将段保持更长时间,而不是删除它们。使用 EXT-X-PLAYLIST- TYPE EXT-X -MEDIA-SEQUENCE 标签,你可以向玩家建议他正在打开一个有DVR(早期)视频的直播视频。

If you want to achieve DVR playback on iOS devices (or other devices using HLS), I suggest you keep the video server side. The live stream is already captured and segmented server side, all you would have to do is keep the segments a bit longer, instead of deleting them. By using the EXT-X-PLAYLIST-TYPE and EXT-X-MEDIA-SEQUENCE tags, you can suggest to the player that he's opening a live stream which has DVR (earlier) video available.

或者,你可以使用开箱即用的服务器,例如Wowza。 这是一篇关于如何通过Wowza实现这一目标的文章

Alternatively, you can use a server that does that out of the box, for example Wowza. Here's an article on how to achieve this with Wowza

这篇关于在观看时记录HTTP直播视频到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆