go back to the articles list

Getting the user's GEO Location with Wowza Media Server

I was reminded of this topic while reading a few items in the forums on Wowza’s site and thought I would finally get an article out about it.

A while ago we were commissioned for a project to build a video content management system. Within this system there was the request to show log results of how many times videos were played, how much bandwidth was used in a day, month etc and also where the viewer is located on the planet.

Anyways, a bunch of research ensued and we came across the best alternative so far which is from MaxMind. They offer a free and paid for version of a database that has geolocation lookup tables. Here’s one for countries and one for cities.

Wowza is built on Java, which makes it extremely extendable, unlike FMS which mainly relies on C++ plugins to extend it, other than the javascript programming language on the server side. This is an upside to Wowza for sure. So, you can head over to get the API that they have put together for the geolocation discovery.

You now have just about all the tools you need to start figuring out and possibly logging where your users are coming from if you are using Wowza. If you have the Wowza IDE installed then it’s a simple as pie to import the java classes into your project and start taking advantage of them.

From here it’s easy. Read the docs a bit to understand what you have downloaded and then go ahead and create a LookupService, pointing to the location of where your database is at (the .dat file you download from MaxMind). Pass in the users’s ip, which you can get from the client properties clientObj.getIp() and voila! you should now have the location of the user by country, city latitude, longitude and so on. It’s that simple to do!

I encourage you to try it out, being that it’s all contained within Java, you only have to extend your main module out to load in the required classes and instantiate the LookupService and grab the result. Simple.

With all of that, there are 3rd party developers that are happy to share code and a couple of them have gone ahead and put together a module that you can try out

So good luck with it!

Posted by: Graeme Bull on Sep 05, 2011

Share This Article

STi Chat for Wowza Media Server with Flex | Foundation Edition v4

STi Chat for Wowza Media Server with Flex | Foundation Edition v4

This is a new and improved basic video/audio/text chat application with the ability to invite other users to a private room. The Foundation Edition is meant to give developers the building blocks they need to learn, as well as an entry level solution for those needing a basic chat system. The source code is in AS3 and MXML with the Flex 4.5 SDK. We will be working on more features for the chat as we go and all are free.

$129 Buy Now