如何流式传输视频并进行播放? [英] How do I stream video and play it?

查看:782
本文介绍了如何流式传输视频并进行播放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从网络流式传输视频数据并在iPhone上播放?

How can I stream video data from the network and play it on an iPhone?

推荐答案

首先,您正在开发一个针对iPhone或本机应用程序优化的Web应用程序?

First, are you developing a Web app optimized for iPhone or a native application ?

在第一种情况下,您唯一的选择是将视频文件转码为Quicktime H.264(m4v或mp4扩展名)。您可以使用Quicktime Pro(使用导出菜单)或VLC(作为免费替代)。然后只需在HTTP服务器上添加一个指向视频文件的超链接。确保它显示正确的内容类型和内容(阅读适用于iPhone OS的Safari Web内容指南:配置您的服务器)。这适用于Web和本机应用程序(在本机应用程序中,您将使用MPMoviePlayerController视图)。因此可以流式传输(技术上称为Quicktime电影文件的渐进式下载)。

In the first case, your only option is to transcode your video files to Quicktime H.264 (m4v or mp4 extension). You can use Quicktime Pro (use the export menu) or VLC (as a free alternative). Then simply add a hyperlink to the video file on your HTTP server. Make sure it presents the right content-type and stuff (read Safari Web Content Guide for iPhone OS: Configuring Your Server). That'll work for web and native apps (in a native app you would use the MPMoviePlayerController view). So can "stream" (technically called progressive download of a Quicktime movie file).

如果您正在谈论流媒体直播内容(即您实时或转码生成的内容)现场直播)目前还没有官方的方式(从iPhone OS 2.2开始)。 iPhone OS不支持RTSP / RTP流媒体。许多原生iPhone应用程序(例如UStream.tv和Orb Live)已经创建了他们的自定义直播流解决方案(大多数都通过HTTP传输延迟流,延迟时间为几秒,然后使用FFmpeg或其他库以某种方式在手机上对其进行解码)。

If you're talking about streaming live content (i.e. content that you produce live or transcode a live feed) there is currently no official way of doing it (as of iPhone OS 2.2). iPhone OS does not support RTSP/RTP streaming. A number of native iPhone applications (such as UStream.tv and Orb Live) have created their custom live streaming solution (most of them transfer a delayed streams with many seconds of latency over HTTP then somehow decode it on the phone using FFmpeg or other libraries).

这篇关于如何流式传输视频并进行播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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