GCast 106:

Audio Transcription and Captioning with Azure Media Services

Azure Media Services can analyze an audio or video file and transcribe speech into text. You can then take the generated files and provide synchronized captioning for your video.


Episode 650

Christos Matskos on Microsoft Identity Platform

Microsoft Identity Platform is a set of authentication service, open-source libraries, and application management tools. Christos Matskas describes these tools and how to use them to make your application more secure.

Links:
https://docs.microsoft.com/en-us/azure/active-directory/develop/
https://docs.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code
https://www.twitch.tv/425show


Fragile Things is a collection of 25 short stories and 7 poems written by Neil Gaiman.

Most of the stories have dark - even macabre - themes. One tells how demons are created in Hell; in another, a man discovers that he has been living his entire life in a computer simulation; still another involves a boy's sexual enslavement by an ultra-rich man.

Some are more fully fleshed out than others, as if Gaiman began a longer novel before giving up; but these are worth including because Gaiman has such a gift for language and knows how to tell a story, even if it is a partial story.

Each story is independent of the others, but some exist in the same universe. For example, the wealthy Mr. Alice and his employee Mr. Smith appear in two different stories.

A couple satires or homages to the writings of other authors - C.S. Lewis's The Chronicles of Narnia and Arthur Conan Doyle's Sherlock Holmes; and a few are inspired by art and music heard by Gaiman.

My favourite entry was the longest and final story in the collection - The Monarch of the Glen, which featured Shadow of American Gods and takes place a couple years after that novel.

Nearly everything in this book has appeared elsewhere and I had already read a few of the stories, but I enjoyed them again this time around.


GCast 105:

Analyzing a Video with Azure Media Services

Learn how to use Azure Media Services to apply Artificial Intelligence and Machine Learning to a video, analyzing such things as face detection, speech-to-text, object detection, and optical character recognition


Episode 649

Richard Taylor on the Microsoft Revenue Recognition System

Richard Taylor is working on a system to process revenue received by tech giant Microsoft. He discusses the challenge in building and maintaining a large system like this and in migrating it to Azure.


Tommy James and the Shondells turned out hit after hit in the 1960s. But James saw very little of the royalties generated by sales of his records. That money was controlled by crime boss Morris Levy, who signed a teenage James to a deal with his Roulette Records in 1966. The band went on to release two #1 records and  a dozen Top 40 singles over the next 5 years.

But Levy was notorious for non-payment of debts including tens of millions of royalties owed to James. James was forced to earn his money through constant touring and profited very little off the sale of his records.

Despite this betrayal, James and Levy maintained a close relationship throughout much of their lives. Levy was excellent at promoting James's music and James enjoyed a great deal of artistic freedom as Roulette's biggest star. James's career also benefited from Levy's strong-arm tactics: He would often bully songwriters into saving their best work for his artists.

Me, the Mob, and the Music: One Helluva Ride with Tommy James and the Shondells is Tommy James's story of life in the spotlight. It contains the usual anecdotes about women and booze and drugs that seem to be part of every rocker's life. But these stories are secondary to his interactions with Roulette and Levy.

The story climaxes in a gang war that sees Levy fleeing the country and James fearing for his life.

One wonders why James continued his relationship with Levy when he was treated so unfairly. Did he feel it was unsafe for him to leave? Was he a victim of Stockholm Syndrome? Did the career advantages of associating with Roulette outweighed the financial disadvantages?

One  wonders if the corruption at Roulette was a microcosm of the corruption in the entire music industry in the 1960s; and if that corruption continues today.

One wonders if Tommy James ever received all the royalties he was due.

Despite the unanswered questions, this book was an enjoyable read about an unlikely hitmaker and his adventures with the underbelly of the industry.


GCast 104:

Sharing a Video Online with Azure Media Services

Learn how to use Azure Media Services to share a video on the web for streaming and/or for downloading.


Episode 648

Julie Lerman on Entity Framework Core 5

Julie Lerman describes some of the new features included in EF Core 5.


Alexander Portnoy has issues.

An overprotective mother left him straddled with guilt and an Oedipal complex. His childhood memories are dominated by unpleasant bodily functions - his father complaining of persistent constipation; his mother accidentally spilling a drop of menstrual blood on the kitchen floor; his own inability to wipe himself completely or to control his masturbation.

Portnoy was raised by Jewish parents, grew up in a Jewish neighborhood, attended a Jewish school, and all his friends were Jewish. As an adult, he became obsessed with seducing attractive non-Jewish women ("shikses", as he calls them). But Portnoy has no interest in a real relationship. When referring to his past lovers, he is more likely to call them by a nickname than to use their real name. He calls his latest lover "The Monkey" after a past sexual incident she confessed to him. This is just one way in which he dehumanizes women, treating them only as sex objects. The Monkey is absurdly ignorant, but Portnoy stays with her because she is beautiful and good in bed; Portnoy is overtly misogynistic, but The Monkey stays with him because she hopes that he will marry her.

Portnoy's Complaint by Philip Roth is a satirical confession of a 33-year-old sex addict, who recognizes his self-destructive behavior and feels extreme guilt over it; but is powerless to correct these flaws. Despite his numerous faults and our very different upbringings, I was able to relate to his life.

The story is humorous, but crude. It is crude, but humorous.

I feel a little guilty for enjoying it so much.


GCast 103:

Encode a Video with Azure Media Services

Learn how to use Azure Media Services to encode a video into multiple formats, including support for adaptive streaming.


In previous articles, I showed how to use Azure Media Services (AMS) to work with video that you upload. In this article, I will show how to broadcast a live event using AMS.

Before you get started, you will need some streaming software. For the demo in this article, I used Wirecast from Telestream. Telestream offers a free version, which is good for learning and demos but not for production, as it places a watermark on all streaming videos.

You will need to create an Azure Media Services account, as described in this article.

After the Media Service is created, navigate to the Azure Portal and to your Azure Media Services account, as shown in Fig. 1.

ams01-OverviewBlade
Fig. 1

Then, select "Live streaming" from the left menu to open the "Live streaming" blade, as shown in Fig. 2.

ams02-LiveStreamingBlade
Fig. 2

Click the [Add live event] button (Fig. 3) to open the "Create live event dialog", as shown in Fig. 4.

ams03-AddLiveEventButton
Fig. 3

ams04-CreateLiveEvent
Fig. 4

At the "Live event name" field, enter a name for your event.

You may optionally enter a description and change the Encoding, Input protocol, Input ID, or Static hostname prefix.

Check the "I have all the rights..." checkbox to indicate you are not streaming content owned by anyone other than yourself.

Click the [Review + create] button to display the summary page, as shown in Fig. 5.

ams05-CreateLiveEventConfirmation
Fig. 5

If any validation errors display, return to the "Basics" page, and correct them.

Click the [Create] button to create the live event.

When the event is created, you will return to the "Live streaming" blade with your event listed, as shown in Fig. 6.

ams06-LiveStreamingBlade
Fig. 6

Click the event name link to display the event details, as shown in Fig. 7.

ams07-LiveEvent
Fig. 7

Click the [Start] button (Fig. 8) and click [Start] on the confirmation popup (Fig. 9) to start the event.

ams08-StartButton
Fig. 8

ams09-ConfirmStart
Fig. 9

When the event is started, the event details page will show information about the input, as shown in Fig. 10.

ams10-LiveEvent
Fig. 10

The "Input URL" textbox (Fig 11) displays a URL that you will need in your streaming software. Copy this URL and save it somewhere. You will need it in your streaming software.

ams11-InputUrl
Fig. 11

For the next part, you will need some streaming software. I used Wirecast from Telestream. The user interface of the free demo version is shown in Fig. 12.

ams12-Wirecast
Fig. 12

The following steps are specific to Wirecast, but other streaming software will have similar steps.

Click the [+] button on the first layer (Fig. 13) to open the "Add Shot" dialog, as shown in Fig. 14.

ams13-Layer
Fig. 13

ams14-AddLayer
Fig. 14

I chose to share the image captured by my webcam, but you can share screen captures or videos, if you like. The image you are capturing will be set as a "preview". Make this same layer broadcast live by clicking the "Live" button (Fig. 15).

ams15-GoButton
Fig. 15

Now, configure your streaming software to send its live video to your AMS Live Streaming event. Select Output | Output Settings... from the menu to open the Output dialog, as shown in Fig. 16.

ams16-OutputSettings
Fig. 16

Select "RTMP Server" from the "Destination" dropdown and click the [OK] button to open the "Output settings" dialog, as shown in Fig. 17.

ams17-OutputSettings
Fig. 17

In the "Address" text box, paste the Input URL that you copied from the AMS Live Stream event. Click the [OK] button to close the dialog.

Your UI should look similar to the following.

To begin streaming, select Output | Start / Stop Broadcasting | Start All from the menu, as shown in Fig. 18.

ams18-StartOutput
Fig. 18

Your UI should look similar to Fig. 19.

ams19-Wirecast
Fig. 19

Return to the Azure Media Services live event. You should see a preview of what you are broadcasting from your streaming software, as shown in Fig. 20. Refresh the page if you do not see it. There may be a few seconds delay between what is captured and what is displayed.

ams20-LiveEvent
Fig. 20

Click the [+ Create an output] button (Fig. 21) to open the "Create an output" dialog with the "Create output" tab selected, as shown in Fig. 22.

ams21-CreateAnOutput
Fig. 21

ams22-CreateOutputDialog
Fig. 22

Verify the information on this tab; then, click the [Next: Add streaming locator] button to advance to the "Add streaming locator" tab, as shown in Fig. 23.

ams23-CreateOutput
Fig. 23

Verify the information on this tab; then, click the [Create] button to create a streaming locator and endpoint. You will return to the live event blades, as shown in Fig. 24.

ams24-StreamingEndpoint
Fig. 24

Click the [Start streaming endpoint] button, then click the confirmation [Start] button, as shown in Fig. 25.

ams25-StartStreamingEndpoint
Fig. 25

After the streaming endpoint is started, copy the "Streaming URL" textbox contents (Fig. 26). You will need this to create an output page for viewers to watch your live event.

ams26-StreamingUrl
Fig. 26

Create and launch a web page with the HTML in Listing 1.

Listing 1:


 lang="en">

    </span>Azure Media Services Demo<span style="color: rgb(0, 119, 0);">
     href="https://amp.azure.net/libs/amp/2.3.6/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
    


    

Video

id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" data-setup='{"nativeControlsForTouch": false}'> src="STREAMING_URL" type="application/vnd.ms-sstr+xml" />

where STREAMING_URL is the Streaming URL you copied from the live event textbox above.

Listing 2 shows an example with the URL filled in.

Listing 2:


 lang="en">

    </span>Azure Media Services Demo<span style="color: rgb(0, 119, 0);">
     href="https://amp.azure.net/libs/amp/2.3.6/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
    


    

Video

id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" data-setup='{"nativeControlsForTouch": false}'> src="https://dgtestams-usea.streaming.media.azure.net/45fb391c-8e10-4d41-a0ab-a03e50d57afd/cb4a49d9-93ad-4bb1-8894-c3f0a9fb7d43.ism/manifest" type="application/vnd.ms-sstr+xml" />

With the live event running, your web page should display something similar to Fig. 27.

ams27-WebPage
Fig. 27

If this is published on the web, viewers will be able to watch your live stream from just about anywhere.

Be sure to stop your live event when you finish broadcasting in order to avoid unnecessary charges.

In this article, I showed you how to create a live streaming event using Azure Media Services.


Kevin Pilch on gRPC

Comments [0]

Episode 647

Kevin Pilch on gRPC

Kevin Pilch describes gRPC - an open source system for making remote calls across processes and/or machines - and the .NET Core implementation of this system.

https://docs.microsoft.com/en-us/aspnet/core/grpc/?view=aspnetcore-5.0

January 2021 Gratitudes

Comments [0]

2/7
Today I am grateful for the imagination of Jon Favreau.

2/6
Today I am grateful to learn from my teammates.

2/5
Today I am grateful to watch yesterday's snowstorm from my warm safe home.

2/4
Today I am grateful for a productive day yesterday.

2/3
Today I am grateful for:
-a chance to catch up with J for the first time in months
-Christina, who answered my questions about Photoshop and Lightroom

2/2
Today I am grateful for 3 years in my current home.

2/1
Today I am grateful to go to the gym yesterday for the first time in months.

1/31
Today I am grateful for online Mass.

1/30
Today I am grateful for home-cooked meals.

1/29
Today I am grateful to deliver my first presentation of the year last night.

1/28
Today I am grateful for technical support from co-workers.

1/27
Today I am grateful to be a guest yesterday on the Visual Studio Toolbox show.

1/26
Today I am grateful for all the interviews with interesting people I've scheduled for #TechnologyAndFriends

1/25
Today I am grateful for a visit to the Indianapolis Art Museum yesterday.

1/24
Today I am grateful for a walk around Zionsville and Carmel yesterday.

1/23
Today I am grateful for an upgraded hotel room.

1/22
Today I am grateful for funny memes.

1/21
Today I am grateful to see so much hope and optimism expressed by so many people about yesterday's historic events.

1/20
Today I am grateful for a call from my cousin Kevin last night.

1/19
Today I am grateful for my new drone.

1/18
Today I am grateful for the legacy of Rev. Dr. Martin Luther King, Jr, who understood that non-violence was not a weakness.

1/17
Today I am grateful for a much-needed mid-afternoon nap yesterday.

1/16
Today I am grateful to everyone who shared photos of their dogs yesterday.

1/15
Today I am grateful for dogs.

1/14
Today I am grateful to spend the past few evenings sorting through photographs and papers of my late mother.

1/13
Today I am grateful for lots of advice yesterday on how to cook pasta.

1/12
Today I am grateful to restaurants who have worked to make outdoor dining safer in Chicago winter.

1/11
Today I am grateful for my new cabinet/end table.

1/10
Today I am grateful for Indian food.

1/9
Today I am grateful for good health.

1/8
Today I am grateful for my new laptop.

1/7
Today I am grateful for dinner with Tim and Natale last night before they drive to Austin tomorrow.

1/6
Today I am grateful for a virtual lunch with Annie yesterday.

1/5
Today I am grateful for a regular exercise routine.

1/4
Today I am grateful to return to work after an extended vacation.


GCast 102:

Video Files and Azure Media Services

Learn the capabilities of Azure Media Services, how to create an Azure Media Services account, and how to add audio and video files as Assets in that account.


In a previous article, I showed how to embed into a web page a video encoded with Azure Media Services (AMS).

In this article, I will show you how to add captions to that video.

In my last article, I showed you how to perform audio transcription with Azure Media Services using an Audio Transcription Job. Among other things, this generates a transcript.vtt file with speech-to-text data, listing anything spoken in the video, along with the time at which the words were spoken.

You can also generate this data by using the "Video and Audio Analyzer" job, as described in this article.

For this work, the transcript.vtt file must be in the same folder as the video(s) playing on your web page. A simple way to do this is to download the file from its current container and upload it into the Encoded Video container.

Navigate to the Azure Portal and to your Azure Media Services account, as shown in Fig. 1.

ams01-OverviewBlade
Fig. 1

Then, select "Assets" from the left menu to open the "Assets" blade, as shown in Fig. 2.

ams02-AssetsBlade
Fig. 2

Select the Output Asset containing Audio Transcription or Analyzer data to display the Asset details page, as shown in Fig. 3.

ams03-AssetDetails
Fig. 3

Click the link next to the "Storage container" label (Fig. 4) to open the Storage Blob container associated with this asset, as shown in Fig. 5. This container should open in a new browser tab.

ams04-StorageContainerLink
Fig. 4

ams05-Container
Fig. 5

Click the "transcript.vtt" row to open the blob blade showing details of the transcript.vtt blob, as shown in Fig. 6.

ams06-VttBlobDetails
Fig. 6

Click the download button (Fig. 7) in the top toolbar and save the transcript.vtt file on your local disc. Note where you save this file.

ams07-DownloadButton
Fig. 7

Listing 1 shows a sample VTT file.

Listing 1

WEBVTT

NOTE duration:"00:00:11.0290000"

NOTE language:en-us

NOTE Confidence: 0.90088177

00:00:00.000 --> 00:00:04.956 
 This video is about Azure Media Services

NOTE Confidence: 0.90088177

00:00:04.956 --> 00:00:11.029 
 and Azure Media Services are. Awesome.
  

Navigate again to the "Assets" blade, as shown in Fig. 8.

ams08-AssetsBlade
Fig. 8

In the row of the Analyzer or Audio Transcription asset, click the link in the "Storage link" column to open the container associated with this asset, as shown in Fig. 9.

ams09-Container
Fig. 9

Click the upload button (Fig. 10) to open the "Upload blob" dialog, as shown in Fig. 11.

ams10-UploadButton
Fig. 10

ams11-UploadBlobDialog
Fig. 11

Click the "Select a file" field to open a file navigation dialog. Navigate to the older where you stored transcript.vtt and select this file. Then, click the [Upload]

When the dialog closes, you should return to the Container blade and transcript.vtt should now be listed, as shown in Fig. 12.

ams12-Container
Fig. 12

Click to open the asset containing the video(s) used to generate the VTT file, as shown in Fig. 13.

ams13-AssetDetails
Fig. 13

Start the Streaming Locator, if it is not already started. If you have not yet created a Streaming Locator, this article walks you through it.

Copy the Streaming URL and save it somewhere. It should begin with "https://" and end with "manifest".

As a reminder, Listing 2 shows the HTML to embed an AMS video in a web page. This is the code shown in this article.

Listing 2:

 
< html lang="en"> 
< head> 
    </span>Azure Media Services Demo<span style="color: rgb(0, 119, 0);"> 
     href="https://amp.azure.net/libs/amp/2.3.6/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet"> 
     
< /head> 
< body> 
    

Video

id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" data-setup='{"nativeControlsForTouch": false}'> src="STREAMING_URL_MANIFEST" type="application/vnd.ms-sstr+xml" /> default />--> < /body> < /html>

where STREAMING_URL_MANIFEST is replaced with the Streaming URL you copied from the video asset.

To add captions to this video, add a tag inside the

Listing 3

 
< html lang="en"> 
< head> 
    </span>Azure Media Services Demo<span style="color: rgb(0, 119, 0);"> 
     href="https://amp.azure.net/libs/amp/2.3.6/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet"> 
     
< /head> 
< body> 
    

Video

id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" data-setup='{"nativeControlsForTouch": false}'> src="STREAMING_URL_MANIFEST" type="application/vnd.ms-sstr+xml" /> src="VTT_URL" label="english" kind="subtitles" srclang="en-us" default /> < /body> < /html>

where VTT_URL is replaced with a URL consisting of the same domain and folder as in the src attribute of the source tag, but with "transcript.vtt" as the file name.

Listing 4shows an example using an Azure Media Services account that I have since deleted.

Listing 4:


 lang="en">

    </span>Azure Media Services Demo<span style="color: rgb(0, 119, 0);">
     href="https://amp.azure.net/libs/amp/2.3.6/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
    


    

Video

id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" data-setup='{"nativeControlsForTouch": false}'> src="https://dgtestblogams-usea.streaming.media.azure.net/232493e2-8c99-41a0-bb09-5a0aea47de35/3b331fca-41e6-458c-8171-235ef3f76875.ism/manifest" type="application/vnd.ms-sstr+xml" /> src="https://dgtestblogams-usea.streaming.media.azure.net/29a650b6-5c0a-4932-8efb-2b4bb4a81bf0/transcript.vtt" label="english" kind="subtitles" srclang="en-us" default />

Add this HTML file to any web server and navigate to its URL using a web browser. You should see a page with your video embedded and with captions displaying at the bottom of the video, as shown in Fig. 14.

ams14-VideoWithCaptions
Fig. 14

In this article, I showed you how to include captions in an Azure Media Services video embedded in a web page.


In a previous article, I showed you how to use Azure Media Services (AMS) to analyze a video. Among other things, this analysis performs audio transcription to perform text to speech on your video. This outputs 2 files with the spoken text in the audio track of your video.

You may want to only do audio transcription. If you are not interested in the other analysis output, it does not make sense to spend the time or compute on analyzing a video for the other features. AMS allows you to perform only Audio Transcription and eschew the other analysis.

Navigate to the Azure Portal and to your Azure Media Services account, as shown in Fig. 1.

ams01-OverviewBlade
Fig. 1

Then, select "Assets" from the left menu to open the "Assets" blade, as shown in Fig. 2.

ams02-AssetsBlade
Fig. 2

Select the Input Asset you uploaded to display the Asset details page, as shown in Fig. 3.

ams03-AssetDetails
Fig. 3

Click the [Add job] button (Fig. 4) to display the "Create a job" dialog, as shown in Fig. 5.

ams04-AddJobButton
Fig. 4

ams05-CreateJob
Fig. 5

At the "Transform" field, select the "Create new" radio button.

At the "Transform name" textbox, enter a name to help you identify this Transform.

At the "Description" field, you may optionally enter some text to describe what this transform will do.

At the "Transform type" field, select the "Audio transcription" radio button.

At the "Analysis type" field, select the "Video and audio" radio button.

The "Automatic language detection" section allows you to either specify the audio language or allow AMS to figure this out. If you know the language, select the "No" radio button and select the language from the dropdown list. If you are unsure of the language, select the "Yes" radio button to allow AMS to infer it.

The "Configure Output" section allows you to specify where the generated output assets will be stored.

At the "Output asset name" field, enter a descriptive name for the output asset. AMS will suggest a name, but I prefer the name of the Input Asset, followed by "_AudioTranscription" or something more descriptive.

At the "Asset storage account" dropdown, select the Azure Storage Account in which to save a container and the blob files associated with the output asset.

At the job name, enter a descriptive name for this job. A descriptive name is helpful if you have many jobs running and want to identify this one.

At the "Job priority" dropdown, select the priority in which this job should run. The options are "High", "Low", and "Normal". I generally leave this as "Normal" unless I have a reason to change it. A High priority job will run before a Normal priority job, which will run before a Low priority job.

Click the [Create] button to create the job and queue it to be run.

You can check the status of the job by selecting "Transforms + jobs" from the left menu to open the "Transforms + jobs" blade (Fig. 6) and expanding the job you just created (Fig. 7).

ams06-TransformsJobs
Fig. 6

ams07-ExpandJob
Fig. 7

The state column tells you whether the job is queued, running, or finished.

Click the name of the job to display details about the job, as shown in Fig. 8.

ams08-JobDetails
Fig. 8

After the job finishes, when you return to the "Assets" blade, you will see the new output Asset listed, as shown in Fig. 9.

ams09-AssetsBlade
Fig. 9

Click the name of the asset you just created to display the Asset Details blade, as shown in Fig. 10.

ams10-AudioTranscriptionAssetDetails
Fig. 10

Click the link to the left of "Storage container" to view the files in Blob storage, as shown in Fig. 11.

ams11-Container
Fig. 11

The speech-to-text output can be found in the files transcript.ttml and transcript.vtt. These two files contain the same information - words spoken in the video and times they were spoken - but they are in different standard formats.

Listing 1 shows a sample TTML file for a short video, while Listing 2 shows a VTT file for the same video.

Listing 1:


  xml:lang="en-US" xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ttm="http://www.w3.org/ns/ttml#metadata">
   
     
       Copyright (c) 2013 Microsoft Corporation.  All rights reserved.
     
     
        xml:id="Style1" tts:fontFamily="proportionalSansSerif" tts:fontSize="0.8c" tts:textAlign="center" tts:color="white" />
     
     
        style="Style1" xml:id="CaptionArea" tts:origin="0c 12.6c" tts:extent="32c 2.4c" tts:backgroundColor="rgba(0,0,0,160)" tts:displayAlign="center" tts:padding="0.3c 0.5c" />
     
   
    region="CaptionArea">
     
begin="00:00:00.000" end="00:00:07.080">This video is about Azure Media Services and Azure Media

begin="00:00:07.206" end="00:00:08.850">Services are.

begin="00:00:08.850" end="00:00:11.029">Awesome.

Listing 2:

WEBVTT

NOTE duration:"00:00:11.0290000"

NOTE language:en-us

NOTE Confidence: 0.90088177

00:00:00.000 --> 00:00:04.956 
This video is about Azure Media Services

NOTE Confidence: 0.90088177

00:00:04.956 --> 00:00:11.029 
and Azure Media Services are. Awesome.
  

Ready Player Two by Ernest Cline continues the story of Wade Watts that began in the author's first novel "Ready Player One" - a novel of the near future that was a huge hit with middle aged nerds.

Wade and his friends are now in control of the largest company in the world. This company that controls the OASIS - a virtual world in which people can escape and live out their fantasies. Wade is rich and famous, but he is not happy. He has lost his girlfriend, has little contact with his friends, and is unpopular with the public and he is to blame for most of his problems. His world turns even worse when a malevolent AI within the OASIS hacks the entire system, trapping millions of users inside and threatening to kill them unless Wade and friends complete a quest to find the Seven Shards.

The hook of this novel is not dissimilar to the earlier one: young people must navigate a virtual world, showing off their video game proficiency and knowledge of late 20th century pop culture to overcome a series of challenges .

There are a couple key differences with the earlier novel: RP2 has a much darker tone than RP1; and there is a narrower focus on pop culture in this one. While RP1 bombarded the reader with an enormous amount of 1980s and 1990s references, RP2 dives deeper into fewer topic topics, such as Tolkien's Middle Earth, the music of Prince, and the movies of John Hughes. The lines between good and evil are less clearly drawn.

I appreciated that this book acknowledges a glaring logic hole in its predecessor. The earlier novel presented the creators of the OASIS as benevolent geniuses trying to build an alternate, better world than the dystopia outside. But it ignored one important corollary: as people spent more time escaping into virtual reality or supporting its infrastructure and economy, they neglected the real world even more, causing contributing to its accelerated deterioration. "Ready Player Two" raises this issue and highlights even more flaws in the OASIS creators. The addictive nature of the virtual world is intensified by the introduction of headsets that offer a more immersive experience by interacting directly with the user's brain waves.

With a film adaptation almost certain, it was difficult to read it without envisioning how it would translate to a big screen with expensive CGI affects.

Ready Player Two presents a familiar formula which will resonate with Cline's fans. We can see the themes Cline is addressing: The corruption of wealth and power; The dangers of addiction; and the inevitable disappointment of hero worship. But the execution lacks the originality and charm of the first book. Still, I found it to be enjoyable escapism.


GCast 101:

Azure Resource Groups

What are the advantages of Azure Resource Groups? How do I create and manage a Resource Group?


Episode 644

Dustin Campbell on Support for WinForms to the Visual Studio Designer

Dustin Campbell recently updated the tooling in Visual Studio to support WinForms and other legacy applications. He describes the challenges in doing so and how he and his team attacked them.


William Faulkner's The Sound and the Fury tells the story of the Compsons - a family that once held power, money, and influence in Jefferson, Mississippi. The Compsons have fallen on hard times. One son was born mentally handicapped; another suffered from depression and committed suicide; a third son grew up to be a cynical, greedy, dishonest racist and the family has disowned their promiscuous daughter after the birth of her illegitimate child. An alcoholic father and a hypochondriac mother complete the picture of a family in despair. From southern aristocracy, the Compsons have deteriorated in wealth, social position, and morality.

The book tells the story of the family's fall from grace, but it does so in such a roundabout way that the reader is forced to work hard to understand their fate.

I almost did not finish this novel. There are four chapters and I had to read the first two at least twice before it made any sense to me. The narrative jumps rapidly between time periods - often with no warning other than a change in font, and often with no indication of which time is addressed. It is made more difficult by the fact it is narrated by the childlike Benji. Much of the book is written in first person and the stream of consciousness style makes for challenging reading.

Eventually, a story emerges. Faulkner tells the same events from different points of view and we get a vision of characters as they see themselves and as others see them.

If one can get past the obtuse first half of this novel, this is a satisfyingly dark story of people dealing with loss.


In a previous article, I showed you how to upload an asset to an Azure Media Services (AMS) account. In this article, you will learn how to use Azure Media Services to analyze a video.

Navigate to the Azure Portal and to your Azure Media Services account, as shown in Fig. 1.

ams01-OverviewBlade
Fig. 1

Then, select "Assets" from the left menu to open the "Assets" blade, as shown in Fig. 2.

ams02-AssetsBlade
Fig. 2

Select the Input Asset you uploaded to display the Asset details page, as shown in Fig. 3.

ams03-AssetDetails
Fig. 3

Click the [Add job] button (Fig. 4) to display the "Create a job" dialog, as shown in Fig. 5.

ams04-AddJobButton
Fig. 4

ams05-CreateJobBlade
Fig. 5

At the "Transform" field, select the "Create new" radio button.

At the "Transform name" textbox, enter a name to help you identify this Transform.

At the "Description" field, you may optionally enter some text to describe what this transform will do.

At the "Transform type" field, select the "Video and audio analyzer" radio button.

At the "Analysis type" field, select the "Video and audio" radio button.

The "Automatic language detection" section allows you to either specify the audio language or allow AMS to figure this out. If you know the language, select the "No" radio button and select the language from the dropdown list. If you are unsure of the language, select the "Yes" radio button to allow AMS to infer it.

The "Configure Output" section allows you to specify where the generated output assets will be stored.

At the "Output asset name" field, enter a descriptive name for the output asset. AMS will suggest a name, but I prefer the name of the Input Asset, followed by "_Analysis" or something more descriptive.

At the "Asset storage account" dropdown, select the Azure Storage Account in which to save a container and the blob files associated with the output asset.

At the job name, enter a descriptive name for this job. A descriptive name is helpful if you have many jobs running and want to identify this one.

At the "Job priority" dropdown, select the priority in which this job should run. The options are "High", "Low", and "Normal". I generally leave this as "Normal" unless I have a reason to change it. A High priority job will run before a Normal priority job, which will run before a Low priority job.

Click the [Create] button to create the job and queue it to be run.

You can check the status of the job by selecting "Transforms + jobs" from the left menu to open the "Transforms + jobs" blade (Fig. 6) and expanding the job you just created (FIg. 7).

ams06-TransformJobs
Fig. 6

ams07-ExpandJob
Fig. 7

The state column tells you whether the job is queued, running, or finished.

Click the name of the job to display details about the job, as shown in Fig. 8.

ams08-JobDetails
Fig. 8

After the job finishes, when you return to the "Assets" blade, you will see the new output Asset listed, as shown in Fig. 9.

ams09-AssetsBlade
Fig. 9

Click on the link in the "Storage link" column to view the files in Blob storage, as shown in Fig. 10.

ams10-Container
Fig. 10

AMS Analytics produces the following text files:

File Name Contents
annotations.json A set of tags identifying objects and actions at various poinst throughout the video
contentmoderation.json Information at time points throughout the video, indicating if the video contains racy and/or adult content and should be reviewed.
emotions.json An analysis of emotions displayed on the faces in the video
faces.json Details of each face detected in the video at various time points
insights.json A file containing information on faces, OCR, and transcriptions at time points throughout the video
lid.json Spoken languages detected at various time points throughout the video
metadata.json Data about the video and audio tracks, such as format and size
ocr.json The text of any words displayed on screen
rollingcredits.json Information about rolling credits displayed, if any
transcript.ttml A transcription of any spoken text in the video, in Timed Text Markup Language (TTML) format
transcript.vtt A transcription of any spoken text in the video, in WebVTT format

In addition, you will find thumbnail images taken from the video as JPG files or as a ZIP file containing multiple JPG files.

In this article, you learned how to use Azure Media Services to analyze an Audio / Video file


GCast 100:

Creating a Screencast

In this video, I walk you through how I create screencasts for this show and publish it online.


In a previous article, I showed you how to use Azure Media Services to generate a Streaming Locator so that others can view and/or download your video.

In this article, I will show you how to create a web page that allows users to select the format and resolution in which they want to view your video. 

Navigate to the Azure Portal and to your Azure Media Services account, as shown in Fig. 1

ams01-OverviewBlade
Fig. 1

Then, select "Assets" from the left menu to open the "Assets" blade, as shown in Fig. 2.

ams02-AssetsBlade
Fig. 2

Select the Output Asset created by encoding your input video Asset to display the Asset details page, as shown in Fig. 3.

ams03-AdaptiveStreamingAsset
Fig. 3

Verify that the Streaming Locator exists and is running. Start it, if necessary.

Click the "View locator" link to display the "Streaming URLs" dialog, as shown in Fig. 4.

ams04-StreamingUrlsBlade
Fig. 4

Scroll down to the "SmoothStreaming" section shown in Fig. 5.

ams05-SmoothStreaming
Fig. 5

The SmoothStreaming URL points to a file named "manifest", which is an XML document with information on available encoded videos in this asset. A sample of such a document is in Listing 1.

Listing 1:

 
< SmoothStreamingMedia MajorVersion="2" MinorVersion="2" Duration="110720000" TimeScale="10000000"> 
    < StreamIndex Chunks="2" Type="audio" Url="QualityLevels({bitrate})/Fragments(aac_und_2_127999_2_1={start time})" QualityLevels="1" Language="und" Name="aac_und_2_127999_2_1"> 
        < QualityLevel AudioTag="255" Index="0" BitsPerSample="16" Bitrate="127999" FourCC="AACL" CodecPrivateData="1190" Channels="2" PacketSize="4" SamplingRate="48000" /> 
         t="0" d="60160000" /> 
         d="50560000" /> 
     
    < StreamIndex Chunks="2" Type="video" Url="QualityLevels({bitrate})/Fragments(video={start time})" QualityLevels="4"> 
        < QualityLevel Index="0" Bitrate="2478258" FourCC="H264" MaxWidth="1024" MaxHeight="576" CodecPrivateData="000000016764001FACD94040049B0110000003001000000303C0F18319600000000168EBECB22C" /> 
        < QualityLevel Index="1" Bitrate="1154277" FourCC="H264" MaxWidth="640" MaxHeight="360" CodecPrivateData="000000016764001EACD940A02FF970110000030001000003003C0F162D960000000168EBECB22C" /> 
        < QualityLevel Index="2" Bitrate="731219" FourCC="H264" MaxWidth="480" MaxHeight="270" CodecPrivateData="0000000167640015ACD941E08FEB0110000003001000000303C0F162D9600000000168EBECB22C" /> 
        < QualityLevel Index="3" Bitrate="387314" FourCC="H264" MaxWidth="320" MaxHeight="180" CodecPrivateData="000000016764000DACD941419F9F0110000003001000000303C0F14299600000000168EBECB22C" /> 
         t="0" d="60000000" /> 
         d="50333333" /> 
     
< /SmoothStreamingMedia>
  

Notice there are two tags: One for the audio and one for the video. The StreamIndex audio tag has only one child tag, indicating that there is only one audio option. The StreamIndex video tag has four child tags, indicating that there are four video options - each wiht a different size and bitrate.

We can add the SmoothStreaming manifest URL to an HTML

Listing 2:

                     
                           id="vid1" 
                           class="azuremediaplayer amp-default-skin" 
                           autoplay 
                            controls 
                           width="848" 
                            height="480" 
                           data-setup='{"nativeControlsForTouch": false}'> 
                          
                                src="https://dgtestams-usea.streaming.media.azure.net/77ec142c-e655-41a2-8ddb-a3e46168751a/WIN_20201215_14_28_08_Pro.ism/manifest" 
                                 type="application/vnd.ms-sstr+xml" /> 
                     
  

A full web page is shown in Listing 3:

Listing 3:


    
         href="https://amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet" />
        
    
    
         id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="848" height="480" data-setup='{"nativeControlsForTouch": false}'>
             src="https://dgtestams-usea.streaming.media.azure.net/77ec142c-e655-41a2-8ddb-a3e46168751a/WIN_20201215_14_28_08_Pro.ism/manifest" type="application/vnd.ms-sstr+xml" />
        
    

  
  

Fig. 6 shows the output of Listing 3 when viewed in a browser.

ams06-VideoTagInBrowser
Fig. 6

As you can see, clicking the "Quality" icon at the bottom right of the player allows the viewer to select the quality of the video. This is helpful if the user is on a lower bandwidth.

Note that you are charged extra when the Streaming Locator is running, so it is important to stop the Locator if you do not need it.

In this article, you learned how to use the SmoothStreaming URL to add your video to a web page.


In a previous article, I showed you how to use Azure Media Services to encode a video.

In this article, I will show you how to generate a URL, allowing others to view your encoded video online.

Navigate to the Azure Portal and to your Azure Media Services account, as shown in Fig. 1

ams01-OverviewBlade
Fig. 1

Then, select "Assets" from the left menu to open the "Assets" blade, as shown in Fig. 2.

ams02-AssetsBlade
Fig. 2

Select the Output Asset created by encoding your input video Asset to display the Asset details page, as shown in Fig. 3.

ams03-AdaptiveStreamingAsset
Fig. 3

Click the [New streaming locator] button (Fig. 4) to display the "Add streaming locator" dialog, as shown in Fig. 5.

ams04-NewStreamingLocatorButton
Fig. 4

ams05-AddStreamingLocatorBlade
Fig. 5

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

At the "Streaming policy" dropdown, select a desired Streaming Policy. A Streaming Policy define streaming protocols and encryption options. There are options to allow for streaming online or downloading and for adding encryption and Digital Rights Management. For this demo, I have selected "Predefined_DownloadAndClearStreaming". This allows users to view the video online and to download it; and it adds no encryption or DRM.

The flowchart in Fig. 7 is from the Microsoft Azure Documentation and will help you decide which Streaming policy is right for you.

ams06-StreamingPolicyFlowchart
Fig. 6

The Streaming Endpoint will not last forever. You must include an expiration date and time. By default, this is set to 100 years in the future. Change this if you want your video to be accessible for a shorter period of time.

Click the [Add] button to add the Streaming Locator.

The dialog will close and return you to the output Assets details page with the Streaming URL filled in, as shown in Fig. 7.

ams07-StartStreamingEndpoint
Fig. 7

The URL is still not accessible until you start the streaming endpoint. Click the [Start streaming endpoint] button and the [Start] button in the popup dialog to enable the endpoint URL, as shown in Fig. 8.

ams08-ConfirmStartStreamingEndpoint
Fig. 8

After doing this, the Streaming locator will show as "STREAMING" on the output Asset details page, as shown in Fig. 9. When the Streaming endpoint is started, you can preview the video from within the Asset details page.

ams09-ViewLocator
Fig. 9

Click the "View locator" link to display the "Streaming URLs" dialog. Select the "Streaming endpoint" from the dropdown, as shown in Fig. 10.

ams10-StreamingUrlsBlade
Fig. 10

Many URLs are displayed in this dialog. For the encoding I selected, the "Download" section contains a JPG URL and several MP4 URLs, as shown in Fig. 11.

ams11-Downloads
Fig. 11

You can paste the JPG URL into a browser to view a thumbnail image from the video. You can paste any of the MP4 URLs into a browser to view or download the full video. The MP4 URLs may differ by their resolution and encoding. Clues about which is which can be found in the name of each MP4. The JSON URLs provide metadata about the video and can be used in applications. For example,
https://dgtestams-usea.streaming.media.azure.net/77ec142c-e655-41a2-8ddb-a3e46168751a/WIN_20201215_14_28_08_Pro_1024x576_AACAudio_2478.mp4
contains a video that is 1024 pixels wide by 576 pixels high and was encoded with Advanced Audio Coding (AAC).

Try each of these in your browser to see the differences.

Note that you are charged extra when the Streaming Locator is running, so it is important to stop the Locator if you do not need it.

In this article, you learned how to create and start a Streaming Locator to make your Azure Media Services video available online.


Episode 645

Kevin Griffin on SignalR Real World Projects

Kevin Griffin describes some real-world applications that he has built using SignalR, including one system that saves lives.

http://signalrmastery.com/


When the parents of Miles and Flora died, their uncle did not wish to raise them, so he hired a governess. The governess arrives at rural Bly Manor to find two sweet children - one of whom has been recently expelled from boarding school. She also begins to see spectral characters wandering the estate. The specters appear to be the ghosts of Miss Jessel - the previous governess - and Peter Quint - another employee of the uncle. In life, Jessel and Quint had a close relationship with the children and this relationship seems to continue after their deaths.

Henry James's The Turn of the Screw is a gothic ghost story, told in a mostly straightforward narrative. The young woman arrives and experiences the haunting and tries to protect the children under her care, fearing that they were corrupted by the ghostly couple before and after their deaths. The story is told in the first person with the unnamed governess acting as narrator, so we never know for sure if the ghosts exist outside of her own mind.

The American James does a good job in creating an English story and we get a feel for the gothic atmosphere and the British dialogue.

The author's biggest problem is that he frequently uses ten words to express a thought when five would easily do. As a result, his writing comes across as pretentious. It was difficult for me to get past this and enjoy the story.


In March 1965, Alabama police attacked a group of peaceful protestors as they crossed the Edmund Pettus Bridge in Selma, Alabama. John Lewis was among those participating in the Martin Luther King-led march protesting the state's racist unfair voting laws. Lewis was beaten and left bruised and bloodied that day.

Lewis's 2017 book Across That Bridge tells the story of that march; but it tells much more.

Lewis, who passed away last year at the age of 80, served over three decades as a US Congressman and spent and spent much of that time fighting for the rights of underrepresented and marginalized people. His place in the American Civil Rights movement is well-known and he provides insights from his experiences and from lives of Mahatma Ghandi, Bobby Kennedy, Nelson Mandela, and others.

Lewis relates key moments in the history of Civil Rights and places them in perspective. From these events, he draws his lessons about the effectiveness of nonviolent protests and a blueprint for this country going forward.

This book is part history; part autobiography; and part inspirational message. He divides it into short on the topics of faith, patience, study, act, peace, love, and reconciliation.

Here sampling of what Lewis has to say here:

"Freedom is not a state; it is an act."

"Nothing can stop the power of a committed and determined people to make a difference in our society. Why? Because human beings are the most dynamic link to the divine on this planet."

"Every generation leaves behind a legacy. What that legacy will be is determined by the people of that generation. What legacy do you want to leave behind?"

While not a comprehensive study, they complement one another well enough to make reading it worthwhile.


In the last article, I showed you how to add Assets to an Azure Media Services (AMS) account. An Asset can point to an audio or video file, but you will want to encode that file to allow others to consume it. There are many encoding options. By encoding an audio or video, we can convert it into a format that can be consumed by others.

Those who are consuming your media are not all using the same systems. They may have different devices, different clients, different connection speeds, and different software installed. You will want to consider the capabilities and configurations of your users when you decide how to encode your media. Fortunately, Azure Media Services gives you many options.

We use an AMS Job to encode media. A job accepts an input Asset and produces an output Asset. That output Asset may consist of one or more files stored in a single Azure Storage Blob Container.

To begin, encoding, navigate to the Azure Portal and open an Azure Media Service, as shown in Fig. 1.

ams01-OverviewBlade
Fig. 1

Then, select "Assets" from the left menu to open the "Assets" blade, as shown in Fig. 2.

ams02-AssetsBlade
Fig. 2

See the following articles if you need help creating an AMS account or an AMS Asset.

Click the [Add job] button (Fig. 3) to display the "Create a job" dialog, as shown in Fig. 4.

ams03-AddJobButton
Fig. 3

ams04-CreateJobBlade
Fig. 4

The first thing you need to do is create or select a Transform. A Transform is a recipe for doing something, like encoding a video. It is used by a Job, which tells Azure to execute the steps in a Transform. I will assume this is your first time doing this and do not have any Transforms created, so you will need to create a new one; but in the future, you may choose to re-use an existing Transform on a new Job.

At the "Transform" radio button, select "Create new".

At the "Transform name" textbox, enter a name to help you identify this Transform.

At the "Description" field, you may optionally enter some text to describe what this transform will do.

At the "Transform type" field, select the "Encoding" radio button.

At the "Built-in preset name" dropdown, you can select a desired encoding output appropriate for your audience. For this demo, select "Adaptive Streaming". This will create files in multiple formats that can be consumed by a variety of clients.

Next, we configure the settings for the output asset.

At the "Output asset name", enter a name to help you identify the output Asset that will be created. Azure will supply a default name, but I prefer to use something more readable, such as the Input Asset name, followed by the type of Transform.

At the "Asset storage account" dropdown, select the storage account in which to save the container and files associated with this asset.

At the "Job name" field, enter a name for this job to help you identify it later.

At the "Job priority" dropdown, select "Normal", "High", or "Low" priority, depending on whether you want this job to take precedence over other jobs. Unless I have a compelling reason, I leave this as the default "Normal".

Click the [Create] button to create and queue up the job.

You can check the progress of the job by selectin "Transforms + jobs" in the left menu to display the "Transforms + jobs" blade, as shown in Fig. 5.

ams05-TransformJobsBlade
Fig. 5

Find the row with your Transform name (This why it is important to give it an easily identifiable name). Expand to see Jobs using this Transform, as shown in Fig. 6.

ams06-TransformAndJobsBlade
Fig. 6

The state column tells you whether the job is queued, running, or finished.

From the "Transform + jobs" blade, you can click the name of the Transform to display more details about the Transform, as shown in Fig. 7 or click the name of the Job to display details about the job, as shown in Fig. 8.

ams07-TransformDetailsBlade
Fig. 7

ams08-JobDetailsBlade
Fig. 8

After the job finishes, when you return to the "Assets" blade, you will see the new output Asset listed, as shown in Fig. 9.

ams09-AssetsBlade
Fig. 9

Click on the link in the "Storage link" column to view the files in Blob storage, as shown in Fig. 10.

ams10-Container
Fig. 10

Note that there are multiple MP4 files, each with a different resolution. The names of the file indicate the resolution of the video. This allows users with smaller screens or slower bandwidth to select the optimum resolution for viewing.

The container also contains a thumbnail image and several text files with information describing the videos that client players can use.

In this article, you learned how to use Azure Media Services to encode a video. In the next article, I will show you how to share that video with others.


GCast 99:

PowerPoint Animations

Learn how to effectively animate objects in Microsoft PowerPoint.


In this last article, I introduced Azure Media Services and showed how to create an Azure Media Services (AMS) account.

In this article, I will show you how to add video and/or audio assets to an Azure Media Services account. This is often the first step in sharing media online.

An Asset points to an Azure Storage Blob Container containing one or more files. These files contain either media or metadata about media. We distinguish between Input Assets (assets provided to AMS via a user or other external source) and Output Assets (assets produced by AMS jobs). Fig. 1 illustrates this relationship.

ams01-AssetsContainer
Fig. 1

Let's look at how to upload a video file from your local computer as an Asset, as illustrated in Fig. 2.

ams02-PublishDiagram
Fig. 2

Open the Azure Portal and navigate to the Azure Media Services account, as shown in Fig. 3.

ams03-OverviewBlade
Fig. 3

Select "Assets" in the left menu to open the "Assets" blade, as shown in Fig. 4.

ams04-AssetsBlade
Fig. 4

Click the [Upload] button (Fig. 5) to open the "Upload new assets" dialog, as shown in Fig. 6.

ams05-UploadButton
Fig. 5

ams06-UploadNewAsset
Fig. 6

At the "Storage account" dropdown, select the storage account in which you want to store the media file.

Click the "Upload files" icon and select the video file or files you want to upload.

More fields display for each file selected, as shown in Fig. 7.

ams07-UploadNewAsset-Completed
Fig. 7

Enter a name for each asset; then, click the [I agree and upload] button to begin uploading your video.

When the upload is complete, the asset will be listed, as shown in Fig. 8.

ams08-AssetsBladeWithAsset
Fig. 8

Click the link in the "Storage link" column to view the Storage Blob container and files associated with this asset, as shown in Fig. 9.

ams09-Container
Fig. 9

In this article, you learned how to upload a video file to create an Azure Media Services asset. You will want to encode this in order that others can view it. I will show how to encode in the next article.


Streaming video online is an effective way to communicate to large numbers of people.

But there are challenges. You need to get your video online in a format that is accessible to others and make it available to your audience.

You may also want to provide closed captioning for hearing impaired users; analyze the contents of your audio and video; reduce latency with a Content Delivery Network; and secure your media appropriately.

Azure Media Services provides all these capabilities and does in a highly scalable, fault-tolerant way.

The first step in using Azure Media Services is to create an Azure Media Services Account. As with most, services in Azure, you can create an Azure Media Services Account in the Azure Portal by clicking the [Create a resource] button (Fig. 1); then search for and select "Media Services", as shown in Fig. 2.

ams01-CreateAResourceButton
Fig. 1

ams02-New
Fig. 2

The "Create media service account" dialog displays, as shown in Fig. 3.

ams03-CreateMediaServiceAccount
Fig. 3

At the "Subscription" dropdown, select the Subscription that will contain this Media Service Account. Most of you will have only one subscription.

At the "Resource group" field, select a Resource Group to contain this account or click the "Create new" link to create a new Resource Group to contain it. A Resource Group is a logical grouping of Azure resources, making it easier for you to manage them together.

At the "Media Services account name" field, enter a unique name for this account. This name must be between 3 and 24 characters in length and can contain only numbers and lowercase letters.

At the "Location" dropdown, select a location in which to store this service. When selecting a location, consider the location of your users and any potential legal issues.

At the "Storage Account" field, select an existing storage account from the dropdown or click the "Create a new storage account" link to create a new storage account. This storage account will hold all the assets for your service, including audio files, video files, and metadata files. Unless I have media files that already exist, I tend to prefer to keep all my Azure Media Services assets in their own storage account.

Click the [Review + create] button to display the summary page, as shown in Fig. 4.

ams04-Review
Fig. 4

Check the "I have all the rights to use the content/file" checkbox and click the [Create] button to begin creating you Azure Media Services Account.

When the service account is complete, the confirmation shown in Fig. 5 displays.

ams05-DeploymentIsComplete
Fig. 5

Click the [Go to resource] button to navigate to the "Overview" blade of the Media Service account, as shown in Fig. 6.

ams06-OverviewBlade
Fig. 6

In this article, you learned the advantages of Azure Media Services and how to create an Azure Media Services account. In the next article, I will show you how to add media assets to this account.


Episode 643

Mike Benkovich on GitHub Actions and Visual Studio

Mike Benkovich on GitHub Actions and Visual Studio Mike Benkovich describes and demonstrates GitHub Actions and the new features of Visual Studio that allow you to create an Action from within the IDE.

http://benkotips.com/

2020 in Review

Comments [0]

2020 began with trips to Dallas, TX and Charlotte, NC and it appeared that this year would be similar to 2019 - traveling for customers and OpenHacks in my role as a software engineer for Microsoft's CSE organization.

But that all changed in March when my team canceled a planned trip to Charlotte to minimize the risk of spreading coronavirus.

After that cancellation, I did not fly on a plane and I barely left the upper Midwest.

Still, it was an eventful year for me and for the whole world.

Family

My son Nick completed his first season as head coach at Kalamazoo College. He inherited a program that has not had a winning record in 17 years. The Hornets made some positive steps under his leadership, breaking several offensive records. COVID has postponed the 2020-21 season, which is now scheduled to begin in February, so he and his team are currently preparing to compete again in the Michigan Intercollegiate Athletic Association. In bigger news, Nick proposed to his longtime girlfriend Adriana and the two plan to marry in 2022.

In November, my son Tim accepted job with Microsoft Consulting Services. He will be working with the US Government, using his knowledge of Microsoft Dynamics. Although we are on different teams, I am very excited to be his colleague.

Both of my sisters sold their houses this year - one moved to a place with a much bigger yard and one downsized to a smaller place (which I have not yet seen)

My brother was hospitalized with COVID-19 this summer in Arizona but has recovered and is now reunited with his family in Australia.

Travel

My work travel ceased early in the year, thanks to the pandemic; but I did manage a couple trips later in the year.

I traveled to Michigan in early October to sponsor my nephew's Confirmation.

In late October, I took a weeklong vacation and drove to northern Michigan, visiting my friends Pat and Susan in Petoskey before driving to Michigan's Upper Peninsula for my first extended visit to this region.

In November, I took another week off and drove south, spending a few days each in St. Louis, Memphis, and Nashville. During my stay in Memphis, I was able to make my first visits to the states of Arkansas and Mississippi, bringing me closer to my goal of visiting all 50 US states.

I finally took vacation the last 3 weeks of December, but stayed close to home, as the country's lockdown intensified.

Concerts

For the past few years, I have been increasing my concert attendance. The current pandemic forced the closing of Chicago concert halls for months and reduced the schedule and capacity after they re-opened. In the fall, I was able to see some very good local and regional artists at venues that practice social distancing. SPACE in Evanston and Jazz Showcase in Chicago's South Loop were favourite destinations, but a spike in statewide infections forced these venues to close again, along with other places in the city. Prior to the Spring shutdown, I did manage to catch They Might Be Giants - a band I have always enjoyed but never seen live.

Volunteering

I did far less volunteering this year than in the past. The only significant exception was when I mentored Chicago high school students for the Illinois STEM Challenge. To compensate for my decrease in physical contributions, I donated more money to charities than I ever have before. My favourite donation happened when I asked Facebook friends to contribute to the National Suicide Prevention Hotline, promising to match all donations up to $500. This campaign raised over $1200 for a worthy cause.

Exercise

All gyms in Chicago were closed for months, so it was tempting to stay home and get fat. To combat this, I came up with a daily 20-minute exercise routine that I stuck with for most of the year. I also did a tremendous amount of bike riding - mostly around the city of Chicago. I made a point of riding almost every day that weather and available daylight permitted. I rode over 1500 miles this year.

As a result, I was able to lose about 20 pounds. Sadly, I gained back 10 of those pounds over the holidays. Back to work!

Reading

I accelerated my reading - especially in the summer. I completed 92 books in 2020 and reviewed 85 of them. You can follow my progress here.

Blogging

I continued my blogging in 2020, posting 182 entries for the year - an average of about 1 every 2 days.

I kept up my 2 TV shows - Technology and Friends and GCast throughout most of the year. I was forced to make a significant change to T&F, switching from exclusively in-person interviews to virtual meetings over Teams or Zoom. It was either that or pause the show indefinitely until we could interact physically again.

My job

This year felt a bit like treading water. My team worked on projects steadily throughout 2020, but at no point did we have high pressure or impossible deadlines. I had a chance to work on two Java projects and I learned a lot about the Spring framework, but I do not think I progressed as much as in years past. The good news is that I have a secure job with a stable company. Repeatedly, company management reinforced the message that it was acceptable for us to feel the stress of 2020 - a message that I appreciated.

Reason for Optimism

I consider myself lucky. Although this year brought change and disruption, it was not the catastrophe it was for many. So many people lost their jobs and/or their health and/or their loved ones this year; so many had to learn to adjust to having young children at home during the week; so many had to learn how to do their job remotely; so many placed themselves in harm's way because their jobs were considered essential.

Seeing others rise to these challenges, it is easy to accept a year with less travel.


GCast 98:

Using the Azure Storage Explorer

The Azure Storage Explorer provides a simple way to access objects in an Azure Storage Account. This video walks you through how to install and use this tool.


An Azure Resource Group (RG) is a logical grouping of resources or assets within an Azure subscription. This helps you organizing related resources - You can open an RG to see a web app, its associated App Service Plan, and the database that it accesses listed - to remind you that these things are related.

But there are more tangible benefits to Resource Groups.

For example, I create a lot of Azure demos for presentations that I deliver in-person, online, or as part of my GCast show. https://aka.ms/gcast

When I create a demo, I place all assets in the same resource group, which makes it easier to delete all these demo resources when the presentation ends.

Another advantage is the ability to create an ARM for all resources in a Resource Group with a few mouse clicks. This allows you to easily automate the deployment of these resources to a new environment using PowerShell or the Azure CLI. With an ARM, resources are created in the correct order and input parameters allow you to change things like the names and locations of these resources.

Azure also gives you the ability to move everything in a Resource Group from one subscription to another.

Finally, Azure allows you to merge two resource groups.

You can create a new Azure Resource Group in the Azure Portal (either by itself or as part of a resource that will be added to the group); via a REST API; via the Azure CLI; or using Azure PowerShell.

When deciding how to organize your Azure assets, consider keeping together related resources by placing them in the same Resource Group. Also, consider creating a new Resource Group for each of your deployment environments, such as Development, Testing, and Production.


Episode 642

Javier Lozano on Virtual Conferences

Ten years ago, Javier Lozano started .NET Conf - an online conference to educate people about Microsoft products. Javier discusses the challenges in creating this and other online tech events.

Links:
https://obsproject.com/
https://streamyard.com/


December 2020 Gratitudes

Comments [0]

1/3
Today I am grateful to charitable organizations that find uses for my excess stuff.

1/2
Today I am grateful
-to watch football yesterday with my sons
-to have my son Nick visit here for the week

1/1
Today I am grateful for the possibilities that a new year brings.

12/31
Today I am grateful to catch up with Ondrej and Hattan this week.

12/30
Today I am grateful
-to wake up to a blanket of snow over the city
-to watch Premier League Soccer with my sons yesterday.

12/29
Today I am grateful that my son is visiting me this week.

12/28
Today I am grateful for a second pair of eyeglasses - ideal for reading my computer screen.

12/27
Today I am grateful for a second pair of eyeglasses - ideal for reading my computer screen.

12/26
Today I am grateful for a virtual Christmas celebration with my family yesterday.

12/25
Today I am grateful that God loved us enough to send us his only son.

12/24
Today I am grateful:
-to return to the dentist for the first time in over a year
-for an unseasonably warm day yesterday and hours spent outside

12/23
Today I am grateful to hang out virtually last night with Lee, Matthew, and Serene.

12/22
Today I am grateful to exchange emails with old friends this week.

12/21
Today I am grateful for "Fargo"

12/19
Today I am grateful for my safe deposit box, which is now holding my Will and Power of Attorney.

12/18
Today I am grateful to hang out virtually with Mike this morning.

12/17
Today I am grateful to have my towel rack and toilet handle repaired.

12/16
Today I am grateful:
-for a portrait from David
-to my son who drove over to fix my TV last night
-to start my vacation

12/15
Today I am grateful for Doctor Who

12/14
Today I am grateful for my son's first day working at Microsoft.

12/13
Today I am grateful to drive around Lincolnwood last night with friends looking at holiday light displays.

12/12
Today I am grateful for spellcheckers

12/11
Today I am grateful for surprisingly mild weather yesterday.

12/10
Today I am grateful to fix the switch that toggles water flow between shower and bath, so it no longer sends half the water to each.

12/9
Today I am grateful to my friend Jerry, who shares the knowledge whenever he learns a new word.

12/8
Today I am grateful that my brother is back with his family after months in the US and weeks quarantining in Australia.

12/7
Today I am grateful for a walk around my neighborhood with my son before he drove home yesterday.


Liane Moriarty's 2014 novel Big Little Lies is about secrets in a small town. The story focuses on three friends in Pirriwee - a beach town north of Sydney, Australia.

Single mother Jane arrives in Pirriwee with her 5-year-old son Ziggy. At Ziggy's kindergarten, he is accused of choking one of his female classmates. Rumors about Ziggy continue throughout the school year and some of the Kindergarten parents pressure the school to remove the boy. The Parents take sides in this battle. Two mothers - Madeline and Celeste - befriend Jane and ally themselves with her.

At the novel's beginning, the reader learns that a murder will be committed. This murder is referenced throughout the story, but we must wait until the end to learn who is involved and why.

Moriarty slowly and masterfully peels away layers of her characters to reveal their flaws and the secrets they are hiding.

Madeline is jealous of the affection her daughter Abigail shows to her ex-husband and his new wife Bonnie. Abigail initiates a fundraising campaign that shocks her parents and stepparents.

Celeste is a beautiful woman with two beautiful twins. Her rich, handsome husband Perry is charming and generous; but he flies into a range every few months and beats his wife. Even her closest friends don't suspect the tragedy of her marriage.

And Jane is hiding a dark secret about Ziggy's father.

On one level, the book is a humorous tale of catty, desperate housewives in a suburban community. But Moriarty takes it far beyond that. It is a story of strong women trying to survive against real problems. It is filled with victim blaming, including self-blame by the victims themselves. It shines a light on spousal abuse, bullying, sexual assault, and gossip.

I enjoyed it to the end.


Episode 641

Ed Charbeneau on Blazor Testing

Microsoft Blazor presents some challenges for those creating automated tests. Ed Charbeneau describes ways to address these challenges and some tools to help you create unit tests and functional tests.

Links:
http://blogs.telerik.com
https://youtu.be/WdB723tIWg0
https://twitter.com/edcharbeneau
https://twitch.tv/codeitlive
https://www.twitch.tv/edcharbeneau


Frank Herbert's 1965 novel Dune remains a classic more than a half century after its release.

Dune The Graphic Novel Book 1 shows how hard it is to adapt this great novel visually. David Lynch failed miserably with his 1984 movie and the Syfy Channel had slight success with 2000 mini-series.

Herbert's son Brian Herbert teams with author Kevin J. Anderson to write the text for this adaptation and they do a good job. The pair have made their reputation with a series of respectable novels set in the Dune universe. They are assisted by artist Raul Allen and letterer Patricia Martin.

The graphic novel is good; The storytelling is faithful to the original; the art is attractive; the lettering is good (although I had an issue with some unnecessary low-contrast text on backgrounds), so overall I liked this graphic novel. The main issue comes with the lack of subtlety. While the elder Herbert infused his story with multiple layer and secreted hidden meanings within each line of dialogue, this story is much more straightforward. As such, it lacks the subtlety that made the original so great.

This graphic novel is good to read after finishing the Dune book. The novel can be intimidating, and it is easy to miss things the first time around. This comic helps to clarify them. But do yourself a favour and do not start with the graphic novel. You will miss the excitement of discovering the story layers as they are slowly unfolded within Frank Herbert's original prose.


Episode 640

David Neal on Hand Drawn Illustrations for Powerful Storytelling

David Neal is a technical presenter who often gives inspirational talks. A few years ago, he began adding his own artwork to his slides. He talks about his approach and how it has affected the stories he tells.

Links:
https://twitter.com/reverentgeek
https://www.instagram.com/reverentgeek/
https://reverentgeek.com/
david@reverentgeek.com


The Founding Fathers of the United States hold a special place in my country's history. Centuries after they lived, people still speak with reverence of men like Benjamin Franklin, Thomas Jefferson, James Madison, and Alexander Hamilton. Yet one man of this era stands above even these giants. George Washington cemented his place in history by leading the American army that defeated the British in the Revolution War; then, serving as the first President of the United States.

Ron Chernow's biography Washington: A Life details the General/President's rise and how handled the power he was given.

Washington was born into an upper-middle class family; but rose to become one of the landed gentry by a series of fortuitous events: his widowed mother married a wealthy farmer and George inherited the large estate at Mount Vernon by outliving all other possible heirs; then, George married wealthy widow Martha Custis.

When the American Revolution began, Washington led a poorly-equipped, ill-trained army to victory over one of the great powers in the world. He did so despite infighting among his officers and the young country's lawmakers.

After the war, Washington was the most popular man in America and the logical choice to serve as its first leader. He won the Presidency unanimously and served two terms despite his desire to return to his Virginia estate and manage the farms there.

In his first term, George Washington attempted to unite the factions of the young country - surrounding himself with people of varying opinions. His cabinet and advisors included Northerners and southerners; slaveholders and abolitionists; those who favored a centralized government and those suspicious of concentrated power. Fierce debates arose as to whether the US should align itself more closely with England or France - two countries at war with one another. By his second term, Washington had tired of the infighting among his advisors and those that criticized him publicly. Quarrels between Jefferson, Adams, Hamilton, and Madison left him weary and disillusioned, so he retained a more homogeneous cabinet for his final four years in office.

As with Chernow's earlier biography of Alexander Hamilton, "Washington: A Life" goes beyond the historical facts and gives the reader a taste for Washington's character and personality. Washington was arrogant, stoic, and aloof; he was not given to long speeches, but he was eloquent in his writing; he rejected the idea of a British-style monarchy for America and was hurt that some thought he had ambitions of becoming king; he desperately wanted to leave public life and return to managing Mount Vernon (during the War, he corresponded frequently with the managers of his estate); he was unwavering in his honesty and integrity; he was highly conscious of his public image; he enjoyed the luxuries that came with wealth; he had a difficult relationship with his overly-demanding mother.

In this book, we see a complex man, who held together a nation during arguably its most vulnerable time. Few people had the universal respect to pull off this miracle.

Washington had a strong sense of duty that drove him to server in public office, despite his cash flow problems, which could have been better addressed by staying home and managing his estate. Ultimately, he was the unifying force that the young republic needed. His actions strengthened the central government and the country and defined the office of presidency.

But Washington had his faults.

As a general, he was not a great strategist - he lost more battles than he won - but held together a ragtag, underfunded army for years until the British forces committed a blunder he could exploit.

The most controversial aspect of Washington's life is his status as a slave owner. : or note that he appeared to treat his slaves better than his peers (Washington forbade beatings and refused to separate families).

Arguably the most conflicted aspect Washington was his dealings with slavery and Chernow covers this topic considerably. Washington and his wife owned hundreds of slaves and made almost no public effort to promote abolition. Yet he spoke privately of his desire to end slavery and thought the practice would eventually die out on its own. He showed less cruelty to his slaves than most other Virginia farmers, establishing rules against physical beatings and separating families; but he sometimes broke these rules when he felt it was necessary. One can take into account that nearly every wealthy Virginia landowner owned slaves and one can note that he freed his slaves in his will. But he remained publicly silent on the political hot topic, despite being in a position of great influence. Washington's position on slavery evolved throughout his lifetime, but he seems to have never fully grasped the inhumanity and cruelty inherent in one human being owning another

These are the kinds of things that Chernow presents to the reader to show the humanity and complexity of or first President. He praises Washington's achievements, while stripping away his legendary status, showing him as a great, but flawed human, not a demi-god or saint

If you are looking for a comprehensive biography of one of the most influential men in American history - a book that covers his entire life, this one is for you.


Episode 639

Kyle Bunting and Joel Hulen on Data Engineering in Azure

Kyle Bunting and Joel Hulen of Solliance describe Data Engineering and some of tools, such as Azure Synapse Analytics, that allow you to perform Data Engineering at scale in the cloud.

Links:

https://www.solliance.net/


"Dune" by Frank Herbert

Comments [0]

The galactic Emperor had a hidden agenda when he ordered House Atreides to move to the Arrakis, replacing House Harkonnen as the planet's ruling family. Arrakis is a desolate wasteland covered almost entirely in desert, earning it the nickname "Dune"; but Arrakis is the only source of the spice melange - the most valuable substance in the universe.

Duke Leto Atreides's teenage son Paul is beginning to manifest mystical powers that will aid him in the coming battles and betrayals and in his fight for survival on a hostile planet.

Frank Herbert's classic novel Dune is the most complex science fiction novel I have read. In addition to an adventure story and a coming-of-age novel, the book includes insights into politics, sociology, ecology, economics, religion, philosophy, and language. Nearly every dialogue is layered with multiple meanings and nearly every action is a potential betrayal.

Herbert does an amazing job building the world of Arrakis and its people.

Among the creations of the book are:

-Sand Worms - giant tubular creatures that live beneath the surface of the desert sand, as sea dragons might swim in the ocean, breaching the surface from time to time to wreak havoc on protection of the spice.

  • The Bene Gesserit - a cultlike group with impressive mental powers, who strive to produce a superhuman via their secret breeding program.
  • The Fremen - a mysterious nomadic race that live in the deserts of Dune and have a special relationship with the sand worms.
  • Mentats - humans with the ability to think like computers

Although Dune is set centuries in the future, technology has not advanced at the rate one would expect. Advancements have been stunted by humanity's distrust of artificial intelligence and a war fought centuries earlier. Things like interplanetary travel have been made possible by the powers of the Bene Gesserit and the Mentats and the mind-expanding abilities of melange.

The local water scarcity, the global spice monopoly, and the struggle for control between powerful factions serve as a metaphor for similar constrained resources and conflicts on the Earth of today and the effect on global politics. The vast sand oceans and the Fremen people are not far removed from the 20th and 21st century Middle East.

Through it all is Paul - son of a Duke and gifted with great powers that lead others to perceive him as a Messiah. How he uses those powers defines him and defines the power structure of the galaxy.

This was my third reading of this novel, which I first discovered in my late 20s. After all these years, it still holds my interest.


Episode 638

Emily Cooper on the ISTI STEM Challenge

The Illinois Science & Technology Institute (ISTI) organizes a STEM Challenge that allows high school students to work on real-world problems with industry mentors.

Emily Cooper talks about this program, its goals, and the organization.


November 2020 Gratitudes

Comments [0]

12/6
Today I am grateful for a warm home on cold days.

12/5
Today I am grateful to my building's maintenance staff which fixed a bunch of things in my condo yesterday.

12/4
Today I am grateful for a visit from my son Nick.

12/3
Today I am grateful for online shopping

12/2
Today I am grateful for my son's new job.

12/1
Today I am grateful for new tires on my car.

11/30
Today I am grateful to get my bicycle's gears repaired.

11/29
Today I am grateful for a Spartan trifecta yesterday: Michigan State victories in football, basketball, and ice hockey!

11/28
Today I am grateful to those who express appreciation.

11/27
Today I am grateful to celebrate virtual Thanksgiving with family yesterday.

11/26
Today I am grateful to receive phone calls from people I care about.

11/25
Today I am grateful to successfully complete work on a project on which we have been working for months.

11/24
Today I am grateful to awaken to a gently falling snow.

11/23
Today I am grateful for movies and TV on-demand.

11/22
Today I am grateful for unseasonably warm late November Chicago weather.

11/21
Today I am grateful for dinner at The Publican with Tim last night.

11/20
Today I am grateful for my new (to me) Herman Miller Aeron chair.

11/19
Today I am grateful for a negative COVID-19 test.

11/18
Today I am grateful for a hot bath.

11/17
Today I am grateful that American Express quickly replaced my lost card.

11/16
Today I am grateful for my new AirPods.

11/15
Today I am grateful for
-a chance to explore the Natchez Trace yesterday
-an 8-day vacation with visits to Springfield, St. Louis, Memphis, and Nashville.


11/14
Today I am grateful to sit around a bonfire last night with Gaines and Mary.

11/13
Today I am grateful for:
-3 great days in Memphis
-live music last night at Printer's Alley in Nashville
-a bike ride yesterday around Richmond Creek

11/12
Today I am grateful for:
-my first visit to Mississippi
-a visit to the National Civil Rights Museum in Memphis yesterday

11/11
Today I am grateful for a bike ride along the Shelby Farms Greenline Trail in Memphis yesterday.

11/10
Today I am grateful for
-My first-ever visit to Arkansas
-Seeing live music last night on Beale Street
-Meeting Glenn Campbell's son and telling him how much I enjoyed his father's music.

11/9
Today I am grateful for:
-Brunch yesterday with Jeffrey and his family yesterday
-The hospitality and generosity of Kevin and Darlene this weekend.

11/8
Today I am grateful for the millions of Americans who voted against dishonesty, hate, and racism.

11/7
Today I am grateful for my new bike helmet.

11/6
Today I am grateful that John has returned with his puns to save us all.

11/5
Today I am grateful to attend non-work meetings yesterday with my co-workers as part of our annual OneWeek event.

11/4
Today I am grateful to learn a lot about web security yesterday.

11/3
Today I am grateful for the opportunity to vote.

11/2
Today I am grateful for my new bicycle phone mount.


A few years ago, I sat in a cafe in Bergen on the west coast of Norway, sipping a coffee and enjoying a small pastry. It was sweet and satisfying by itself; but I enjoyed it enough to order another; and then, another.

The stories within Neil Gaiman's Norse Mythology are like this. Each story is short and easily consumable (about 10-25 pages) and stands on its own; but together, they weave an epic of the gods of Scandinavia.

We hear the adventures of Odin, Thor, Loki, Balder, and the gods of Asgard, along with the giants, dwarves, creatures, and sentient rocks and plants that inhabit their universe. We hear of shape-shifting and battles, and treachery, and love. We learn about the families of the gods and their births and their deaths.

Gaiman has inserted pagan gods into his books in the past (American Gods and Anansi Boys) and even written entire books around Thor, Loki, and Odin (Odd and the Frost Giants), but those books extended the legends of the deities, while this book pulls from the original source material - the oral stories recounting the adventures of these immortals, from the beginning of the world to Ragnarok - the final battle of the gods.

He does so with a voice that suggests these tales are told around a campfire at night.

Some of these stories were long familiar to me from the reading of my youth and some of them I had not heard. But all seemed fresh as told by Gaiman.

We have always known that Neil Gaiman knows how to tell a story. But with Norse Mythology, he proves that he can tell someone else's story.


MinIO articles and videos

Comments [0]

Recently, I have been working with MinIO – a container-based object storage service. I’ve recorded much of what I’ve learned. The links below will get you up to speed if you want to learn about this technology.

Blog Posts

Getting Started with MinIO Server

Creating and using a MinIO Gateway for Azure

Using the MinIO Java SDK

Managing MinIO with the Amazon S3 SDK

Videos

Creating a MinIO Server

Creating a MinIO Agent for Azure Blob Storage

Using the MinIO Java Client SDK

Accessing MinIO with the AWS S3 SDK


Intro

In my last article, I showed how to manage buckets and objects in MinIO using the MinIO Java SDK.

However, MinIO has the advantage that one can also access it using the Amazon S3 Java API. This is helpful if you are migrating from S3 (a comparable object store hosted by Amazon Web Services) to MinIO.

The code below assumes that the following values are declared and initialized appropriately:

private String endPoint;  // The MinIO endpoint (e.g., "http://127.0.0.1:9000") 
private String accessKey; // The MinIO Access Key 
private String secretKey; // The MinIO Secret Key 
private String bucketName; // A MinIO bucket in which to store objects (e.g., "mybucket") 
private String localFileFolder; // A local folder on your file system to upload/download files to/from MinIO (e.g., "c:\files\")
  

In order to use the S3 SDK, your app must have a reference to it. In a Maven project, this is done by adding the following to the section of the project's POM.XML:


    com.amazonaws
    aws-java-sdk-s3
    1.11.858

  

AmazonS3 Object

In your code, the first thing you will need is an AmazonS3 object, which has methods for managing your MinIO objects.

Here is the code for creating this object.

public static AmazonS3 getAmazonS3Client(String accessKey, String secretKey, String endPoint) { 
    ClientConfiguration clientConfig = new ClientConfiguration(); 
    clientConfig.setProtocol(Protocol.HTTP); 
    AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); 
    AmazonS3 s3client = AmazonS3ClientBuilder 
            .standard() 
            .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endPoint, Regions.US_EAST_1.name())) 
            .withPathStyleAccessEnabled(true) 
            .withClientConfiguration(clientConfig) 
             .withCredentials(new AWSStaticCredentialsProvider(credentials)) 
            .build();

    return s3client; 
}
  

Once you have an AmazonS3 object, you can use it to manage MinIO objects.

Uploading a File

For example, here is code to upload a file to a MinIO bucket:

public void UploadWithS3Client(String fileName) throws IOException { 
     AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint); 
    String fileToUpload = localFileFolder + fileName; 
     try { 
        File file = new File(fileToUpload); 
        PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, fileName, file); 
        s3Client.putObject(putObjectRequest); 
    } catch (AmazonServiceException ase) { 
        System.out.println("Error Message:    " + ase.getMessage());

    } catch (AmazonClientException ace) { 
        System.out.println("Error Message: " + ace.getMessage()); 
    } 
}
  

List Objects

and code to get a list all the objects in a bucket

public List<String> ListS3Objects() { 
     List<String> blobList = new ArrayList<String>(); 
    System.out.format("Objects in S3 bucket %s:\n", bucketName); 
    AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint); 
     ListObjectsV2Result result = s3Client.listObjectsV2(bucketName); 
    List<S3ObjectSummary> blobs = result.getObjectSummaries(); 
    for (S3ObjectSummary blob : blobs) { 
        blobList.add(blob.getKey()); 
        System.out.println("* " + blob.getKey()); 
    } 
    return blobList; 
 }
  

Download a File

and to download one of those objects to your local file system:

public void DownloadFromMinIOWithS3Client(String objectName) { 
    System.out.format("Downloading %s from S3 bucket %s...\n", objectName, bucketName); 
    AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint); 
    try { 
        S3Object o = s3Client.getObject(bucketName, objectName); 
        S3ObjectInputStream s3is = o.getObjectContent(); 
        String downloadedFile = localFileFolder + "D_" + objectName; 
        FileOutputStream fos = new FileOutputStream(new File(downloadedFile)); 
        byte[] read_buf = new byte[1024]; 
        int read_len = 0; 
        while ((read_len = s3is.read(read_buf)) > 0) { 
            fos.write(read_buf, 0, read_len); 
        } 
        s3is.close(); 
        fos.close(); 
    } catch (AmazonServiceException e) { 
        System.err.println(e.getErrorMessage()); 
        System.exit(1); 
    } catch (FileNotFoundException e) { 
        System.err.println(e.getMessage()); 
         System.exit(1); 
    } catch (IOException e) { 
        System.err.println(e.getMessage()); 
        System.exit(1); 
        } 
    }
  

As you can see, once you have a reference to the object, the rest is just Java IO code.

Print File Contents

Finally, here is code to print the contents of a text object stored in MinIO. Again, it is simple Java IO once you have a reference to the object.

    public void PrintObjectContents(String objectName) throws IOException {
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        GetObjectRequest rangeObjectRequest = new GetObjectRequest(bucketName, objectName);
        S3Object objectPortion = s3Client.getObject(rangeObjectRequest);
        System.out.println("Printing bytes retrieved:");
        displayTextInputStream(objectPortion.getObjectContent());
    }

    private static void displayTextInputStream(InputStream input) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(input));
        while (true) {
            String line = reader.readLine();
            if (line == null)
                break;

            System.out.println("    " + line);
        }
        System.out.println();
    }
  

Conclusion

Here is the full code that you can find at https://github.com/DavidGiard/MinIO_Java_Demo:

package com.gcast.gcastminio.services;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.Protocol;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.GetObjectRequest;
import com.amazonaws.services.s3.model.ListObjectsV2Result;
import com.amazonaws.services.s3.model.PutObjectRequest;
import com.amazonaws.services.s3.model.S3Object;
import com.amazonaws.services.s3.model.S3ObjectInputStream;
import com.amazonaws.services.s3.model.S3ObjectSummary;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class S3Service {

    // The following are set in application.properties
    @Value("${minio.endPoint}")
    private String endPoint;
    @Value("${minio.accessKey}")
    private String accessKey;
    @Value("${minio.secretKey}")
    private String secretKey;
    @Value("${minio.bucketName}")
    private String bucketName;
    @Value("${localFileFolder}")
    private String localFileFolder;

    public void UploadWithS3Client(String fileName) throws IOException {
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        String fileToUpload = localFileFolder + fileName;
        try {
            File file = new File(fileToUpload);

            PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, fileName, file);
            s3Client.putObject(putObjectRequest);
        } catch (AmazonServiceException ase) {
            System.out.println("Error Message:    " + ase.getMessage());

        } catch (AmazonClientException ace) {
            System.out.println("Error Message: " + ace.getMessage());
        }
    }

    public List<String> ListS3Objects() {
        List<String> blobList = new ArrayList<String>();
        System.out.format("Objects in S3 bucket %s:\n", bucketName);
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        ListObjectsV2Result result = s3Client.listObjectsV2(bucketName);
        List<S3ObjectSummary> blobs = result.getObjectSummaries();
        for (S3ObjectSummary blob : blobs) {
            blobList.add(blob.getKey());
            System.out.println("* " + blob.getKey());
        }
        return blobList;
    }

    public void PrintObjectContents(String objectName) throws IOException {
        AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
        GetObjectRequest rangeObjectRequest = new GetObjectRequest(bucketName, objectName);
        S3Object objectPortion = s3Client.getObject(rangeObjectRequest);
        System.out.println("Printing bytes retrieved:");
        displayTextInputStream(objectPortion.getObjectContent());
    }

    private static void displayTextInputStream(InputStream input) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(input));
        while (true) {
            String line = reader.readLine();
            if (line == null)
                break;

            System.out.println("    " + line);
        }
        System.out.println();
    }

	public void DownloadFromMinIOWithS3Client(String objectName) {
		System.out.format("Downloading %s from S3 bucket %s...\n", objectName, bucketName);
		AmazonS3 s3Client = getAmazonS3Client(accessKey, secretKey, endPoint);
		try {
			S3Object o = s3Client.getObject(bucketName, objectName);
			S3ObjectInputStream s3is = o.getObjectContent();
			String downloadedFile = localFileFolder + "D_" + objectName;
			FileOutputStream fos = new FileOutputStream(new File(downloadedFile));
			byte[] read_buf = new byte[1024];
			int read_len = 0;
			while ((read_len = s3is.read(read_buf)) > 0) {
				fos.write(read_buf, 0, read_len);
			}
			s3is.close();
			fos.close();
		} catch (AmazonServiceException e) {
			System.err.println(e.getErrorMessage());
			System.exit(1);
		} catch (FileNotFoundException e) {
			System.err.println(e.getMessage());
			System.exit(1);
		} catch (IOException e) {
			System.err.println(e.getMessage());
			System.exit(1);
			}
		}


    public static AmazonS3 getAmazonS3Client(String accessKey, String secretKey, String endPoint) {
        ClientConfiguration clientConfig = new ClientConfiguration();
        clientConfig.setProtocol(Protocol.HTTP);
        AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
        AmazonS3 s3client = AmazonS3ClientBuilder
                .standard()
                .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endPoint, Regions.US_EAST_1.name()))
                .withPathStyleAccessEnabled(true)
                .withClientConfiguration(clientConfig)
                .withCredentials(new AWSStaticCredentialsProvider(credentials))
                .build();

        return s3client;
	}
}
  

In this article, you learned how to use the Amazon S3 Java SDK to manage objects in MinIO.


Gaines Kergosien on ADHD

Comments [0]

Episode 637

Gaines Kergosien on ADHD

Gaines Kergosien discusses ways to identify and cope with the challenges of ADHD.

Links:

https://add.org/
http://blog.kergosien.net/
https://speakerdeck.com/gaines/succeeding-with-adhd


<< Older Posts | Newer Posts >>