The E2E sample implements a server-side AD insertion system, which features on-demand video transcoding and streaming, and AD insertion based on video content analysis.
The Content Provider service serves original content, with on-demand transcoding, through the DASH or HLS streaming protocol. The AD Insertion service analyzes video content on the fly and inserts AD, with transcoding if needed, into the video stream at each AD break slot.
The client player is based on dash.js and hls.js.
See additional information on each service:
- The Content Provider service
- The AD Insertion service
- The AD Decision service
- The AD Content service
- The Account service
- The CDN service
- The Video Analytics service
(1) Install docker engine.
(2) Install docker compose, if you plan to deploy through docker compose. Version 1.20+ is required.
(3) Setup docker swarm, if you plan to deploy through docker swarm. See docker swarm setup for additional setup details.
(4) sudo mkdir -p /etc/systemd/system/docker.service.d
(5) printf "[Service]\nEnvironment=\"HTTPS_PROXY=$https_proxy\" \"NO_PROXY=$no_proxy\"\n" | sudo tee /etc/systemd/system/docker.service.d/proxy.conf
(6) sudo systemctl daemon-reload
(7) sudo systemctl restart docker
(1) mkdir build
(2) cd build
(3) cmake ..
(4) make
By default, DASH/HLS segments are generated on the fly during playback, which requires a powerful server platform to keep up with the load. If unsure, it is recommended that you use the following commands to pre-generate DASH/HLS segments:
(5) make dash # take a coffee break?
(6) make hls # take a walk?!
Use the following commands to start/stop services via docker swarm:
(1) make start_docker_swarm
(2) make stop_docker_swarm
Use the following commands to start/stop services via docker-compose:
(1) make start_docker_compose
(2) make stop_docker_compose
Launch your browser and point to https://localhost
to play the streams and see ADs got inserted during playback. Note that if you see a browser warning of self-signed certificate, please accept it to proceed to the sample UI.
Customize the video playlist by adding videos under volume/video/archive or in the build script content-provider/archive/build.sh.
Rerun make
and restart the service after making any changes.