Azure Media Indexer and OpenSource

Last week, I and a colleague of mine was invited to demo Azure at the RedHat Forum 2016 event in Stockholm, Sweden. The event was of course a pure OpenSource event and given the history between RedHat and Microsoft, we suspected that speaking about a Microsoft technology might have it’s slight degree of challenge with the audience even though the two companies are pretty good friends now. What to demo was the question? Demoing deploying RHEL on a VM is too vanilla. Also, Docker and Containers would be covered in other sessions in the event, so speaking about that wasn’t going to give extra points for Gryffindor . The decision was made to demo something from Azure Media Services since it is both cool and easy to understand from a 10000 foot view.

Demo code

There are plenty of open source sample code around, but when it comes to Media Services, that is not so true anymore. You have the Azure SDK for Java, but nothing in the official samples gallery (see refs). There is an independent sample by southworkscom on github called azure-sdk-for-media-services-java-samples that is the closest I could find, which I used as a start.

I created a RedHat Enterprise Linux 7.2 from Azure Marketplace, installed Java JDK and Maven, then git cloned the repository and tweaked the azure-media-analytics-indexer sample and compiled it.

Running the code

24 seconds video clip of Corey Sanders, a Microsoft Azure Program Manager, from youtube would serve as test data https://www.youtube.com/watch?v=DI5ZfmyyKPo. I download that clip to a video file in mp4 format.

azmsjava-demo-01

The upload of the 5.4MB file took some 10 seconds. Azure Media Indexer then took roughly 2.5 minutes to process 24 seconds of video, which is fair since I had no dedicated streaming units in Azure and just used the default units, meaning I use shared resources in AMS.

azmsjava-demo-02

The output of the job is downloaded and a file named *.info contains a transcript of identified words. As you can see the outcome is very accurate to what Corey Sanders is saying in the video.The word “Azure” becomes “as your” which phonetically isn’t bad at all even if it’s wrong and “IaaS” becomes “eyes”. This is understandable, since technical terms like these are not part of the daily english vocabulary. More surprising is the first word “Moi” in the transcript since he actually doesn’t say anything before “Hi there”. Perhaps it’s a hidden message from Corey and we will hear the word “Moi” (actually “Hello” in Finnish) if we play the video backwards?

azmsjava-demo-03

Summary

The point to be proven in the event session demo was that you can use Azure even though you have a 100% OpenSource solution. Services in Azure, like Azure Media Services and its Indexer feature, exposes a REST API that Microsoft builds client libraries for in many different languages, including Java. This makes it possible to build modern and feature rich applications in Microsoft Azure with openness in mind.

References

Azure Media Services sample on github
https://github.com/southworkscom/azure-sdk-for-media-services-java-samples
In all fairness, this sample wasn’t easy to build and be prepared to spend some time to search and download JAR-files needed. At the bottom of the readme.md page you have link to the azure-media-0.9.4.jar file. In the below page you have a link where you can download the entire Azure Java SDK in one zip-file with all JAR files. If you are looking for other versions of a specific JAR-file, your best option is to search for them in the Maven repository (see ref below).

Download the Azure Java SDK documentation
https://azure.microsoft.com/en-us/documentation/articles/java-download-azure-sdk/

Azure SDK for Java
https://github.com/Azure/azure-sdk-for-java

Maven Repository for Azure JAR-files
http://mvnrepository.com/artifact/com.microsoft.azure

Azure Java Samples in general on azure.com
https://azure.microsoft.com/en-us/documentation/samples/?term=java

Azure Media Analytics website
http://azuremedialabs.azurewebsites.net/demos/Analytics.html