Download Formats
Downloading a video may sometimes be more convenient than streaming it. You may want to support devices that can only handle progressive downloads or you may want to allow your users to download a video so they can also watch it when they don't have access to a (proper) internet connection.
Progressive download
New in version 1.4.35.
Instead of storing an additional copy of the presentation to enable progressive download, you can create an MP4 file on disk that only contains the necessary metadata and references the actual movie data of the original (fragmented) video.
The MP4 file stored on disk will only be around 10K - 100K in size. When requested by the client, the webserver reads this MP4 file and 'expands' it into a single progressive video.
You can create a progressive version by running the following command:
#!/bin/bash
mp4split -o tears-of-steel-avc1-1000k-dref.mp4 --use_dref \
tears-of-steel-avc1-1000k.cmfv
The option --use_dref
stands for 'use as a data reference'. Assuming the
output dref MP4 file of the example above is in the /var/www/video
directory, the URL for the progressive download will be:
http://www.example.com/video/tears-of-steel-avc1-1000k-dref.mp4
.
Storage location of original content and dref MP4
Since the input and output file are in the same directory in the example above, the references to the original content that the dref MP4 file contains, will be relative to its location. Thus, the dref file needs to remain in the same directory as the input file (although this directory doesn't need to be the same as the one in which the dref file was created).
It's also possible to specify an absolute URL (http://
) as the location of
the original content. In that case, the reference that is stored in the dref MP4
file will be absolute and the files can be stored separately (but the location
of the original content cannot change without having to create a new dref MP4).
For more information on storing the original content, manifests or dref files in different locations, see Cloud Storage Reducing Latency.
Force brand of dref MP4
The default major brand that the dref MP4 file uses, depends on the features of the content from which it was generated. The packager defaults to "iso2", but bumps the brand when features require this.
For example, the "iso4" brand is set when negative composition times are used instead of an edit list.
If you don't want to use the "iso4" brand (e.g. because a player framework
doesn't support negative composition times), you can force the brand with the
option --brand=iso2
(which will result in the use of an edit list instead of
negative composition times).
Download to own for HTTP Live Streaming (HLS)
New in version 1.7.25.
The option to download the full video presentation was introduced by Apple as part of version 7 of their HLS protocol. It is a feature that requires the EXT-X-SESSION-KEY to be present in the master playlist. When using FairPlay DRM, Unified Origin adds this key to the master playlist by default. With the key in place, the feature can be implemented on the player side.
Download to own for HTTP Smooth Streaming (HSS)
New in version 1.7.2.
Note
Download to own with Smooth Streaming requires the Apache version of USP Origin.
If a video presentation is protected by PlayReady DRM, it can be made available for download in the "PIFF" (Protected Interchangeable File Format) format.
The option used to enable this feature is the following:
--progressive_playout
Allows the download of the full presentation as a fragmented MP4 file, including all the audio/video tracks. You have to specifically enable this option because the default of the Origin is to disallow downloading the complete presentation as a single file.
As an example we will create a server manifest that includes the information of the audio and video tracks that should be part of the downloaded version. We will also specify which DRM settings to use. The source files in the example are two Tears of Steel tracks: one for audio and one for video.
The URL for progressive playout is .../download.ism/video.ismv
.
#!/bin/bash
KID=10000000100010001000100000000001
CEK=3a2a1b68dd2bd9b2eeb25e84c4776668
KID_UUID=10000000-1000-1000-1000-100000000001 #UUID representation of KID
CEK_B64="OiobaN0r2bLusl6ExHdmaA==" #Base64 byte array representation of CEK
mp4split -o download.ism \
--iss.key_id=$KID \
--iss.content_key=$CEK \
--iss.license_server_url="https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:$KID_UUID,contentkey:$CEK_B64,ckt:aesctr)" \
--progressive_playout \
tears-of-steel-avc1-1000k.ismv \
tears-of-steel-aac-64k.isma
Note
Progressive playout is only supported for (f)mp4 sources. Because it adds some useful features, we recommend to use a dref file when working with download to own, as described below.
Resume and scrubbing features
New in version 1.7.17.
To enable a player to resume download, use HTTP range requests and enable scrubbing features, despite the content of the original media file being encrypted, you can create a dref'd file of the content that you want to offer as download to own. This will enable the player to use the dref file as an index file for the original content. Creating a dref file from the original content is straightforward:
#!/bin/bash
mp4split -o tears-of-steel-avc1-1000k-dref.mp4 --use_dref \
tears-of-steel-avc1-1000k.ismv
Once you have done this you can create the download-to-own manifest by adding the
--progressive_playout
-option in the same way as explained earlier, but now while
using the newly created dref file as the source:
#!/bin/bash
KID=10000000100010001000100000000001
CEK=3a2a1b68dd2bd9b2eeb25e84c4776668
KID_UUID=10000000-1000-1000-1000-100000000001 #UUID representation of KID
CEK_B64="OiobaN0r2bLusl6ExHdmaA==" #Base64 byte array representation of CEK
mp4split -o download.ism \
--iss.key_id=$KID \
--iss.content_key=$CEK \
--iss.license_server_url="https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:$KID_UUID,contentkey:$CEK_B64,ckt:aesctr)" \
--progressive_playout \
tears-of-steel-avc1-1000k-dref.mp4
This will result in the following files:
Streaming format |
Description |
---|---|
download.ism |
The USP server manifest file. |
tears-of-steel-avc1-1000k.ismv |
The video presentation. |
tears-of-steel-avc1-1000k-dref.mp4 |
The dref file of the presentation |
For playout, the following Player URLs can be used:
Streaming format |
URL |
---|---|
HTTP Smooth Streaming |
|
Download-to-own |
Note
The extension of the Download-to-own URL is the same whether or not you work with a dref MP4. The fact that it is ".ismv" tells the USP Origin to serve out the file in the fragmented Smooth Streaming PIFF format.