How to Use Http Live Streaming Protocol in iPhone Sdk 3.0

How to use HTTP live stream?

Convert your video to transport stream (.ts) using FFmepg and then use mediafilesegmenter to split the video and create a playlist:

mediafilesegmenter -t 10 myvideo-iphone.ts

This will generate one .ts file for each 10 seconds of the video plus a .m3u8 file pointing to all of them.
See the answer at HTTP LIve Streaming for details.

Live streaming on iPhone

You have to go through HTTP Live streaming document provided by Apple.There are some sample live streaming URLs.The file extension will be .m3u8.If you want to configure your own webwserver , you have to configure FFMPEG server in your webserver.The links which will help you
1)Apple document
2)stackoverflow
3)stackoverflow
4)stackoverflow

HTTP live streaming with ios

I can only comment on pre-recorded video, not live streaming...

Do I have to convert mp4 video to M8U8?

I think you mean .m3u8. Basically, you need to take your .mp4 file and:

  1. Encode it to a friendly bitrate for mobile bandwidths. You can use Apple's Compressor* app for this, it has presets for HTTP Live Streaming. Pick something around 1000kbps if you're playing around.

  2. Slice it up the output using Apple's mediafilesegmenter. You'll end up with lots of small .ts files and a manifest (.m3u8) which lists them.

  3. Hit the .m3u8 file in your player (initWithContentURL...) and you're off.

  4. Repeat steps 1 and 2 above and specify differing bandwidths. We went for the presets in Compressor.

  5. You'll end up with different versions of your video, 1 for each bandwidth, use the variantplaylistcreator tool from Apple to create a master playlist file which will point your player to each bandwidth so it can switch automatically.

  6. Stick all your .ts files and .m3u8 files on the net and use the mediastreamvalidator tool to check your master playlist file is ok and points to each version correctly.

Make sure a decent quality bitrate is first in the master playlist file as this is the version that's played first. We went for something around the 1000kbps mark.

Do I have to use MPMoviePlayer?

I can't comment on other libraries, we used MPMoviePlayer.

Can I convert mp4 video to M8U8 format during run-time and how to implement live streaming

You can for live streams but for pre-recorded video do it all before. Put all your files online, validate your playlist (.m3u8) and play your videos using the master .m3u8 file.

Is there any example code available for HTTP live streaming?

In our implementation the client in iOS does all the work (e.g. switching streams depending on the available bandwidth). As such you just need to make sure all your files are in the right place before hand.

Compressor - https://www.apple.com/final-cut-pro/compressor/
The mediafilesegmenter and mediastreamvalidator tools command lines tools available to download from the Apple developer network site.

These articles have everything you need to know:
https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html
https://developer.apple.com/library/archive/technotes/tn2288/_index.html#//apple_ref/doc/uid/DTS40012238

Open this up in Safari:
https://developer.apple.com/streaming/examples/advanced-stream.html - Each 'Gear' is a different bitrate stream

Crack open this .m3u8 file in a text editor for an example master playlist file: https://devimages.apple.com.edgekey.net/resources/http-streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8

Is it necessary to provide Audio-only stream when I use HLS(Http live streaming)?

Apple basically moved the answer to that into the linked Technical Note TN2224.

If your app uses HTTP Live Streaming over cellular networks, you are required to provide at least one stream at 192 kb/s or lower bandwidth. The low-bandwidth stream may be audio-only, or audio with a still image, but you should strive to have video in your 192kbps stream.

You should be fine now if your lowest stream is according to their restrictions and it must no longer be audio-only.



Related Topics



Leave a reply



Submit