Join Lisa Larson-Kelley for an in-depth discussion in this video Publishing multi-bitrate on-demand streams via HDS, part of Up and Running with Flash Media Server 4.5 .
HTTP Dynamic Streaming or HDS is an efficient way to get on-demand video to a wide audience, including mobile devices that run Flash Player, while still ensuring that they get the right bitrate stream for their connection speed. This can be especially useful for devices as they're often on unreliable Internet connections. In this chapter, we'll create a multi- bitrate playlist to take advantage of this useful feature. The file format for HDS multi-bitrate playlists is different from the format that we used for RTMP. Because of this, Adobe has included a tool that helps you create these manifest files.
This tool is called the Set Level Manifest Generator. It has a cryptic name, but what it does is create multi-bitrate playlists in a new format referred to as a Set Level Manifest. In the past if you had content encoded at various bitrate that you wanted to use for dynamic streaming, you would create a single manifest file that contained all of the data needed for playback of each of the streams and this was a lot of data. Now with new Set Level Manifest support, you can separate that stream manifest data from the playlist itself.
Set Level Manifest contains only the URLs that point to the manifest for each video stream. This way the Set Level Manifest can be hosted in one place and the individual stream manifest can be hosted somewhere else, such as a CDN or other remote server. So let's go ahead and create a Set Level Manifest using the tool that Adobe has provided. We'll find it in the Flash Media Server folder. Adobe>Flash Media Server, inside of tools, and it's in the folder called f4mconfig and then inside of that is configurator, and we want to open up the HTML document, and we'll just double- click on it and it'll open in our browser.
Using this tool, you can add streams to a multi-bitrate playlist and then save it out in the proper format for HDS streaming. You can then play that file in an OSMF based videoPlayer and you'll have a video that uses dynamic streaming to deliver an optimized video bitrate over standard HTTP connections. You can also choose the m3u8 tab to configure multi-bitrate playlists for streaming to Apple iOS devices. Let's see how this tool works for f4m. First, we will enter our stream names one at a time into the Stream URI field along with their bitrate.
So our streams will be stored on local host of course, and they're actually going to be in the webroot vod folder, but because they're being packaged in real-time for HDS delivery, we refer to the hds-vod folder, and then the file name, explore02_, and our first bitrate is 500kbps.f4v, and then we tag on f4m at the end, so that it grabs the manifest for that file.
I am going to copy that, because I want to repeat it three times, and the bitrate is 500, so we can add that one to our playlist. Okay, now we'll change the bitrate for this file to 1000, add that to the playlist, and our final stream will be 1500, and add that one to the playlist. Okay, we can now save this manifest, and we'll call it explore-hds.f4m, and I am saving it here in my Exercise Files folder along with our videos, and I've included a final version of this manifest file, so that you can compare it with yours.
So we'll go ahead and Save that there and now we are done with this tool, so we'll close this. And we go to our Exercise Files, and inside this lesson, here we have are f4m file and our three videos. So we'll select them all, all four items, Copy them. These are all going to the same place, the vod folder. So let's navigate there inside of Flash Media Server>webroot>vod, and we can Paste them here and confirm.
We are now ready to play this HDS file in our sample videoPlayer. So let's navigate to that inside of Flash Media Server>samples>videoPlayer and we just want to point to that new file that we just created on localhost/hds-vod/explore-hds.f4m, and that completes our address.
Then go over here, click Play Stream, and this should play perfectly. (Tom Mueller: Welcome to this week's episode of Explore California. I'm your host,) (Tom Mueller, and this week--) So our player is detecting my bandwidth and choosing the right bitrate stream for my connection speed, which is pretty fast, since everything is running locally here and it converts that on-the- fly into an HDS stream, and then starts sending me the fragments and playing the video. So you are now familiar with the process of setting up multi-bitrate streams for delivery of on-demand over HDS.
- Why use Flash Media Server?
- Choosing a delivery protocol
- Understanding codecs
- Installing and testing Flash Media Server
- Streaming on-demand and live video with RTMP and HDS
- Writing and testing custom server-side applications
- Publishing multi-bitrate streams
- Streaming live video to devices with HLS