Diagnositc information from the player

Topics: Windows 8 Xaml
Sep 6, 2012 at 10:40 AM

Hi all,

 

I am working with Player Framework 1.4, Adaptive Streaming Plugin 1.4, Timed Text Plugin 1.4 and Microsoft Smooth Streaming Client SDK Beta 2 for Windows 8 1.0. I play adaptive smooth streaming video. I need to send diagnistic information periodically to my backend server. What is needed: Bitrate, Download speed and Frame Per Sec. Have you get any idea, how to get this information from the player?

 

Thank you in advance!

Coordinator
Sep 6, 2012 at 7:03 PM

Unfortunately, there isn't a way to get FPS from the media pipeline. However, you can get info about the currently selected track from the Smooth Streaming SDK:

adaptivePlugin = new AdaptivePlugin();
player.Plugins.Add(adaptivePlugin);
player.MediaLoading += player_MediaLoading;

void player_MediaLoading(object sender, MediaPlayerDeferrableEventArgs e)
{
    adaptivePlugin.Manager.AdaptiveSrcManager.AdaptiveSourceStatusUpdatedEvent += AdaptiveSrcManager_AdaptiveSourceStatusUpdatedEvent;
}

void AdaptiveSrcManager_AdaptiveSourceStatusUpdatedEvent(Media.AdaptiveStreaming.AdaptiveSource sender, Media.AdaptiveStreaming.AdaptiveSourceStatusUpdatedEventArgs args)
{
    switch (args.UpdateType)
    {
        case AdaptiveSourceStatusUpdateType.BitrateChanged:
            var manifest = args.AdaptiveSource.Manifest;

            var videoStream = manifest.SelectedStreams.Where(i => i.Type == MediaStreamType.Video).FirstOrDefault();
            if (videoStream != null)
            {
                var newBitrate = uint.Parse(args.AdditionalInfo);
                var track = videoStream.AvailableTracks.Where(t => t.Bitrate == newBitrate);
            }
            break;
    }
}