On-Demand Video Monitoring

Prev Next

Introduction

Catchpoint supports on-demand video monitoring via a Custom Monitor using the HTML5 video player. The video performance metrics are captured with the help of an open-source library called videojs. This setup invokes the Chrome browser using Puppeteer, and then waits for the video to play for a specified time. The maximum video playback time is 90 seconds. The metrics captured include:

  • View Time (seconds): indicates the total time the video was played.
  • Buffering Counter: counts the number of times the onWaiting event was triggered, indicating that video playback stopped.
  • Buffering Time (ms): Sum of all the individual buffering times during video playback. Each buffer time is calculated as the difference between the onWaiting and onPlaying events.
  • Decoded Frame Count: The number of frames of video that were decoded and made available for presentation.
  • Dropped Frame Count: The number of frames of video that were dropped due to performance issues. This does not include (for example) frames dropped due to seeking.

Note: The bandwidth consumed by this test will depend on video resolution, length, and other factors.

Prerequisites

  • Nodejs and npm installed.
  • URL for a video in a supported format (.mp4, .webm, .m4v, .mkv, .mov)

Installation & Configuration

Install Puppeteer

Install Puppeteer using this command:
$ npm i puppeteer

Install Chrome

Although Puppeteer includes Chromium by default, we will install Chrome as it supports a wide range of video formats.

Download and install Chrome using these commands:
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
$ sudo yum install ./google-chrome-stable_current_*.rpm
$ google-chrome -version

Implementation

Place the custom script

  1. Navigate to /opt/3genlabs/hawk/syntheticnode/service/shellmonitor/sandbox

  2. Copy the attached file Ondemand-Video-Monitoring-master.zip to the sandbox directory, then extract its content with this command:
    $ unzip Ondemand-Video-Monitoring-master.zip
    Note: If the unzip command is not installed, enter this command to install it:
    $ yum install unzip

  3. Delete the .zip file after extraction
    $ rm Ondemand-Video-Monitoring-master.zip

  4. Install all the dependencies required to run the custom monitor script.
    $ npm install

  5. Once all the required libraries are installed, run the following commands to change file permissions and owner.
    $ chmod 500 ondemand_video.js
    $ chown serveruser ondemand_video.js
    $ chmod 700 index.html
    $ chown serveruser index.html
    $ chmod 700 Step1_A.png
    $ chown serveruser Step1_A.png
    $ chmod 700 Step1_B.png
    $ chown serveruser Step1_B.png

  6. To link Google Chrome to your puppeteer script, open ondemand_video.js and modify the path underlined in this screenshot:
    Ondemand_1.png

**Create the Custom Test **

Follow these steps to create and configure a Custom Test in Catchpoint Portal which will call the script.

  1. Navigate to Tests and create a Custom Test
    custom.jpg

  2. Input a Name for the test. In the Script field, enter the name of the script file placed in the sandbox folder. In our example it would be “ondemand_video.js”.

jsfile.jpg

  1. Add custom fields to the test as shown in the screenshot below. One will be used for passing the on-demand video URL to the script, and the other for setting the video playback time. The playback time should be between 30,000ms and 90,000ms. Use the same variable names as in the screenshot.
    cust.jpg

  2. The script will require more than the default limit of 30 seconds to finish execution. Under Advanced Settings select Enforce failure if test runs longer than 90 seconds.

etf.jpg

Results

Based on the output that gets printed in the console, you can create Tracepoints and Indicators to capture the metrics and analyse them in the Portal.

Indicator settings in Catchpoint Portal:
Ondemand_5.png

Metrics captured in Catchpoint Portal:
Ondemand_6.png

Please refer to the attachment for the script.

Ondemand-Video-Monitoring-master.zip