Wowza Video API Session 6: Analytics
Welcome to the sixth and final Wowza Video API session. Now that you’re more familiar with the platform and more advanced functions, you’re ready to learn something you’ve likely been excited for: analytics. In this session, we’ll cover how to look into your streams’ health, audience distribution, viewership data, and other important metrics you can use to glean insight into your video strategy’s performance. Watch the video above or read the transcript below for everything you need to know about real-time and historic analytics.
Table of contents
Stream Health Metrics
Barry Owen: Hey, everyone. Barry Owen here, back with Rose Power.
Rose Power: Hey, Barry. It’s our last video and series already. I can’t believe it.
Barry Owen: Exciting, huh? We’ll have to think of some more to do. As Rose said, we are back with the last video in our API series. This will be session six. In this session we’ll talk about analytics and we’re going to go through the analytics capabilities of the Wowza Video platform for both live, on demand, and that includes both real time and historic analytics. So let’s dive right in.
As you can see, we’re back in our friendly Postman here. Got a whole built-out file for you guys that I’ll be posting on GitHub a bit later that’ll give you all of the calls for all of the sessions, so I think that’s a great resource for you folks to get started.
What I’m going to do here is I’m going to start by creating a live stream because we’re just going to show some stream health metrics that we’ll be able to grab. So go ahead and create this. And if you remember from previous sessions, what we’re going to get back here, most importantly for right now, is we’re going to get back some source connection information.
I have OBS running here in the background. I’m going to go ahead and set this version of OBS up to go to this new endpoint. So we’re going to grab that. We’re going to grab our stream name. We’re going to grab our client information and our password. And OBS is good to go.
So now what we’re going to go over here, is do this. We’re going to go ahead and start the livestream. While that’s starting, I’m going to move OBS out of the way so it’s not bothering us. Then we’re going to move over here into the UI. So we’ll get back to this homepage here, because it reflects some stuff we’re going to want to talk about, but we’re going to go look over at available live streams.
Here’s our live stream. You can see it started, it’s ready to go. I’m going to start streaming from OBS. OBS is connected. It’s streaming. For those of you following at home, it’s the Top Gun preview. Good movie, go see it.
So, we’re going to go and see some statistics for this transcoder, and what this is going to give us here is kind of a snapshot view of the transcoder on what’s going on. Now in this case, what we’re going to get is real useful information. We’re going to see our bytes in rate, we’re going to see the status. Is it normal? Do things look normal? Is the stream I’m sending in getting there at the expected rate? Are the bytes out rate normal? Is the transcoder populating things correctly? Does the width and the height match?
And in this case, what I sent in is actually a slightly odd version. Instead of being 1080P it’s actually 1088P. Well, it’s going to tell you that from the UI. And there’s no real side effect to that other than you might get a tiny bit of shrinking when you play this back in a 1920 by 1080 window. So you might want to set OBS to do a little bit of a crop in that case.
You can see the frame rate. You can see the key frame interval. You can see that this key frame interval in this case, this particular encoding has a variable key frame interval. I don’t really recommend that; it’s better if it’s solid, you’ll see you’ll get some warnings here. I can continue to hit this API over and over again and just get updated data with what’s going on.
This is the same data you’re going to see reflected in the UI under stream health. So this is the data over time. This is the data in real time. So again, we’ve said this many times, but anything you can do in the UI, you’re going to be able to get from this API.
Real-Time Viewer Data
Barry Owen: Next up, we’re going to look at real-time viewer data. I’m going to go ahead and send this even though there’s nobody viewing. So, samples over time ready to graph right out of the UI. Once people start viewing this, obviously this changes and you’re actually going to see viewers.
From now on, we’re going to go into a little more stuff about “predone.” I wanted to actually show you some data, so I’m not going to be too concerned about the live running transcoder at this point. We’re going to show you some stuff that from a previous session. We’ll go ahead and go back here to get out of that screen. I’m going to go ahead and stop OBS and I’ll go ahead and stop the transcoder.
I take it back. I’m not going to stop it just yet, because I want to show you something else. You can also get a list of all the running transcoders in your platform and then programmatically extract the transcoder IDs you may want to use for these calls. So it’s really easy to go in there and just get a list if you have an account that’s got 10, 15, 20 transcoders running, you can grab them right here, easily loop through them and get the details and go and look. In this case, this particular transcoder, this is just the details for it. And the reason I went and got that because I wanted to extract some things out of it.
So transcoders have output targets that are going to be useful for us to get information about them. And they also have uptime records. So when you create a live stream, of course, you can continue to reuse that live stream. You don’t have to recreate it to use it again and to stream each time. That allows you to segregate each block of time the transcoder is running via what we call an uptime record. So if you go look at the uptime records for a transcoder, in this case we’re going to look at this one. You could see that it just ran once because I stopped it and started it. If you can see that it was created, it was started.
What I have over here is some historical data that we should be able to go grab with a different transcoder ID. In that case, I’m going to come over here, I’m going to paste this transcoder ID in, and we’re going to get different uptime data. And you see that this is a different transcoder. So I’m going to use this one because I know it’s got some viewer data in it, and that’s going to be a little more interesting to look at.
So again, same thing for this transcoder ID. Actually, I’m going to do this differently. I’m going to go ahead and set my transcoder variable. I’m using this transcoder in my previous calls here. This is a great feature of Postman; you can have all your variables in one place and can leverage those variables and calls, but you can also change them so that the calls you’re using will be different. So, you see now we have a slightly different one that we know has been used before. I’m going to go get its uptime records. You can see that, again, same.
Historic Stream Health and Viewer Data
Barry Owen: Now we’re going to look at historic stream health. You’ll see that we have multiple sessions here, multiple sampling points. This is after the transcoder was just started and nothing was being sent to it.
This is another session where now we’re actually seeing data flowing into the transcoder at another sampling point. You can look at these just based on the dates here and graph these over time. That allows you to see over the course of time for a given uptime session how the transcoder performed. That allows you to do graphs of a particular event, and that’s where that is really useful.
We’re also going to look at some historic viewer data. Let’s see, hold on one second. I need to get a different stream target ID in here. Hold on one sec. This one will be a little more interesting. You can see this particular stream we had 41 viewers maximum in terms of unique views. We had the average viewing seconds of 1400, we get our bytes, we get our zones. And then you can also get some interesting information about where those people were via the call that gives you countries. So in this case, you can see we had one German viewer and 40 US viewers. So the bulk of our traffic came from the US, of course, some of the traffic in fact came from Germany. I find this one pretty interesting.
So this shows you what renditions of the video were viewed, which is what bit rate and what frame size were viewed. It’s interesting to look at. And this is interesting to look at particularly in a graph, maybe a bar graph of who’s viewing what. What you’ll find out is that many streaming sessions start at the lowest bit rate so you’re going to see a lot of views there. So you see here at the lowest bit rate, started with 37 viewers. So 37 of the 41 viewers came in at that low bit rate, but you’ll see that the bulk of those people, 38 of them in fact, actually stabilized up, if you will, to the highest bit rate. And that was the highest time and also the highest viewing bytes. So in this case, most of the people viewing this stream had good connections, and we’re seeing the best quality you could give to them.
If you looked at this and it turns out that the bulk of your viewers were only seeing maybe the 640P stream, that means that the people viewing your stream probably didn’t have great network connections, and you may want to take a look at it and it’s like, “Well, geez, maybe I shouldn’t even be sending a 1080P stream because nobody can watch it given the connection they have.” So it kind of lets you optimize the way you’re encoding your videos to really match your viewers experience.
Adjusting Bit Rates
Rose Power: Barry, I have a couple of questions.
Barry Owen: Yeah, absolutely. That kind of gives us a quick view of the live stuff and real-time things for live streams. So before we dive into VOD, this would be a great time to ask questions on that.
Rose Power: Okay, thanks. So say for example, there’s a stream taking place and some viewers are complaining that they’re watching it from their mobile phone and it’s buffering or it’s choppy. I believe what you’re showing here is you could go in here and you could confirm that the bulk of your viewers are watching mobile and then you could go back and check your encoder settings. If you are sending it too high of a bit rate, it’s too much for the mobile phone, you could go in and do some troubleshooting and adjust that. Is that what you were demonstrating?
Barry Owen: Yeah, you could, for example, maybe you have your 640P renditions set up at some 2,500 megabits a second, where it really should be maybe 1200 megabits a second. So you could go in and you could actually tweak your livestream to lower that bit rate to allow those people to get that 640P at the best quality possible without overdoing it so that people can watch. And if the case of it was that you really wanted people to look at the 1080P stream, you could create a 1080P stream with a relatively low bit rate. Maybe the quality isn’t great, but maybe for whatever reason you needed people to be able to see it that way. So you can get to that by these analytics and like I said, make the changes to result for the best experience for your particular set of viewers.
Rose Power: OK. Thanks. And then can I ask you one more question before you move on?
Barry Owen: Of course.
Rose Power: So earlier you were showing some of the data and you mentioned it’s real-time data. I get questions in the forums here at Wowza a lot of times about how does this work, say you’re simulcasting to multiple social media sites at one time in addition to your website or a player application. Is there latency added to this viewer data when you’re simulcasting to all those different locations?
Barry Owen: We don’t know who’s viewing obviously at the remote locations. You have to get those analytics from that platform. We can tell you who’s viewing from our delivery platform and our CDN and that data actually comes back quite quick. I usually tell people a minute, but in fact, it’s usually much more frequent than that. Easy to go see with this, but you’ll get constant updates of that data very frequently.
Rose Power: Gotcha. Thanks.
VOD Stream Analytics
Barry Owen: All right. So that was our overview of live. We’ll do real quick and look at VOD here. What we’re going to do to start is we’re just going to go grab all the VOD streams in our account. And really, all I’m doing this for is I’m trying to go find some interesting stuff that maybe has some data in it for you. This is a test account. So a lot of these streams really don’t have too much in the way of viewership.
Let’s see if I can find one here. Let’s look and see if anybody viewed this fake webinar we did on the platform. So with the VOD assets, just like the live assets, you can get real time data and you can get historical data. So if you know you have a real popular VOD asset and you know people are viewing it constantly. You can easily go into the platform and grab the data. And again, this will sample over time and it’ll give you minutes of data. You can keep calling it and keep updating it.
In this case, nobody’s watching this particular asset because it’s a test asset on the platform. But of course, if you had a popular asset, you can get up-to-date information very easily. You also get historic data, which will give you a much broader time horizon. And in this case not a lot of interesting data here, but I prepopulated this with one that I know had a little bit of data, but you can see that at this point this one had two unique viewers. They viewed it for 1,500 seconds a piece, 790 viewing seconds on average, and you get your usage data there. And what you’ll see here is this is showing that this particular one is looking from 519 to 607.
You can actually put a “from” and a “to” in the URL and filter over various time blocks as well. And that’s all documented in the Wowza API docs, as far as how to set up these filters for filtering for various timeframes. Any of the historic stuff will do that for you. Same with the live. You can go and you can get viewer data by countries. In this case, this particular one doesn’t have any information because nobody viewed it. Let’s go and put the one we were just looking at. So in this one, both viewers were in the United States, not too surprising for that video.
And again, same thing. You can look at viewer data by renditions. So we’re going to go back and we’re going to populate that same value. This one you’ll see that in this case, again, people probably started at the lowest transition. Somebody viewed it at the middle one for a brief period of time. And you’ll see these numbers are very small. Nobody stayed at the 448 of the 640 version very long. The bulk of the time was spent on this one, which happens to be the 1080P version. So again, useful data for your particular videos to make sure they’re encoded as you need them to be, to deliver the best experience to users.
Account Global Information
Barry Owen: And then lastly, there’s a couple calls that are just going to give you global information about your account. So on an account level, and again, between these two timeframes, you can look at how many viewers were viewing anything at any given time. So useful for graphing, and that’s where you get things like this. So you’re going to see our homepage here and you’re going to see hours viewed. You see we had a spike here where a few viewers… And this is where this data comes from and this is a potential visualization for this data.
And again, down in the analytics page, you can see even more data. Again, over a given times, in this case from 518 to 66. Let’s look at VOD assets. You can see that the views of the VOD assets, you can add in live streams. So we had a nice spike. This is the one where I was showing you that had 40-something viewers last week. And obviously you can get both.
So this is where the data for these visualizations is coming from. These are an idea of some visualizations you can do. And this page corresponds with this call here, and this tells you what was happening over time, what usage, how many egress bytes, egress seconds. And this is just their account usage information.
This is a way for you to track your usage, so when it comes close to billing times, if you want limits on your account, or if you want to get notified, if you want to notify your peer accounts had excessive usage or you had a very popular event and you want to make sure you’re not going over some threshold, you can easily dig that information out here and use it.
Conclusion and Player Analytics
Barry Owen: So that’s a quick overview of the many things you can do with the analytics. And there’s a lot more to come here. Very soon, now that we’ve updated our player, you’re going to see analytics coming from the player side as well. And that’ll give you even more real time information and some more granular things that you can view down into very specific individual user things, including what the experience was all the way out to the end where individual people expand… How many people were seeing rebuffering, how many people were seeing stalled plays. So you can really be able to begin to optimize and understand the whole end-to-end platform as far as how your streams are performing.
Rose Power: This is a lot more data that we offer in Wowza video than we have in the past. So I think it might be worth mentioning to folks watching that you do need to have a Wowza Video account to access all these additional analytics, but that’s a long list of data that you can access.
Barry Owen: Yeah, absolutely. Some of the key pillars of Wowza Video that we expanded on from Wowza Cloud were these analytics and this is very valuable for you to have to understand the quality of your users’ experience, the quality of service you’re providing and super useful data. We’ve given you some built-in visualizations, but we give you access to all that data. We’re not holding any of that data hostage. You can get it and you can use it however you need to.
Rose Power: Hey Barry, I know this is the last video on our series, but I think it would be kind of interesting to do a webinar and demonstrate everything that you’ve showed in all these different videos, maybe highlight a customer use case or something. What do you think about that?
Barry Owen: I think that’d be a fantastic idea. I would love to have one of you in the audience come on and show us how you use the API and how the API helped you deliver an end-to-end solution for your customers. I think it’d be fantastic. Let’s do it.
Rose Power: Cool. This is goodbye for now, but we’ll meet again.
Barry Owen: All right. That wraps up session six of the Wowza Video API tutorials. Love to hear your feedback. As always, we’ll be posting the Postman file on GitHub for you to look at and all the sessions, both video and transcript are available on wowza.com.
About Barry Owen
Barry Owen is Wowza’s resident video streaming expert and vice president of solutions engineering. In this role, he leads a team dedicated to helping customers succeed. From architecting custom applications to solving complex problems, Barry leverages more than 25 years of experience developing software-as-a-service, cloud-based, and live streaming platforms to create innovative solutions that empower organizations across every use case.