8 Replies Latest reply on Jul 26, 2010 3:09 PM by rshin

    How to use Logging?

    DanM88

      I am trying to get QoS and other information from OSMFPlayer. I have logging set to true in the project properties.

       

      I import org.osmf.logging.*, and add the code...

      CONFIG::LOGGING { logger.fatal("LOG THIS INFO"); }

      ...

      CONFIG::LOGGING { private static const logger:org.osmf.logging.Logger = org.osmf.logging.Log.getLogger("OSMFPlayer"); }

       

      (I am using logger.fatal because I assumed it would be the best to get only the information i want.)

       

      It appears that thsi is all I need to create a log, however, I cannot find a log anywhere. Is this all that is needed to create a log. And where should the log appear? The documentation is pretty sparse on this topic.

       

      My setup is a Linux server with my media and OSMFPlayer streaming to a Windows client using Firefox.

       

      Thanks,

      Dan

       


        • 1. Re: How to use Logging?
          weizhangstrobe Level 2

          The default implementation from OSMF sends the logging information to the debug console. Have you checked there? If you want to have the logging information sent to other places such as your own debug window, you have to implement the logger yourself. But if you don't see the logging information from the debug console, please let me know.

           

          -Wei Zhang

          Senior Computer Scientist

          Adobe Systems

          weizhang@adobe.com

          • 2. Re: How to use Logging?
            DanM88 Level 1

            If by debug console, you mean the Flash Builder debug window, then no nothing is appearing there.

             

            What I want to do is print out QoS information to a file. Is logging the right thing to use for this? Do you have an example of how to do this?

             

            Thanks,

            Dan

            • 3. Re: How to use Logging?
              weizhangstrobe Level 2

              That sounds a little strange to me. There is a SampleLogger project under apps/samples/framework, you may want to check it out.

               

              I guess you have set the CONFIG::LOGGING true in the additional compiler arguments. So if you want, send me your source code (or the whole project if it is not too big) that I can debug it.

               

              -Wei Zhang

              Senior Computer Scientist

              Adobe Systems

              weizhang@adobe.com

              • 4. Re: How to use Logging?
                rshin Level 3

                Additionally, if what you want to do is to see QoS information, there is QoS plugin you could use and print out some infomration in your app level. (trunk / apps/ samples/plugins/ VideoQoSPlugin).

                 

                Also you might want to check out Strobe Media Playback (OSMF based player) that has QoS information panel.

                 

                http://osmf.org/  or http://osmf.org/strobe_prerelease.html

                 

                http://osmf.org/smptest/debug.html?src=rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/ content/test/SpaceAloneHD_sounas_640_500_short

                 

                If you want to use a plugin, the url format is something like this.

                 

                http://osmf.org/smptest/debug.html?plugin_mast=http://smpfmp.appspot.com/MASTPlugin.swf&sr c_namespace_mast=http://www.akamai.com/mast/1.0&src_mast_uri=http://mediapm.edgesuite.net/ osmf/content/mast/mast_sample_onitemstart.xml&src=rtmp://cp67126.edgefcs.net/ondemand/medi apm/strobe/content/test/SpaceAloneHD_sounas_640_500_short

                 

                Ryan

                • 5. Re: How to use Logging?
                  rshin Level 3

                  Dan,

                   

                  As Wei mentioned if you have set the complier option -define CONFIG::DEBUG true in OSMF and your app, and run from debug mode, you should see debug message in your debug console in your flahs builder (or flex builder).

                   

                  If you want to send the debug information to a file or somewhere else to print, you may want to refer to this similar implementation done in OSMFPlayer. (Trunk > Apps > Samples > Framework).  There is a debug folder that contains Debugger.as, DebuggerLogger.as, DebuggerLoggerFactory.as,  (DebuggerElementProxy.as).

                    DebuggerLoggerFactory and DebuggerLogger are the extend class from OSMF Logger and LoggerFactory.  Debugger.as uses LocalConnection to send log information.  DebuggerElementProxy is a proxyElement that wraps your media element that is being played in the player to handle OSMF events.   In particular case for OSMF player, the log information are sent to an air app called "OSMFPlayerDebugConsole" (you can find in the same location as OSMFPlayer in svn), but it is up to how to retrieve and display the information.

                   

                  Ryan

                  • 6. Re: How to use Logging?
                    DanM88 Level 1

                    I'm sorry, I wasn't aware that I needed to be in the debugging mode in order to get logging information. I can now get the logging information to print to the console. And to an external file (project > properties > debug settings > edit > common > check the "file" checkbox in the output options box).

                     

                    However, this solution wont really work for me as I want to gather information in a real streaming environment. Is there any documentation on the VideoQoSPlayer? I am trying to add the plugin but it does not seem to be doing anything. I'm probably just not installing it correctly. The debug.html on the StrobeMediaPlayback project also looks promising, however, I havent been successful at getting that to run on my environment either.

                     

                    The OSMFPlayerDebugConsole sounds like my third options, but could you explain what an AIR app is? and how I would get the log information from it?

                     

                    Thanks,

                    Dan

                    • 7. Re: How to use Logging?
                      weizhangstrobe Level 2

                      I will let the original author of OSMFPlayerDebugConsole to answer your questions.

                       

                      Ryan, please chime in.

                       

                      -Wei Zhang

                      Senior Computer Scientist

                      Adobe Systems

                      weizhang@adobe.com

                      • 8. Re: How to use Logging?
                        rshin Level 3

                        Dan,

                         

                        1) There is no document on VideoQoSPlugin as far as I know.  The brief steps of how to use it is

                         

                        1. Add QoS variables to the Plugin as you want to see.

                         

                        1.1 Add QoS metadata to VideoQoSPluginMetadata.as as public var.

                           eg) public static const VIDEOBUFFERLENGTH:String = "videoBufferLength";

                         

                        1.2 Add value to your metadata in VideoOsOProxyElement.as,

                              Note that onTimer function has NetStreamInfo "qos".

                            eg)       metadata.addValue
                                            ( VideoQoSPluginMetadata.VIDEOBUFFERLENGTH
                                            , qos.videoBufferLength.toString()
                                            );

                         

                        2. Load the Plugin into your player : See other plugin samples.

                              mediaFactory.loadPlugin(pluginResource);

                         

                        3.  Get the QoS data in your player .(eg) org.osmf.qos.VideoQoSPluginMetadata.CURRENT_FPS

                             It is up to you how to use / display QoS data.

                         

                        2) As you said StrobeMediaPlayback has already built for many QoS parameters so I might be just easier to use that.  I saw your post to SMP so you are on the right track as Andrian is the person you want to talk regards to SMP.

                         

                        3) Air APP is an application platform as oppposed to an web application such as a HTML based app.  You can download it from here.

                        http://get.adobe.com/air/  and install the debug console or run it from your flex builder.   The readme file has an instructions to the debug console.

                        Basically, you launch the debug console first, then run OSMF player and play a video.  (Turn on the Logging option on : -define CONFIG::DEBUG true -define CONFIG::FLASH_10_1 true),    The debug message will be displayed on the debug console as the video plays.

                         

                        Ryan