Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stream video and play it?

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

like image 811
Neo Avatar asked Jan 21 '09 10:01

Neo


1 Answers

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

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).

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).

like image 50
François P. Avatar answered Oct 14 '22 03:10

François P.