Using Your Smartphone’s Camera to Live Stream Through Azure Media Services
Check out this tutorial on how to live stream through Azure Media Services using your smartphone's camera.
Join the DZone community and get the full member experience.Join For Free
you might have seen many examples of azure media services (ams) live streaming demo through wirecast installed on the laptop as shown in below links:
now, i’d like to share a different way to live stream, by using your smartphone’s camera. interesting, isn’t it?
mingfei has a post leveraging wirecast’s ios app here . the idea is that approach leverages a camera on your phone while still requiring a wirecast on the desktop.
in this post, i’ll be showing a different of my approach, by having a lightweight encoder installed on our smart phone (windows phone), and push the feed directly to ams live channel.
azure media capture in windows phone
i’m leveraging azure media services capture that you can download from the microsoft store for free . if you need to integrate this capability into your mobile application, you may download the source code and sdk from codeplex .
i assume you are familiar with how to do a live streaming through an on-premise encoder like wirecast. but if you’re not, no issue at all. please check the 3rd video of this post where i recorded how to live stream step-by-step.
i’ll be using azure media services explorer tools to manage the live channel, similar to the aforementioned video. the only difference in this approach is you should create a live channel with fragmented mp4 (smooth) as the input protocol.
figure 1. creating live channel with live encoding and smooth protocol
optionally, you may select live (cloud) encoding which makes a lot of sense to offload the multi-bitrates encoding from your phone to the cloud as shown as below diagram.
*it’s not mandatory to enable live (cloud) encoding in the demo. enabling live/cloud encoding, will take much longer channel’s starting time*
figure 2. architecture of live streaming (with live encoding) via windows phone
once the channel is running, copy the primary input url of that channel.
figure 3. copy the input url of the live channel
next, open the azure media capture app on your windows phone. click the setting icon and paste the primary input url to the “channel ingest url.”
*notice that, you actually can push multiple bitrates/resolution from your phone if prefer to, but your phone will suffer as encoding generally is a very processor intensive task*
figure 4. azure media capture settings
click start broadcast “red dot” button when you’re ready. when live/cloud encoding is enabled, anticipate longer delay (about 45 seconds).
go back to your azure media services explorer, right click on the channel and playback the preview with azure media services explorer.
figure 5. playback the preview url
and if everything goes well, you should be able to see the live stream that pushed from your phone:
figure 6. multi-bitrates result from phone
what about android?
i tried nano cosmos and worked well with ams live channel (via rtmp).
hope this helps.
Published at DZone with permission of Wely Lau, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.