Demos

Table of Contents

Hands-on

The following demo is based on Your own Video on Demand demo. Getting a working VOD2Live stream up and running using this hands-on requires a few things:

  • A license key that includes VOD2Live, which can be obtained after registration
  • A working copy of Docker, installed on the system that will act as the host for this hands-on
  • Internet access on host through ports 53 and 80; needed to check license key

Downloading VOD demo content

For the demo content, download below file:

http://repository.unified-streaming.com/tears-of-steel.zip

After you have downloaded the file, extract it to a directory with the name tears-of-steel.

You should now have a directory called tears-of-steel, which contains the demo files (see Verify Your Setup for an overview of the media content).

Store SMIL playlist inside directory with the VOD demo content

To create a VOD2Live you'll need a playlist. For the purpose of this hands-on, you can use the playlist below, which you'll need to download vod2live_hands_on.smil to the tears-of-steel directory that the VOD demo content resides in:

<?xml version="1.0" encoding="UTF-8"?>
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
  <head>
  </head>
  <body>
    <seq>
      <par>
        <video src="tears-of-steel-avc1-1000k.mp4" />
        <video src="tears-of-steel-avc1-1500k.mp4" />
        <video src="tears-of-steel-avc1-750k.mp4" />
        <video src="tears-of-steel-avc1-400k.mp4" />
        <video src="tears-of-steel-aac-128k.mp4" />
        <video src="tears-of-steel-aac-64k.mp4" />
        <video src="tears-of-steel-en.cmft" />
        <video src="tears-of-steel-zh-hans.cmft" />
      </par>
    </seq>
  </body>
</smil>

Note

Make sure the name of SMIL playlist file as stored in your tears-of-steel directory is vod2live_hands_on.smil.

Running the demo using Docker

Now that all the prerequisites to run your own VOD2Live stream are in place, the last thing you need to do is running the commands to:

  • Process SMIL playlist with Unified Remix
  • Create VOD2Live enabled Live server manifest with mp4split
  • Spin up a container running Unified Origin to serve VOD2Live stream

To do this, you'll need to:

  • Download vod2live_hands_on.sh to your tears-of-steel directory
  • Run chmod +x vod2live_hands_on.sh in your shell to make it executable
  • Store your USP license key to an environment variable using export USP_LICENSE_KEY=<your-actual-license-key>
  • And, finally: run ./vod2live_hands_on.sh to actually execute the script
#!/bin/bash

# Process SMIL playlist with Unified Remix
docker run --rm --entrypoint unified_remix \
  -v ${PWD}:/var/www/unified-origin \
  -w /var/www/unified-origin \
  unifiedstreaming/packager:1.11.0 \
  --license-key=${USP_LICENSE_KEY} \
  -o remixed.mp4 vod2live_hands_on.smil

if [ $? != 0 ];
then
    echo "Processing of SMIL did not succeed, exiting script."
    exit 1
fi

# Create VOD2Live enabled Live server manifest with mp4split
docker run --rm --entrypoint mp4split \
  -v ${PWD}:/var/www/unified-origin \
  -w /var/www/unified-origin \
  unifiedstreaming/packager:1.11.0 \
  --license-key=${USP_LICENSE_KEY} \
  -o vod2live.isml \
  --vod2live \
  --dvr_window_length=600 \
  --hls.client_manifest_version=4 \
  --hls.no_multiplex \
  remixed.mp4

if [ $? != 0 ];
then
    echo "Creation of Live server manifest did not succeed, exiting script."
    exit 2
fi

# Spin up a container running Unified Origin to serve VOD2Live stream
docker run --rm -d -e USP_LICENSE_KEY \
  -v ${PWD}:/var/www/unified-origin -p ${DOCKER_HOST_PORT:-80}:80 \
  unifiedstreaming/origin:1.11.0

if [ $? == 0 ];
then
    echo "Locally available URL of DASH stream: localhost:${DOCKER_HOST_PORT:-80}/vod2live.isml/.mpd"
    echo "Locally available URL of HLS stream: localhost:${DOCKER_HOST_PORT:-80}/vod2live.isml/.m3u8"
    exit 0
else
    echo "Something went wrong spinning up container running Unified Origin, exiting script."
    exit 3
fi

Now, all you have to do is opening the following URL in your browser to play the VOD2Live stream that you have just set up:

http://localhost/?http://localhost/vod2live.isml/.mpd

Note

Please use a localhost port that is available on your host. The default in the script above is 80, but if you need to adjust that you can do so by setting the DOCKER_HOST_PORT variable to a value of your choice before running the script, e.g., export DOCKER_HOST_PORT=8080.