Sorry, you need to enable JavaScript to visit this website.

Build and Run the AD Insertion Sample on public cloud or local machine

The latest version of this document and other AD Insertion Sample documents can be found at the Github Wiki.

The Open Visual Cloud is highly optimized for the latest Intel® Xeon® Scalable Processors. Developers can use their own x86 development system to build, customize, and evaluate Open Visual Cloud reference pipelines, or use a public cloud to assess system scalability and performance.

This tutorial builds and runs the AD Insertion Sample on the Amazon Web Services (AWS), Azure Virtual Machine and Google Cloud Platform Virtual Machine (GCP) or your local machine. The following figures show the running compute instances of the 3 cloud services.

AWS EC2 Instance, Amazon Linux 2

Azure VM Instance, Ubuntu 16.04 LTS

Google Cloud Platform VM instance, Ubuntu 16.04 LTS

Unless specifically specified, all the commands in the tutorial apply to all the 3 cloud services.

1. Prerequisites

For AWS, run the following commands to install the software packages required to build the sample:

$ sudo yum update –y

$ sudo amazon-linux-extras install –y docker

$ sudo service docker start

$ sudo yum install –y cmake git
For Azure and GCP, follow to install docker.ce.
Run the following command to install cmake and git

$ sudo apt-get install –y cmake git

Initialize docker swarm as we will use docker swarm for deployment.
$ sudo docker swarm init
Swarm initialized: current node (04k9ydxpdtx40nym8ag2j499r) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-2jthey7uay7ym5ko1db4etp9lt5sjmi8u4qhkv4owe1ysip943-5novs363q4nby8kgaek8ury6i

2. Clone the Sample Source Code

Run the following command to clone the AD Insertion Sample source code:
$ git clone

3. Build the Sample

Run the following commands to build the AD Insertion Sample. The build time is about 2 hours on t2.large. 
$ cd AD-Insertion-Sample
$ mkdir build
$ cd build
$ cmake ..
This script will build third party components licensed under various open source licenses into your container images. 
The terms under which those components may be used and distributed can be found with the license document that is 
provided with those components. Please familiarize yourself with those terms to ensure your distribution of those 
components complies with the terms of those licenses.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ec2-user/ad-insertion-aws/ad-insertion/build

$ make
Scanning dependencies of target build_docker_compose
Sending build context to Docker daemon  30.21kB
Successfully built b82eefa9409f
Successfully tagged ssai_cdn_service:latest
Built target build_ssai_cdn_service
The following images are built. The images with tag “build” are not used in the deployment. 

4. Start the Sample Service

Now, it is time to start the sample service:

$ make start_docker_swarm

Total reclaimed space: 0B
Total reclaimed space: 0B
bash into new container...ssai_self_certificate
Creating network adinsert_default
Creating secret adinsert_self_key
Creating secret adinsert_self_crt
Creating secret adinsert_dhparam_pem
Creating service adinsert_zookeeper
Creating service adinsert_video-analytic-gstreamer
Creating service adinsert_database
Creating service adinsert_ad-decision
Creating service adinsert_content-provider
Creating service adinsert_video-analytic-ffmpeg
Creating service adinsert_kafka-init
Creating service adinsert_kafka
Creating service adinsert_ad-insertion-frontend
Creating service adinsert_account-service
Creating service adinsert_ad-content
Creating service adinsert_content-provider-transcode
Creating service adinsert_analytic-db
Creating service adinsert_ad-transcode
Creating service adinsert_cdn
Built target start_docker_swarm


5. Test the Sample

The AD Insertion Sample exposes a web interface at port 443. We need to create a SSH tunnel to access it, as follows:


$ ssh -L 8443:localhost:443 -Nf -i "keypair.pem" ec2-user@

The SSH tunnel maps localhost port 443 to the AWS EC2 instance port 443, and “keypair.pem” is the ssh access key pair generated for accessing the AWS EC2 instance.
Open your browser to https://localhost:8443 and accept the self-signed certificate to proceed to the sample UI. 

For Azure or GCP

For Azure or GCP, the command is almost the same.

$ ssh -L 8443:localhost:443 -Nf -i ssh_private_key user_name@instance_public_ip

ssh_private_key is ssh access private key for accessing Azure or GCP VM instances.

Open your browser to https://localhost:8443 and accept the self-signed certificate to proceed to the sample UI. 

Optionally, click the user name to change the sample settings, such as turning on the analytics console to peek into service-side activities. 

The analytics console will show the analytic data as an overlay on top of the video playback window, and the server workload will show the CPU utilization at the bottom right corner.