Skip to main content
March 27, 2014
Question

Video Usage

  • March 27, 2014
  • 2 replies
  • 1074 views

IS there anyway to determine how many times a video has been access in AMS 5? I have looked at the apache log, but a streamed video appears many time for just one playing. Thanks for any help.

    This topic has been closed for replies.

    2 replies

    Adobe Employee
    April 1, 2014

    if you are looking for a solution to rtmp streams then Jim's answer is one of the ways...You can also inspect access log for AMS(not apache) to find put rmtp streams/clients playing a stream.

    Howeever if you want to look for statistics for HDS/HLS streaming(which happens through Apache and its modules) then you will have to look at Apache logs(access logs for Apache)

    April 1, 2014

    Most of my videos are HDS. I looked at the Apache log, but need a little help in parsing the log for multi bit rate streaming. One playing of a video generates many, many entries into the log. For example:

    124......... - - [31/Mar/2014:02:29:22 -0400] "GET /hds-vod/Vogtle_800.f4v.f4m HTTP/1.1" 200 2025

    124......... - - [31/Mar/2014:02:29:22 -0400] "GET /hds-vod/Vogtle_1500.f4v.f4m HTTP/1.1" 200 2028

    124......... - - [31/Mar/2014:02:29:45 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag1 HTTP/1.1" 200 97018

    124......... - - [31/Mar/2014:02:29:46 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag2 HTTP/1.1" 200 161506

    124......... - - [31/Mar/2014:02:29:49 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag3 HTTP/1.1" 200 1040005

    124......... - - [31/Mar/2014:02:29:55 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag4 HTTP/1.1" 200 834187

    124......... - - [31/Mar/2014:02:30:01 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag5 HTTP/1.1" 200 366308

    124......... - - [31/Mar/2014:02:30:03 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag6 HTTP/1.1" 200 401652

    124......... - - [31/Mar/2014:02:30:06 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag7 HTTP/1.1" 200 221894

    124......... - - [31/Mar/2014:02:30:12 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag8 HTTP/1.1" 200 371067

    124......... - - [31/Mar/2014:02:30:14 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag9 HTTP/1.1" 200 506740

    124......... - - [31/Mar/2014:02:30:18 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag10 HTTP/1.1" 200 538230

    124......... - - [31/Mar/2014:02:30:22 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag11 HTTP/1.1" 200 449507

    124......... - - [31/Mar/2014:02:30:28 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag12 HTTP/1.1" 200 321969

    124......... - - [31/Mar/2014:02:30:30 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag13 HTTP/1.1" 200 429534

    124......... - - [31/Mar/2014:02:30:36 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag14 HTTP/1.1" 200 415903

    124......... - - [31/Mar/2014:02:30:38 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag15 HTTP/1.1" 200 533145

    124......... - - [31/Mar/2014:02:30:44 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag16 HTTP/1.1" 200 336615

    124......... - - [31/Mar/2014:02:30:46 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag17 HTTP/1.1" 200 519305

    124......... - - [31/Mar/2014:02:30:50 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag18 HTTP/1.1" 200 533103

    124......... - - [31/Mar/2014:02:30:53 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag19 HTTP/1.1" 200 658543

    124......... - - [31/Mar/2014:02:30:59 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag20 HTTP/1.1" 200 894845

    124......... - - [31/Mar/2014:02:31:06 -0400] "GET /hds-vod/Vogtle_800.f4vSeg1-Frag21 HTTP/1.1" 200 883363

    124......... - - [31/Mar/2014:02:31:11 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag22 HTTP/1.1" 200 363477

    124......... - - [31/Mar/2014:02:31:16 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag23 HTTP/1.1" 200 175650

    124......... - - [31/Mar/2014:02:31:17 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag24 HTTP/1.1" 200 528201

    124......... - - [31/Mar/2014:02:31:22 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag25 HTTP/1.1" 200 454561

    124......... - - [31/Mar/2014:02:31:25 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag26 HTTP/1.1" 200 705040

    124......... - - [31/Mar/2014:02:31:31 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag27 HTTP/1.1" 200 367943

    124......... - - [31/Mar/2014:02:31:34 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag28 HTTP/1.1" 200 139240

    124......... - - [31/Mar/2014:02:31:37 -0400] "GET /hds-vod/Vogtle_300.f4vSeg1-Frag29 HTTP/1.1" 200 773752

    ...

    How can get only the distinct viewing of the video?

    Adobe Employee
    April 2, 2014

    The following line indicates a request for manifest file( .f4m in this case)...There is a single manifest file generated per stream..so this request should tell you the video files being requested.

    124......... - - [31/Mar/2014:02:29:22 -0400] "GET /hds-vod/Vogtle_800.f4v.f4m HTTP/1.1" 200 2025


    BTW on side note, the industry practice is to put a vranish in front of Apache web server and log/account all requests on varnish itself.


    Known Participant
    March 27, 2014

    You can use the server-side scripting API  to increment a counter each time a certain resource is accessed.

    http://help.adobe.com/en_US/adobemediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11aff5ba-7f8bSSASLR.2.3.html

    Or

    http://help.adobe.com/en_US/adobemediaserver/adminapi/WSa4cb07693d12388431df580a12a34991ebc-8000.2.3.html

    Personally, I'd probably not try to handle this through AMS. I'd get and save the number of views to a given resource to a separate database.

    March 31, 2014

    Thanks for your response, but I'm really new at AMS. I can develope in ASP.Net. With that said, can you elaborate in a little more detail how to accomplish this. Perhaps the method name to use or a sample code snippet would be greatly.

    Thanks

    Known Participant
    April 1, 2014

    Sure. It's just javascript.

    If you only have one video in your application:

    var accessCount=0;

    application.onConnect = function (client){

         accessCount++;

    }

    Or if you want to track a specific video:

    var accessCount;

    application.onConnect = function (client,resource){

         accessCount[resource]++;

    }

    where "resource" is a string variable that you pass when the client application connects to the server.

    And if you want to retrieve this number from your client:

    Client.prototype.getMetrics = function(resource){

              return accessCount[resource];

    }

    Or you could even use the File class and write to an exteral file if you wanted.