# Thursday, 30 August 2018

GCast 11:

Azure Media Services - Uploading, Encoding, and Sharing a Video

Learn how to Upload, Encode, and Share a Video using Azure Media Services.

Azure | GCast | Screencast | Video
Thursday, 30 August 2018 09:29:00 (GMT Daylight Time, UTC+01:00)
# Wednesday, 29 August 2018

Azure Storage allows several options for managing replication of your stored data. You can read about these options in this article.

You can set the Replication Type when you create an Azure storage account (Fig. 1)

Fig01-CreateStorageAccount
Fig. 1

But, at first glance, it appears that you cannot change the Replication Type after you create the account. The "Overview" blade (Fig. 2) lists the Replication Type, but you cannot change it here.

Fig02-OverviewBlade
Fig. 2

However, the "Configuration" blade (Fig. 3) also lists the Replication Type.

Fig03-ConfigurationBlade
Fig. 3

On this blade, you can click the "Replication" dropdown (Fig. 4) and change the type.

Fig04-ReplicationDropdown
Fig. 4

Click the [Save] button (Fig. 5) to make these changes permanent.

Fig05-SaveButton
Fig. 5

Wednesday, 29 August 2018 16:05:20 (GMT Daylight Time, UTC+01:00)
# Tuesday, 28 August 2018

A caption file can enhance a video file by displaying any dialog as text at the bottom of the video. This is helpful for people who are hard of hearing, for people who do not understand the language spoken in the video and for those who want to play a video at low volume or muted.

Azure Media Services allows you to quickly create a caption file for your saved videos. The steps are:

  1. Create Azure Media Service
  2. Upload File
  3. Encode Asset
  4. Analyze Video
  5. Download VTT file
  6. Upload VTT file
  7. Share video

I described in detail how to perform steps 1-3 in this article.

Analyze Video

After you have encoded your video, you can use the "Analyze" function to generate the following files:

  • A caption file in the TTML format.
  • A caption file in the SAMI format
  • A caption file in the WebVTT format

I have no statistics to back this up, but I see WebVTT used more than the other 2, so I typically stick with this.

To run the "Analyze" function, open your Azure Media Service in the Azure Portal and open the "Assets" tag as shown in Fig. 1.

Fig01-AssetsBlade
Fig. 1

Click the Asset corresponding to the asset corresponding to the encoded video to open its blade, as shown in Fig. 2.

Fig02-EncodedVideoAssetBlade
Fig. 2

Click the [Analyze] button (Fig. 3) to open the "Media Analytics" blade, as shown in Fig. 4.

Fig03-AnalyzeButton
Fig. 3

Fig04-MediaAnalyticsBlade
Fig. 4

Check the checkboxes next to the Closed Caption file formats (and other files) you wish to crate; then click the [Create] button at the bottom to begin creating these files.

This creates and schedules a new job for this Azure Media Service. You can click the "Media Analytics job added" link (Fig. 5) at the top of the blade or you can open the "Jobs" blade for this Media Service and click the most recent job added. Either method will display the blade for this Job, as shown in Fig. 6.

Fig05-JobAdded
Fig. 5

Fig06-JobBlade
Fig. 6

Jobs run asynchronously in Azure Media Service, so you can continue to work or stay on the Job blade to monitor its status. The status changes from "Scheduled" to "Queued" to "Processing" to "Finished". While processing, the blade will display the percent complete.

When the job is finished, you will see a new asset in the "Assets" blade for the indexed video, as shown in Fig. 7.

Fig07-Assets
Fig. 7

Click this asset to open the blade for the Analytics files created by this job, as shown in Fig. 8.

Fig08-IndexedFileAsset
Fig. 8

To make these files available for download, you must publish them. To do so, click the [Publish] button (Fig. 9), which opens the "Publish the asset" blade, as shown in Fig. 10.

Fig09-PublishButton
Fig. 9

Fig10-PublishTheAssetBlade
Fig. 10

After you have published these files, you can download any or all of them. They are listed at the bottom of the Analytics files blade (Fig. 8)

Click the file with the ".vtt" extension to open a blade for this file, as shown in Fig. 11.

Fig11-VTTFileBlade
Fig. 11

The important information is the DOWNLOAD URL field. You can copy this value to your clipboard by clicking the icon to the right of this field.

### Download VTT file

Use CURL to download this file. If CURL is not installed on your computer, you can install it from https://curl.haxx.se/download.html.

Open a command prompt and type

curl -o "fffff.vtt" "http://xxxxxxxxxxxxxxx"

where http://xxxxxxxxxxxxxxx is the DOWNLOAD URL copied from the blade; and fffff.vtt is the name of the local file you want to create when you download this file.

Verify that a new file was created.

Upload VTT file

Now upload this VTT file to the video asset. Open the Azure Media Services "Assets" blade and select the Asset for the originally uploaded video to open the blade for this video asset, as shown in Fig. 12.

Fig12-AssetBlade
Fig. 12

Click the [Upload captions] button (Fig. 13) to open the "Upload caption file" blade, as shown in Fig. 14.

Fig13-UploadCaptionsButton
Fig. 13

Fig14-UploadCaptionFileBlade
Fig. 14

Click the [Select File] icon (Fig. 15) and select the VTT file you downloaded with CURL.

Fig15-SelectFileIcon
Fig. 15

Share video

Now, you can share the video, using a Media Player.

A simple one to use is the Azure Media Player, available at https://ampdemo.azureedge.net/

Information on using this player with Azure Media Services is in this article.  http://davidgiard.com/2018/08/21/UploadingEncodingAndSharingAVideoWithAzureMediaServices.aspx.

You will need the URL of the video to play, which you can by selecting the Encoded Videos asset from the "Assets" blade to open the properties for this asset, as shown in Fig. 16.

Fig16-EncodedVideosAsset
Fig. 16

Copy the Streaming URL at the bottom of this blade under the "Published URLs" section. (NOTE: If nothing is in this section, you need to publish this asset.)

In Azure Media Player, copy this URL into the URL field, omitting the "http:", as shown in Fig. 17.

Fig17-AzureMediaPlayer
Fig. 17

The copied text should look something like this:

//dgtest2-usea.streaming.media.azure.net/d7d7eb93-9ef8-40fd-9c01-8253c9ca2126/Gratitude.ism/manifest

It will end with the name of your video asset, followed by ".ism/manifest".

Click the [Update Player] button and verify that your video plays properly.

If it plays properly, check the "Advanced Options" checkbox to display more options and scroll to the bottom, as shown in Fig. 18.

Fig18-AdvancedOptions
Fig. 18

Click the [Add Track] button to display new track information, as shown in Fig. 19.

Fig19-AddTrack
Fig. 19

At the "Kind" dropdown, select "Captions"

At the "Track Label" field, enter "English" or the name of the language in which the video is recorded. This text will display in the "Closed Captioning" control.

At the "Language" dropdown, select "English" or the language in which the video is recorded.

At the WebVTT URL, enter the URL of the uploaded VTT file. This will be identical to the video URL. The name of the VTT file will replace the name of the video asset, followed by ".ism/manifest".

It should look similar to this:

//dgtest2-usea.streaming.media.azure.net/d7d7eb93-9ef8-40fd-9c01-8253c9ca2126/Gratitude.vtt

Fig. 20 shows these fields completed for my video.

Fig20-VTTTrack
Fig. 20

Click the [Update Player] button.

Now, when you play the video, you should see a "CLOSED CAPTIONING" icon at the bottom right. Click this to reveal the CLOSED CAPTIONING setting and select the caption language you just added (English in the case of the video in Fig. 21)

Fig21-ClosedCaptioning
Fig. 21

With the captions enabled, you should see text below your video whenever anyone is speaking, as shown in Fig. 22.

Fig22-VideoWithCaptions
Fig. 22

In this article, I showed you how to create closed captioning and share a video that includes this captioning.

Azure | Video
Tuesday, 28 August 2018 09:38:00 (GMT Daylight Time, UTC+01:00)
# Monday, 27 August 2018
# Sunday, 26 August 2018

SIASLI do not hold Stranger in a Strange Land by Robert A. Heinlein as the science fiction classic that some readers rate it. But I give it an extra star for the introduction of the word "grok" - a word meaning many things, but mostly : "to understand something so well as to internalize its meaning". "Grok" has been adopted by geek culture - a culture in which I spend a great deal of time these days - to indicate comprehension of a complex technical topic.

Vernon Michael Smith ("Michael") was stranded on Mars as an infant when his spaceship crashed, killing all other crew and passengers. He was raised by Martians until he returned to Earth decades letter on the next manned ship to and from Mars.

The governments of Earth view Michael as an oddity -  a noble savage with an intelligent mind, who lacks the advantages of civilization. But Michael is civilized according to Martian culture. And he possesses great powers taught him by the Martians, including the ability to direct his consciousness to leave his body and the ability to make objects and people move or disappear with just a thought.

The government tries to keep Michael a prisoner; but he escapes with the aid of Jill - a nurse in the hospital where he is confined - and Jubal - a retired author living in seclusion. While on the run from the government, Michael joins a circus and then a church, where he rises to a position of leadership. The church preaches the pursuit of joy and free love, which pisses off many other Americans.

As time passes, Michael becomes more like his fellow Earthmen. But he also influences them to adopt many of his Martian ways.

Michael's parallel to the life of Jesus is unmistakable. He is first exposed to the public in his adulthood and he quickly enters the public consciousness, impressing people with his powers, before taking over and influencing a small religion - an action for which he is hunted down and persecuted.

There are some troubling bits of sexism in this book: "Nine times out of ten, if a girl gets raped, it’s at least partly her own fault", according to Jill, the main female character of the novel. One can chalk this up to the book's 1961 publication date or condemn the author as a misogynist. To its credit, Jill and other characters are stronger and more assertive than most characters appearing in novels of this era.

And there are long passages of preaching by Jubal, Michael, and others that sometimes grow tiresome. I would prefer the philosophy is told through the narration, rather than the characters making speeches.

But Stranger in a Strange Land is an enjoyable story, if you take the time to grok it.

Sunday, 26 August 2018 09:49:00 (GMT Daylight Time, UTC+01:00)
# Saturday, 25 August 2018

In an earlier article, I showed how to create an Azure Media Service; then, upload, encode, and share a video with that service.

In this article, I will show how to live-stream video content using Azure Media Services.

You will need to install some streaming software on your computer to do this. I chose Wirecast by Telestream. You can download a free trial at https://www.telestream.net/wirecast/overview.htm. You may use any software you like.

The 3 steps to live streaming with Azure Media Services are:

  1. Configure an Azure Media Service
  2. Stream your content with streaming software
  3. Share the stream

STEP 1: CONFIGURE AZURE MEDIA SERVICE

First, create an Azure Media Service, as described in Step 1 of this article.

Open your Azure Media Service and select "Live Streaming" from the menu to open the "Live Streaming" blade, as shown in Fig. 1.

Fig01-LiveStreamingBlade
Fig. 1

In the "Live Streaming" blade, click the [Quick create] button (Fig. 2) to open the "Quick Create Channel" blade, as shown in Fig. 3.

Fig02-QuickCreateButton
Fig. 2

Fig03-QuickCreateBlade
Fig. 3

At the "Name" field, enter a name for this channel.

Verify that the "Automatically start the channel after creation" checkbox is checked.

Click the [Create] button to create the channel.

After a few minutes, the channel will display with a status of "Running" in the list on the "Live Streaming" blade, as shown in Fig. 4.

Fig04-LiveStreamingChannelList
Fig. 4

NOTE: The Quick Create option creates a channel with RTMP protocol, Pass Through encoding, and no IP restrictions on viewing the stream. This works fine in many cases; but, if you would like different settings, you can click the [Custom create] button instead.

Click the channel in the list to open a blade for that channel's details, as shown in Fig. 5.

Fig05-ChannelDetails
Fig. 5

Note the INGEST URL (Primary) field. You will need this in your streaming software. The icon to the right allows you to copy this value to your clipboard.

Click the [Live event] button (Fig. 6) at the top of the Channel blade to open the "Live Event" blade, as shown in Fig. 7

Fig06-LiveEventButton
Fig. 6

Fig07-LiveEventBlade
Fig. 7

At the "Name" field, enter a name for your Live Event. It must be unique for this channel.

Click the [OK] button to create and start the live event.

PART 2: STREAMING SOFTWARE

You will need to configure your streaming software to stream to Azure Media Service. The instructions below are for Wirecast, but you may use any streaming software you like.

Launch Wirecast.

From the menu, select Output | Output Settings.

If prompted, set the Destination to "RTMP Server" and click [OK], as shown in Fig. 6

Fig08-Destination
Fig. 8

The "Output Settings" window displays, as shown in Fig. 7.

Fig09-OutputSettings
Fig. 9

In the "Address" field, paste the INGEST URL (Primary) value from the Azure Media Service channel blade from Step 1.

The Layers are at the bottom of the Wirecast UI. Select the [+] icon to the left of the first layer, as shown inf Fig. 8.

Fig10-LayerIcon
Fig. 10

In the "Add Shot" dialog, expand video capture and select your front facing camera and click the [Add] button, as shown in Fig. 9.

Fig11-AddShot
Fig. 11

You will see the image from the camera in the Preview window, as shown in Fig. 10

Fig12-PreviewWindow
Fig. 12

NOTE: Alternatively, you may wish to share a screen capture or a different camera or one of the other options.

The image captured from your camera will display in the "Preview" window. Make this the live image by clicking the "Go" button (Fig. 11) below the Preview window.

Fig13-GoButton
Fig. 13

The image will now also appear in the Live window to the right of the Preview window, as shown in Fig. 14

Fig14-PreviewAndLive
Fig. 14

From the menu, select Output | Start/Stop Broadcasting | Start RTMP Server, as shown in Fig. 15.

Fig15-Start Broadcasting
Fig. 15

An error displays if the channel is not running or if you improperly copied the Ingest URL.

PART 3: SHARE YOUR LIVE STREAM

Return to the Azure portal and open the "Live Event" blade, as described above.

Click the [Watch] button (Fig. 16)

Fig16-WatchButton
Fig. 16

If successful, you should see your live stream in a preview window, as shown in Fig. 17.

Fig17-ChannelPreview
Fig. 17

You can share the video by copying the "PLAYBACK URL" into any player. I did so using the Azure Media Player The results are shown in Fig. 18.

Fig18-AzureMediaPlayer
Fig. 18

In this article, I showed you how to use Azure Media Services to live stream a video.

Saturday, 25 August 2018 20:47:56 (GMT Daylight Time, UTC+01:00)
# Thursday, 23 August 2018

GCast 10:

Azure Linux Virtual Machines

Learn how to use the Chocolatey package manager to quickly install Windows applications and their dependencies.

DevOps | GCast | Video
Thursday, 23 August 2018 09:09:00 (GMT Daylight Time, UTC+01:00)
# Wednesday, 22 August 2018

19841984 by George Orwell describes a society in which everything is completely controlled by the government, which is controlled by "The Party". Not only are specific actions illegal, but so are many thoughts. Independent thinking, love, and questioning or even doubting the word of The Party are crimes dealt with in the harshest way. The Party has perfected ways of maintaining its authority.

In the giant country of Oceania, it is illegal to question anything the government says. If they tell you that 2+2=5, you must accept this without question.

Citizens routinely disappear, and all traces of their existence are wiped from the public record. Torture is a  common punishment for transgressions.

The country of Oceania is constantly at war with one of the other two countries in the world. No one has seen the war, but the threat of these enemies justifies oppressive measures against the citizens of Oceania.

Citizens are under constant surveillance - from pervasive electronic devices and from other citizens. Every home contains a Telescreen, that broadcasts party programs and watches and hears everything in the room 24 hours a day; Children are encouraged to inform on their parents and workers to turn in their colleagues.

The Party is developing a new language - "Newspeak", which eliminates dissident ideas by removing words that describe free thought as a way of eliminating the very concepts from the minds of the people.

The Party controls all communications, including newspapers, TV, and books. Books that do not glorify The Party are either destroyed or  rewritten.

When The Party changes its name or breaks a promise, or a prediction proves false, all previous news sources are modified to match the current dogma.

The mission of The Ministry of Truth is to rewrite newspapers and other historical records to match the current position of The Party.

Winston Smith is a low-level bureaucrat working in The Ministry of Truth. He has lost faith in the government, but his fear keeps him playing by its rules. Then, he meets and falls in love with Julia. Together they defy The Party by have a secret affair and, eventually, by plotting to actively work against The Party. Smith even keeps a secret diary of his thoughts and doubts - a serious offense.

Their affair gives them brief hope, but The Party is powerful, and its agents are far-reaching. And they know how to manipulate both actions and thoughts. Winston and Julia try desperately to maintain thier humanity, but The Party is desperate to maintain its power. Suffice it to say this is not a happy love story.

This book has maintained its importance in part because it is believable, despite the extremes of the society. It describes how those in power will do almost anything to maintain that power. Orwell's details are extraordinary. He builds a society with controls in place to suppress the populace completely.

If the book has any weakness, it is when it switches to explicit explanations of how the government is conspiring against its own people. For me, it was sufficient to watch Winston and Julia and the rest of the citizenry experience and suffer from these manipulations. But Orwell felt the need to spend pages detailing his warnings, which seems heavy-handed.

Orwell was a disillusioned ex-socialist and some of the novel touches on the failures encountered in socialist countries, such as shortages of essential goods. But 1984 is less about socialism than it is about the absolute corruption of absolute power.

The year 1984 has come and gone without the global dictatorship predicted by Orwell; but the warning signs listed in the book 1984 continue to haunt us today.

Orwell said, "The Party told you to reject the evidence of your eyes and ears" and we see politicians practicing this now. When people in power argue that "Truth is not truth" or "Alternative facts" are as valid as actual facts or that any news critical of themselves is "Fake news", they are exercising the same techniques about which Orwell warned us.  The concept of Thought Crime is still alive, if punishments are not as harsh as in Oceania. The far-right labels "unpatriotic" black men who peacefully protest; while the far left has successfully ruined the lives of people they deemed politically incorrect.

The bleak, dystopian future that Orwell describes has not come to pass. But its warning signs still exist. And 1984 reminds us that we must remain vigilant to avoid this future.

Wednesday, 22 August 2018 20:10:56 (GMT Daylight Time, UTC+01:00)
# Tuesday, 21 August 2018

Azure Media Services allows you to manage video content in a highly-scalable, highly secure way.

Videos and associated files are saved as "Assets" and stored in Azure Blob Storage. You can live stream videos or upload video files from your local system.

In this article, I will walk through the steps to upload, encode, and share a video.

The steps are:

  1. Create a new Azure Media Service
  2. Upload a video
  3. Encode the video
  4. Play the encoded video in the Azure portal
  5. Share the video in another player

Create a new Azure Media Service

The first step is to create a new Azure Media Service. You will need an Azure account to do this.

Navigate to the Azure portal and log in.

Click the [Create a Resource] button (Fig. 1) at the top left of the portal.

Fig01-CreateNewResource
Fig. 1

From the menu, select Mobile | Media Services, as shown in Fig. 2.

Fig02-MobileMediaServices
Fig. 2

The "Create Media Service" blade displays, as shown in Fig. 3.

Fig03-CreateMediaServiceBlade
Fig. 3

At the "Account Name" field, enter a unique name for your Azure Media Service Account.

At the "Resource Group" field, select the "Create new" radio button and enter a unique name for the resource group in which to store this Media Service.

At the "Location" dropdown, select an Azure region that is close to you.

Click the arrow next to the "Storage Account" prompt to expand the "Choose storage account" blade; then, click "Create new" in this blade to display the "Create storage account" blade, as shown in Fig. 4.

Fig04-NewStorageAccount
Fig. 4

Enter a unique name for the storage account in which to store your media assets and click the [OK] button.

Click the [Create] button in the "Create Media Service" blade to begin creating the service. This may take a a minute or so.

Upload a video

After the Media Service is created, open the service and select "Assets" to open the "Assets" blade, as shown in Fig. 5.

Fig05-AssetsBlade
Fig. 5

Click the [Upload] button (Fig. 6) to display the "Upload a video asset" blade, as shown in Fig. 7.

Fig06-UploadButton
Fig. 6

Fig07-UploadAVideoAssetBlade
Fig. 7

Click the Folder icon (Fig. 8) and select a video from your local computer.

Fig08-FolderIcon
Fig. 8

A progress bar indicates when the video has been uploaded. After your video is uploaded, close the "Upload a video asset" blade and  return to the "Assets" blade. The video should now appear in the Asset list, as shown in Fig. 9.

Fig09-AssetList
Fig. 9

Encode the video

In the "Assets" blade list, click on the uploaded video asset to display a property blade for the video asset, as shown in Fig. 10.

Fig10-VideoAssetProperties
Fig. 10

Click the [Encode] button (Fig. 11) to open the "Encode an asset" blade, as shown in Fig. 12.

Fig11-EncodeButton
Fig. 11

Fig12-EncodeAnAssetBlade
Fig. 12

In the "Encoding preset" dropdown, you may select the desired output format, but the default ("Content Adaptive Multiple Bitrate MP4") works well for this demo.

Click the [Create] button to begin encoding.

You can close the property asset blade now.

By staring encoding, you created a new Job for this media service. View this job by selecting "Jobs" in the Media Service blade, which displays the "Jobs" blade, as shown in Fig. 13.

Fig13-JobsBlade
Fig. 13

Note the status of the job you created, which will first be "Queued"; then "Processing"; then "Finished".

When the job is Finished (Fig. 14), close the "Jobs" blade and return to the "Assets" blade, where you should see a new Asset, representing the encoded video.

Fig14-FinishedJob
Fig. 14

Click the encoded asset to open its property page, as shown in Fig. 15.

Fig15-EncodeAssetPropertyPage
Fig. 15

Click the [Publish] button to display the corresponding "Publish the asset" blade, as shown in Fig. 16.

Fig16-PublishTheAsset
Fig. 16

Check the checkbox next to "To begin streaming, start running 'default' streaming endpoint".

Click the [Add] button to publish the encoded video asset.

Play the encoded video in the Azure portal

When the endpoint has started, the [Play] button in the encoded Asset property page is enabled (Fig. 17). Click the [Play] button to open the Media Player blade within the portal, as shown in Fig. 18.

Fig17-PlayButton
Fig. 17

Fig18-MediaPlayer
Fig. 18

Copy the PLAYBACK URL to use in the next step. It will look something like this:

http://dgtestms-usea.streaming.media.azure.net/1acb35e1-373c-481a-b37d-3e0e10394b0a/TelephoneLine.ism/manifest

Share the video in another player

It is unlikely your users will have access to your Azure Portal, so you should send them a link with a player they can use. You can use the free Azure Media Player to share your video.

Navigate to https://ampdemo.azureedge.net/azuremediaplayer.html

The page in Fig. 19 displays.

Fig19-AzureMediaPlayer
Fig. 19

In the URL field, paste your PLAYBACK URL (without the "http://") that you copied from the Azure Portal. It should look something like this:

dgtestms-usea.streaming.media.azure.net/1acb35e1-373c-481a-b37d-3e0e10394b0a/TelephoneLine.ism/manifest

Click the [Update Player] button. Your video should start playing.

To share this video and its players with others, click the [get share url] button and the displayed code. It should look something like this:

https://aka.ms/azuremediaplayer?url=%2F%2Fdgtestms-usea.streaming.media.azure.net%2F1acb35e1-373c-481a-b37d-3e0e10394b0a%2FTelephoneLine.ism%2Fmanifest

You can email this link to others or create a link on your web page.

Click on the dropdown next to the "Code" tab to see other ways to share this video and player.

In this article, I showed you how to upload, encode, and share a video using Azure Media Services.

Azure | Video
Tuesday, 21 August 2018 08:58:00 (GMT Daylight Time, UTC+01:00)
# Monday, 20 August 2018
Monday, 20 August 2018 08:25:00 (GMT Daylight Time, UTC+01:00)