Cloud Storage
New in version 1.4.33.
It is possible to host the manifest in various ways:
local manifest and local content
local manifest and remote content
remote manifest and remote content
The following sections outline how to setup the second and third options. (As the first option is outlined in Block Storage).
You will also see that the 'data reference' (dref) mp4 used, for example, for progressive download can be hosted similarly.
The following examples use the EC2/S3 combination, but any storage supporting HTTP range request can be used. Below the use of Amazon S3, Azure Storage, GCE, Scality or HCP is outlined as well as an outline on how to optimise performance.
Local manifests
Store your video files on any storage server that supports HTTP range requests. The USP webserver module requests only the necessary data from the storage server to serve the request. This makes it possible to use for example an EC2/S3 combination or access your storage server over HTTP instead of using mount points.
The request flow:
[origin] <-- client request
[storage] <-- video.ism
video1.cmfv
video1.cmfv
audio1.cmfa
The information of where the audio and video files are stored is specified in the server manifest file. Using MP4Split you can generate the server manifest file with the files stored on e.g. an S3 storage account. Using our S3 account 'unified-streaming' as an example we have the following three files:
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-avc1-400k.cmfv
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-avc1-1000k.cmfv
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-avc1-1500k.cmfv
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-aac-64k.cmfa
The previous URLs are passed to MP4Split as input to generate the server manifest file.
#!/bin/bash
mp4split -o tears-of-steel.ism \
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-avc1-400k.cmfv \
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-avc1-1000k.cmfv \
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-avc1-1500k.cmfv \
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-aac-64k.cmfa
If you open the server manifest file, you'll see that the audio and video sources now point to the files at S3:
<audio src="http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-aac-64k.cmfa" systemBitrate="64000" systemLanguage="eng">
Local mp4
Store the .cmfv file on the HTTP storage (e.g. S3) and generate the dref mp4 locally:
#!/bin/bash
mp4split -o tears-of-steel.mp4 --use_dref \
http://your-bucket.s3.amazonaws.com/tears-of-steel/tears-of-steel-avc1-400k.cmfv
Request the MP4 video from the webserver with:
http://www.your-webserver.com/tears-of-steel.mp4
Note that there is no need for a server manifest file in this case, nor setting
up any additional proxying (ProxyPass
) statements.
It is possible to store 'full URLs' as a reference in the MP4, where as before it could only reference files relative to the stored MP4.
Remote manifests
Alternatively, you can store everyting in the S3 bucket. For an complete example configuration file, please see Example configuration.
To do so you will need to set up IsmProxyPass
and you can have better
performance with Apache by enabling subrequests with the UspEnableSubreq
directive .
GET
[storage] <-- [origin] <-- client request
video.ism
video1.cmfv
video1.cmfv
audio1.cmfa
This configuration will tell the webserver that the content should be read from S3 instead of from local disk.
Both fragment mp4 or mp4 can be used as source. An example below.
The first step then is to create a server manifest:
#!/bin/bash
mp4split -o tears-of-steel.ism \
tears-of-steel-avc1-400k.cmfv \
tears-of-steel-avc1-750k.cmfv \
tears-of-steel-aac-64k.cmfa
Then upload the files to your S3 bucket.
To stream this you need to setup and enable UspEnableSubreq
in the
virtualhost in a <Location>
and add IsmProxyPass
in a <Directory>
:
<Location "/">
UspHandleIsm on
UspEnableSubreq on
</Location>
<Location "/your-bucket">
IsmProxyPass http://your-bucket.s3.amazonaws.com/
</Location>
Note
Here we are using two locations, but if you are not using different buckets you may also merge the two as shown in Adding UspEnableSubreq directives.
We recommend adding <Proxy>
sections for target URLs to optimize performance
(on requesting media from the remote object storage), an example with AWS S3:
<Proxy "http://your-bucket.s3.amazonaws.com/">
ProxySet connectiontimeout=5 enablereuse=on keepalive=on retry=0 timeout=30 ttl=300
</Proxy>
With this setting you can stream the S3 based content. An example:
http://demo.unified-streaming.com/your-bucket/tears-of-steel/tears-of-steel.ism/.mpd
The origin will make the mapping from request to S3 via the virtual path,
your-bucket
in the above example (but other names could equally be
chosen).
The S3 bucket will contain tears-of-steel/tears-of-steel.ism
which the
origin then uses to create the DASH manifest, the MPD.
Remote MP4
Using IsmProxyPass
it is possible to store the dref mp4 in your HTTP
storage (for instance S3).
Generate the dref mp4 locally and then store it in the 'your-bucket' bucket in S3:
#!/bin/bash
mp4split -o tears-of-steel.mp4 --use_dref \
tears-of-steel-avc1-400k.cmfv
# copy tears-of-steel.mp4 to http://your-bucket.s3-eu-west-1.amazonaws.com/
To stream the MP4 you need to setup and enable IsmProxyPass
in the
virtual host. You can have better performance with Apache by enabling
subrequests with the UspEnableSubreq
directive .
<Location "/">
UspHandleIsm on
UspEnableSubreq on
</Location>
<Location "/your-bucket">
IsmProxyPass http://your-bucket.s3.amazonaws.com/
</Location>
We recommend adding <Proxy>
sections for target URLs to optimize
performance:
<Proxy "http://your-bucket.s3.amazonaws.com/">
ProxySet connectiontimeout=5 enablereuse=on keepalive=on retry=0 timeout=30 ttl=300
</Proxy>
Request the MP4 video from the webserver with:
http://www.your-webserver.com/your-bucket/tears-of-steel.mp4