8 Replies Latest reply: Apr 2, 2014 4:44 AM by hparmar RSS

    Video Usage

    FreddyNuke Community Member

      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.

        • 1. Re: Video Usage
          jim_houseman Community Member

          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-7 f8bSSASLR.2.3.html

          Or

          http://help.adobe.com/en_US/adobemediaserver/adminapi/WSa4cb07693d12388431df580a12a34991eb c-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.

          • 2. Re: Video Usage
            FreddyNuke Community Member

            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

            • 3. Re: Video Usage
              jim_houseman Community Member

              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.

              • 4. Re: Video Usage
                hparmar Adobe Employee

                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)

                • 5. Re: Video Usage
                  FreddyNuke Community Member

                  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?

                  • 6. Re: Video Usage
                    FreddyNuke Community Member

                    Perhaps I'm missing something. My videos are mainly packaged as manifest files and embeded as html objects in our training applicationa, internet/intrannet, etc...

                     

                    Are you saying the javascript should be added to the page that host the html object?

                    • 7. Re: Video Usage
                      jim_houseman Community Member

                      I am not saying that the javascript should be added to the page that hosts the html object.

                       

                      I am assuming that your AMS application works like mine, which may be a false assumption.

                       

                      But my folders  on the server are laid out like this:

                       

                      Adobe Media Server 5\Applications\[name of application]\[name of application].asc

                       

                      The javascript is in the .asc file.

                       

                      This is similar to this

                      http://help.adobe.com/en_US/adobemediaserver/devguide/WS5b3ccc516d4fbf351e63e3d11a0773d56e -7ffdDev.2.3.html

                       

                      When clients connect to your server, they hit the .asc file first. This is where you can accept, reject, or count connections.

                      • 8. Re: Video Usage
                        hparmar Adobe Employee

                        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.