Ponderings, insights and industry updates

Video streaming analysis with CMCD

June 9, 2022

Author: David Sztykman |

Tags: , , , , , ,

In this blog post we are going to see how we can leverage a new feature to extract CMCD information from Akamai realtime logs delivery.

The Common Media Client Data specification allows Media player clients to convey information to Content Delivery Networks (CDNs) with each object request.
This information is often useful in log analysis, QoS monitoring and delivery optimisation.
Session identification allows thousands of individual server log lines to be interpreted as a single user session, leading to a clearer picture of end-user quality of service.

Getting CMCD Data

CMCD information needs to be delivered to the CDN (and then to Hydrolix) for that, the video player needs to enable beaconing of information into the video fragment.
Akamai provides a player example here.

For this blog post we are using the Akamai Media Player and some sample stream where we have enabled DataStreamV2 to send data back to Hydrolix see the previous blog post – index and enrich Akamai logs in realtime for the setup.

The player is sending the CMCD data as part of the query parameter for the video fragment.
Here’s an example of such HTTP request generated:

The logs generated by Akamai contain a field called queryStr which is a full query string called CMCD including all the parameters.
So in our case something like that:

As you can see the information is URLEncoded and not very user friendly.

Extracting CMCD information

The CMCD specification defines all the keys and values we should expect.

For example:

Leveraging Hydrolix new realtime enrichment at ingest we are going to write a SQL statement which will extract the CMCD information.

The SQL statement need to get the queryString, URLDecode it, extract all the key/value after CMCD=.
Once we have those key/value we need to replace the key name with a proper definition and then either just put the value or transform the value based on the specification.

I can run this example on the queryString:

Functions to the rescue

Now we have an array of CMCD data it requires some custom functions to do this efficiently. Fortunately Hydrolix allows users to create and define custom functions on the platform, see the dictionaries user defined functions in our docs for more information.

We’ll use 4 different functions:

The first function cmcd_query_param takes 2 parameters, a key name and the array. It will match the name of the key in the array and then get the value right next in the array.

For example:

Additional functions like cmcd_object_type will match the value and replace it with the proper information based on the CMCD specification. For example we have ot=a which will need to be replaced by the value audio_only.

For example:

The final query extracting all the CMCD information is as follows:

Tie it all together

IIn the previous blog post Index and enrich Akamai logs in realtime we have already already shown how to extract and enriching logs using breadcrumbs.

Using the previous we can augment it with the CMCD information:

Akamai Transform with breadcrumbs and CMCD extract

Our transform now contain a SQL query which extracts breadcrumbs, CMCD information and index all the information.

Here’s an example of data generated by Hydrolix from Akamai logs:

As you can see we have a very full pictures of the streaming session for this users, from a CDN point of view and also from a content QoS perspective!

Share Now