SlideShare a Scribd company logo
1 of 31
Capture
Record
Clip
Embed and play
Search
Video from newbie to ninja
http://creativecommons.org/licenses/by-nc-sa/3.0/
Vito Flavio Lorusso
@vflorusso
http://github.com/vflorusso
Things that kept me busy…
6. CDN
4. Cloud Ingest2. Broadcaster
Toronto Facility
3. Encoding
5. Storage & Streaming
7. Immersive Player
Client
15 live feeds
1. FIFA Broadcast
Facilities
H.264
HLS
DASH
What does
“video in the cloud”
look like?
INGEST
ENCODE
DELIVER
PACKAGE
ENCRYPT
“This looks complicated…
I am just a web developer…
and I want my Youtube”
Creating the Media Services
Account
Create a Storage Account
New-AzureStorageAccount -StorageAccountName [name] -Label
[label] -Location [location] -Type [storage-type]
Create a Media Services Account
New-AzureMediaServicesAccount -Name [ams-name] -
StorageAccountName [stg-name] -Location [location]
Create a Media Services Account
Get-AzureMediaServicesAccount -Name [ams-accountname]|Format-
Table Name, MediaServicesPrimaryAccountKey
Creating the CloudMediaContext
using Microsoft.WindowsAzure.MediaServices;
using Microsoft.WindowsAzure.MediaServices.Client;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
public static CloudMediaContext createAMSContext()
{
MediaServicesCredentials credentials = new
MediaServicesCredentials(amsAccountName, amsAccountKey);
CloudMediaContext mediaClient = new
CloudMediaContext(credentials);
return mediaClient;
}
Creating your with Azure
Youtube
Vimeo
Dailymotion
MP4 Video
Upload and
Create Asset
Media Services
Account
WEB APP
Uploading videos… (1/2)
static public IAsset CreateAssetAndUploadSingleFile(CloudMediaContext amsAccount,
AssetCreationOptions assetCreationOptions, string singleFilePath)
{
var assetName = "UploadSingleFile_" + DateTime.UtcNow.ToString();
var asset = CreateEmptyAsset(amsAccount, assetName, assetCreationOptions);
var fileName = Path.GetFileName(singleFilePath);
var assetFile = asset.AssetFiles.Create(fileName);
Console.WriteLine("Created assetFile {0}", assetFile.Name);
…
Uploading videos… 2/2
var accessPolicy = amsAccount.AccessPolicies.Create(assetName,
TimeSpan.FromDays(3),
AccessPermissions.Write | AccessPermissions.List);
var locator = amsAccount.Locators.CreateLocator(LocatorType.Sas,
asset, accessPolicy);
Console.WriteLine("Upload {0}", assetFile.Name);
assetFile.Upload(singleFilePath);
Console.WriteLine("Done uploading of {0} using Upload()",
assetFile.Name);
locator.Delete();
accessPolicy.Delete();
return asset;
}
…
Creating your with Azure
Youtube
Vimeo
Dailymotion
MP4 Video
Upload and
Create Asset
Media Services
Account
Media Services
Encoding Units
Process
Asset
Subtitles
Thumbnails
manifest
Adaptive bitrate
MP4 video
WEB APP
Processing… Encode
static public IAsset EncodeToAdaptiveBitrateMP4Set(IAsset asset, string
pathToLocalPresetFile)
{
IJob job = _context.Jobs.Create("Media Encoder Standard Job");
IMediaProcessor processor = GetLatestMediaProcessorByName("Media Encoder
Standard");
ITask task = job.Tasks.AddNew("My encoding task",
processor,
"H264 Multiple Bitrate 720p",
TaskOptions.None);
task.InputAssets.Add(asset);
task.OutputAssets.AddNew("Output asset",
AssetCreationOptions.None);
job.StateChanged += new
EventHandler<JobStateChangedEventArgs>(JobStateChanged);
job.Submit();
job.GetExecutionProgressTask(CancellationToken.None).Wait();
return job.OutputMediaAssets[0];
}
Processing… Thumbnails
<?xml version="1.0" encoding="utf-8"?> <Thumbnail Size="100%,*" Type="Jpeg"
Filename="{OriginalFilename}_{Size}_{ThumbnailTime}_{ThumbnailIndex}_{Date}_{Ti
me}.{DefaultExtension}"> <Time Value="10%" Step="10%" Stop="95%"/> </Thumbnail>
string configuration = File.ReadAllText(Path.GetFullPath(configFilePath +
@"Thumbnails.xml"));
ITask task = job.Tasks.AddNew("My thumbnail task", processor, configuration,
TaskOptions.ProtectedConfiguration);
Processing… Subtitles
string configuration = string.IsNullOrEmpty(configurationFile) ? "" :
File.ReadAllText(configurationFile);
ITask task = job.Tasks.AddNew("My Indexing Task",
processor,
configuration,
TaskOptions.None);
<?xml version="1.0" encoding="utf-8"?> <configuration version="2.0"> <input>
<metadata key="title" value="[Title of the media file]" /> <metadata
key="description" value="[Description of the media file]" /> </input>
<settings> </settings> <features> <feature name="ASR"> <settings> <add
key="Language" value="English"/> <add key="CaptionFormats"
value="ttml;sami;webvtt"/> <add key="GenerateAIB" value ="true" /> <add
key="GenerateKeywords" value ="true" /> </settings> </feature> </features>
</configuration>
Creating your with Azure
Youtube
Vimeo
Dailymotion
MP4 Video
Upload and
Create Asset
Media Services
Account
Media Services
Encoding Units
Process
Asset
Subtitles
Thumbnails
manifest
Adaptive bitrate
MP4 video
Media Services
Streaming EndpointsCDN
WEB APP
Creating the Endpoint
public static void createStreamingEndpoint(CloudMediaContext amsAccount,
string seName)
{
IStreamingEndpoint amsEndpoint =
amsAccount.StreamingEndpoints.Create(seName, 1);
amsEndpoint.StartAsync();
}
Get the streaming URL (1/2)
static string streamSmoothLegacy = "(format=fmp4-v20)";
static string streamDash = "(format=mpd-time-csf)";
static string streamHLSv4 = "(format=m3u8-aapl)";
static string streamHLSv3 = "(format=m3u8-aapl-v3)";
static string streamHDS = "(format=f4m-f4f)";
private static string GetStreamingOriginLocatorEndPoint(CloudMediaContext
amsAccount, IAsset assetToStream)
{
var theManifest = from f in assetToStream.AssetFiles
where f.Name.EndsWith(".ism")
select f;
// Cast the reference to a true IAssetFile type.
IAssetFile manifestFile = theManifest.First();
IAccessPolicy policy = null;
ILocator originLocator = null;
// Create a 30-day readonly access policy.
policy = amsAccount.AccessPolicies.Create("Streaming policy",
TimeSpan.FromDays(30),
AccessPermissions.Read);
…
// Create an OnDemandOrigin locator to the asset.
originLocator =
amsAccount.Locators.CreateLocator(LocatorType.OnDemandOrigin, assetToStream,
policy,
DateTime.UtcNow.AddMinutes(-5));
// Create a full URL to the manifest file. Use this for playback
// in streaming media clients.
string urlForClientStreaming = originLocator.Path +
manifestFile.Name + "/manifest";
// Return the locator.
return urlForClientStreaming;
}
Get the streaming URL (2/2)
…
Managing Media Services from
«code»
• Command Line
• Windows: PowerShell
• Code
• Azure Media Services REST APIs
• Azure Media Services SDK for .NET
• Azure SDK for Java
• Azure Media Services for Node.js
• Azure PHP SDK
Wrapping up: what makes a
Media Service
Media Service Account
Storage Account
AssetAssetAsset
Streaming Endpoint
Streaming Unit
Encoding
Job
Task
Live Streaming
Channel
Program
Creating your with Azure
Youtube
Vimeo
Dailymotion
MP4 Video
Upload and
Create Asset
Media Services
Account
Media Services
Encoding Units
Process
Asset
Subtitles
Thumbnails
manifest
Adaptive bitrate
MP4 video
Media Services
Streaming EndpointsCDN
Azure
Search
WEB APP
<video /> <img /> <input /> <div />
Create Search Account
#only lowercase letters and numbers accepted
$searchdeploymentname = "vitolosearch01"
$dbdeploymentname = "vitotestdb02"
$dbservername = "vitotestdbsrv02"
$dbadminname = "vito"
$dbpassword = Read-Host "Type DB password"
#parameters for creating the search service
$searchparams = @{name=$deploymentname; location=$location; sku= "standard";
replicaCount=1; partitionCount=1}
Switch-AzureMode AzureResourceManager
Add-AzureAccount -Credential $credential
Select-AzureSubscription $subscriptionName
New-AzureResourceGroup –Name $resourcegroupname –Location $location
New-AzureResourceGroupDeployment -ResourceGroupName $resourcegroupname -
nameFromTemplate $searchdeploymentname -DeploymentName $searchdeploymentname -
TemplateFile .Microsoft.Search.1.0.5.json -TemplateParameterObject $searchparams
Create Index
string searchServiceName =
ConfigurationManager.AppSettings["SearchServiceName"];
string apiKey =
ConfigurationManager.AppSettings["SearchServiceApiKey"];
_searchClient = new SearchServiceClient(searchServiceName, new
SearchCredentials(apiKey));
_indexClient = _searchClient.Indexes.GetClient(_moviesIndexName);
_serviceUri = new Uri("https://" +
ConfigurationManager.AppSettings["SearchServiceName"] + ".search.windows.net");
_httpClient = new HttpClient();
_httpClient.DefaultRequestHeaders.Add("api-key", apiKey);
CreateMovieIndex();
CreateMovieIndex()
internal static void CreateIndex(string collectionName)
{
try
{
var definition = new Index()
{
Name = collectionName,
Fields = new[]
{
new Field(“MOVIE_KEY", DataType.String) { IsKey = true,
IsSearchable = false, IsFilterable = false, IsSortable = false, IsFacetable =
false, IsRetrievable = true},
new Field(“MOVIE_DATA", DataType.String) { IsKey = false,
IsSearchable = true, IsFilterable = true, IsSortable = false, IsFacetable =
true, IsRetrievable = true}
}
};
_searchClient.Indexes.Create(definition);
}
catch (Exception ex)
{
Console.WriteLine("Error creating index: {0}rn",
ex.Message.ToString());
}
}
Wrap up: Azure Search
Search Service Client
Collection
Index
Fields
Facets Indexer
Search Query key
Creating your with Azure
Youtube
Vimeo
Dailymotion
MP4 Video
Upload and
Create Asset
Media Services
Account
Media Services
Encoding Units
Process
Asset
Subtitles
Thumbnails
manifest
Adaptive bitrate
MP4 video
Media Services
Streaming EndpointsCDN
Azure
Search
WEB APP
<video /> <img /> <input /> <div />
The web page: Media Player
<link href=“http://amp.azure.net/libs/amp/latest/skins/amp-
default/azuremediaplayer.min.css" rel="stylesheet">
<script src=
“http://amp.azure.net/libs/amp/[version]/azuremediaplayer.min.js"></script>
<video id="vid1" class="azuremediaplayer amp-default-skin" autoplay
controls width="640" height="400" poster="poster.jpg" data-
setup='{"nativeControlsForTouch": false}'>
<source
src="http://amssamples.streaming.mediaservices.windows.net/91492
735-c523-432b-ba01-
faba6c2206a2/AzureMediaServicesPromo.ism/manifest"
type="application/vnd.ms-sstr+xml" />
<p class="amp-no-js"> To view this video please enable
JavaScript, and consider upgrading to a web browser that
supports HTML5 video </p>
</video>
The web page: Search
<html>
<head>
<script src="azure-search.min.js"></script>
</head>
<body>
<script>
var client = AzureSearch({
url: "https://MY_SEARCH_SERVICE_NAME.search.windows.net",
key:"MY_QUERY_KEY"
});
client.search('myindex', {search:'document'}, function(err, results){
// results is an array of matching documents
});
</script>
</body>
</html>
Questions?
Useful links
Azure Media Services Dev Center
http://azure.microsoft.com/en-us/develop/media-services/
Azure Media Services Explorer
http://aka.ms/amse
Azure Media Player
http://aka.ms/azuremediaplayer
Azure Search
https://azure.microsoft.com/en-
us/documentation/articles/search-workflow/
webnextconf.eu

More Related Content

What's hot

Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesDoris Chen
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communicationsWO Community
 
Gruntwork Executive Summary
Gruntwork Executive SummaryGruntwork Executive Summary
Gruntwork Executive SummaryYevgeniy Brikman
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersJeremy Lindblom
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 
JavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersJavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersFestGroup
 
JSLounge - TypeScript 소개
JSLounge - TypeScript 소개JSLounge - TypeScript 소개
JSLounge - TypeScript 소개Reagan Hwang
 
Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019Adam Tomat
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)David Bosschaert
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.jsAyush Mishra
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaAOE
 
Log in to a Linux VM in Azure using AAD authentication
Log in to a Linux VM in Azure using AAD authenticationLog in to a Linux VM in Azure using AAD authentication
Log in to a Linux VM in Azure using AAD authenticationTakayoshi Tanaka
 
Industrializing the creation of machine images and Docker containers for clou...
Industrializing the creation of machine images and Docker containers for clou...Industrializing the creation of machine images and Docker containers for clou...
Industrializing the creation of machine images and Docker containers for clou...OW2
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityakashdprajapati
 
Apache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawaniApache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawaniBhawani N Prasad
 
支撐英雄聯盟戰績網的那條巨蟒
支撐英雄聯盟戰績網的那條巨蟒支撐英雄聯盟戰績網的那條巨蟒
支撐英雄聯盟戰績網的那條巨蟒Toki Kanno
 
Scale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricScale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricChris Dufour
 
A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)Nati Shalom
 

What's hot (20)

Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communications
 
Gruntwork Executive Summary
Gruntwork Executive SummaryGruntwork Executive Summary
Gruntwork Executive Summary
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP Developers
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
JavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersJavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developers
 
JSLounge - TypeScript 소개
JSLounge - TypeScript 소개JSLounge - TypeScript 소개
JSLounge - TypeScript 소개
 
Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019Supercharging WordPress Development - Wordcamp Brighton 2019
Supercharging WordPress Development - Wordcamp Brighton 2019
 
OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)OSGi Cloud Ecosystems (EclipseCon 2013)
OSGi Cloud Ecosystems (EclipseCon 2013)
 
An Overview of Node.js
An Overview of Node.jsAn Overview of Node.js
An Overview of Node.js
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
 
Log in to a Linux VM in Azure using AAD authentication
Log in to a Linux VM in Azure using AAD authenticationLog in to a Linux VM in Azure using AAD authentication
Log in to a Linux VM in Azure using AAD authentication
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
 
Industrializing the creation of machine images and Docker containers for clou...
Industrializing the creation of machine images and Docker containers for clou...Industrializing the creation of machine images and Docker containers for clou...
Industrializing the creation of machine images and Docker containers for clou...
 
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise securityMuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
MuleSoft ESB Payload Encrypt Decrypt using anypoint enterprise security
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 
Apache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawaniApache spark with akka couchbase code by bhawani
Apache spark with akka couchbase code by bhawani
 
支撐英雄聯盟戰績網的那條巨蟒
支撐英雄聯盟戰績網的那條巨蟒支撐英雄聯盟戰績網的那條巨蟒
支撐英雄聯盟戰績網的那條巨蟒
 
Scale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricScale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App Fabric
 
A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)
 

Similar to Capture, record, clip, embed and play, search: video from newbie to ninja

Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...MUG-Lyon Microsoft User Group
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azureCEDRIC DERUE
 
SCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AISCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AIHiroshi Tanaka
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojosdeconf
 
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBreadDae Kim
 
Windows Azure Web Sites - Things they don’t teach kids in school - Comunity D...
Windows Azure Web Sites- Things they don’t teach kids in school - Comunity D...Windows Azure Web Sites- Things they don’t teach kids in school - Comunity D...
Windows Azure Web Sites - Things they don’t teach kids in school - Comunity D...Maarten Balliauw
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsAndrey Karpov
 
AWS Cyber Security Best Practices
AWS Cyber Security Best PracticesAWS Cyber Security Best Practices
AWS Cyber Security Best PracticesDoiT International
 
Building Your Own IoT Platform using FIWARE GEis
Building Your Own IoT Platform using FIWARE GEisBuilding Your Own IoT Platform using FIWARE GEis
Building Your Own IoT Platform using FIWARE GEisFIWARE
 
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShellCCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShellwalk2talk srl
 
Seguranca em APP Rails
Seguranca em APP RailsSeguranca em APP Rails
Seguranca em APP RailsDaniel Lopes
 
Cloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSCloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSAmine Sadry
 
PHP on Windows and on Azure
PHP on Windows and on AzurePHP on Windows and on Azure
PHP on Windows and on AzureMaarten Balliauw
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroQuickBase, Inc.
 
Integrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteIntegrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteAtlassian
 

Similar to Capture, record, clip, embed and play, search: video from newbie to ninja (20)

Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
 
Playing with php_on_azure
Playing with php_on_azurePlaying with php_on_azure
Playing with php_on_azure
 
SCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AISCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AI
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojo
 
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread
 
Windows Azure Web Sites - Things they don’t teach kids in school - Comunity D...
Windows Azure Web Sites- Things they don’t teach kids in school - Comunity D...Windows Azure Web Sites- Things they don’t teach kids in school - Comunity D...
Windows Azure Web Sites - Things they don’t teach kids in school - Comunity D...
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsPVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
 
Plone pwns
Plone pwnsPlone pwns
Plone pwns
 
AWS Cyber Security Best Practices
AWS Cyber Security Best PracticesAWS Cyber Security Best Practices
AWS Cyber Security Best Practices
 
Building Your Own IoT Platform using FIWARE GEis
Building Your Own IoT Platform using FIWARE GEisBuilding Your Own IoT Platform using FIWARE GEis
Building Your Own IoT Platform using FIWARE GEis
 
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShellCCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
 
Seguranca em APP Rails
Seguranca em APP RailsSeguranca em APP Rails
Seguranca em APP Rails
 
Cloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSCloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWS
 
PHP on Windows and on Azure
PHP on Windows and on AzurePHP on Windows and on Azure
PHP on Windows and on Azure
 
前端概述
前端概述前端概述
前端概述
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Integrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteIntegrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code Suite
 

More from Vito Flavio Lorusso

Automatizzare tutto con Azure Resource Manager
Automatizzare tutto con Azure Resource ManagerAutomatizzare tutto con Azure Resource Manager
Automatizzare tutto con Azure Resource ManagerVito Flavio Lorusso
 
Oltre il Worker Role, da Serverless computing a VM Scale Set
Oltre il Worker Role, da Serverless computing a VM Scale SetOltre il Worker Role, da Serverless computing a VM Scale Set
Oltre il Worker Role, da Serverless computing a VM Scale SetVito Flavio Lorusso
 
Nosql why and how on Microsoft Azure
Nosql why and how on Microsoft AzureNosql why and how on Microsoft Azure
Nosql why and how on Microsoft AzureVito Flavio Lorusso
 
Cosa non fare assolutamente sul cloud
Cosa non fare assolutamente sul cloudCosa non fare assolutamente sul cloud
Cosa non fare assolutamente sul cloudVito Flavio Lorusso
 
Windows azure e il supporto ai paradigmi del cloud
Windows azure e il supporto ai paradigmi del cloudWindows azure e il supporto ai paradigmi del cloud
Windows azure e il supporto ai paradigmi del cloudVito Flavio Lorusso
 
Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013Vito Flavio Lorusso
 
WPC2012 Windows Azure - Architetture e costi nell'era del cloud
WPC2012 Windows Azure - Architetture e costi nell'era del cloudWPC2012 Windows Azure - Architetture e costi nell'era del cloud
WPC2012 Windows Azure - Architetture e costi nell'era del cloudVito Flavio Lorusso
 

More from Vito Flavio Lorusso (8)

Prestashop and Azure
Prestashop and AzurePrestashop and Azure
Prestashop and Azure
 
Automatizzare tutto con Azure Resource Manager
Automatizzare tutto con Azure Resource ManagerAutomatizzare tutto con Azure Resource Manager
Automatizzare tutto con Azure Resource Manager
 
Oltre il Worker Role, da Serverless computing a VM Scale Set
Oltre il Worker Role, da Serverless computing a VM Scale SetOltre il Worker Role, da Serverless computing a VM Scale Set
Oltre il Worker Role, da Serverless computing a VM Scale Set
 
Nosql why and how on Microsoft Azure
Nosql why and how on Microsoft AzureNosql why and how on Microsoft Azure
Nosql why and how on Microsoft Azure
 
Cosa non fare assolutamente sul cloud
Cosa non fare assolutamente sul cloudCosa non fare assolutamente sul cloud
Cosa non fare assolutamente sul cloud
 
Windows azure e il supporto ai paradigmi del cloud
Windows azure e il supporto ai paradigmi del cloudWindows azure e il supporto ai paradigmi del cloud
Windows azure e il supporto ai paradigmi del cloud
 
Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013
 
WPC2012 Windows Azure - Architetture e costi nell'era del cloud
WPC2012 Windows Azure - Architetture e costi nell'era del cloudWPC2012 Windows Azure - Architetture e costi nell'era del cloud
WPC2012 Windows Azure - Architetture e costi nell'era del cloud
 

Recently uploaded

ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxNIMMANAGANTI RAMAKRISHNA
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
Cybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesCybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesLumiverse Solutions Pvt Ltd
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119APNIC
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxAndrieCagasanAkio
 

Recently uploaded (9)

ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptx
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
Cybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesCybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best Practices
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptx
 

Capture, record, clip, embed and play, search: video from newbie to ninja

  • 1. Capture Record Clip Embed and play Search Video from newbie to ninja http://creativecommons.org/licenses/by-nc-sa/3.0/ Vito Flavio Lorusso @vflorusso http://github.com/vflorusso
  • 2.
  • 3. Things that kept me busy… 6. CDN 4. Cloud Ingest2. Broadcaster Toronto Facility 3. Encoding 5. Storage & Streaming 7. Immersive Player Client 15 live feeds 1. FIFA Broadcast Facilities
  • 4. H.264 HLS DASH What does “video in the cloud” look like? INGEST ENCODE DELIVER PACKAGE ENCRYPT
  • 5. “This looks complicated… I am just a web developer… and I want my Youtube”
  • 6. Creating the Media Services Account Create a Storage Account New-AzureStorageAccount -StorageAccountName [name] -Label [label] -Location [location] -Type [storage-type] Create a Media Services Account New-AzureMediaServicesAccount -Name [ams-name] - StorageAccountName [stg-name] -Location [location] Create a Media Services Account Get-AzureMediaServicesAccount -Name [ams-accountname]|Format- Table Name, MediaServicesPrimaryAccountKey
  • 7. Creating the CloudMediaContext using Microsoft.WindowsAzure.MediaServices; using Microsoft.WindowsAzure.MediaServices.Client; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Auth; using Microsoft.WindowsAzure.Storage.Blob; public static CloudMediaContext createAMSContext() { MediaServicesCredentials credentials = new MediaServicesCredentials(amsAccountName, amsAccountKey); CloudMediaContext mediaClient = new CloudMediaContext(credentials); return mediaClient; }
  • 8. Creating your with Azure Youtube Vimeo Dailymotion MP4 Video Upload and Create Asset Media Services Account WEB APP
  • 9. Uploading videos… (1/2) static public IAsset CreateAssetAndUploadSingleFile(CloudMediaContext amsAccount, AssetCreationOptions assetCreationOptions, string singleFilePath) { var assetName = "UploadSingleFile_" + DateTime.UtcNow.ToString(); var asset = CreateEmptyAsset(amsAccount, assetName, assetCreationOptions); var fileName = Path.GetFileName(singleFilePath); var assetFile = asset.AssetFiles.Create(fileName); Console.WriteLine("Created assetFile {0}", assetFile.Name); …
  • 10. Uploading videos… 2/2 var accessPolicy = amsAccount.AccessPolicies.Create(assetName, TimeSpan.FromDays(3), AccessPermissions.Write | AccessPermissions.List); var locator = amsAccount.Locators.CreateLocator(LocatorType.Sas, asset, accessPolicy); Console.WriteLine("Upload {0}", assetFile.Name); assetFile.Upload(singleFilePath); Console.WriteLine("Done uploading of {0} using Upload()", assetFile.Name); locator.Delete(); accessPolicy.Delete(); return asset; } …
  • 11. Creating your with Azure Youtube Vimeo Dailymotion MP4 Video Upload and Create Asset Media Services Account Media Services Encoding Units Process Asset Subtitles Thumbnails manifest Adaptive bitrate MP4 video WEB APP
  • 12. Processing… Encode static public IAsset EncodeToAdaptiveBitrateMP4Set(IAsset asset, string pathToLocalPresetFile) { IJob job = _context.Jobs.Create("Media Encoder Standard Job"); IMediaProcessor processor = GetLatestMediaProcessorByName("Media Encoder Standard"); ITask task = job.Tasks.AddNew("My encoding task", processor, "H264 Multiple Bitrate 720p", TaskOptions.None); task.InputAssets.Add(asset); task.OutputAssets.AddNew("Output asset", AssetCreationOptions.None); job.StateChanged += new EventHandler<JobStateChangedEventArgs>(JobStateChanged); job.Submit(); job.GetExecutionProgressTask(CancellationToken.None).Wait(); return job.OutputMediaAssets[0]; }
  • 13. Processing… Thumbnails <?xml version="1.0" encoding="utf-8"?> <Thumbnail Size="100%,*" Type="Jpeg" Filename="{OriginalFilename}_{Size}_{ThumbnailTime}_{ThumbnailIndex}_{Date}_{Ti me}.{DefaultExtension}"> <Time Value="10%" Step="10%" Stop="95%"/> </Thumbnail> string configuration = File.ReadAllText(Path.GetFullPath(configFilePath + @"Thumbnails.xml")); ITask task = job.Tasks.AddNew("My thumbnail task", processor, configuration, TaskOptions.ProtectedConfiguration);
  • 14. Processing… Subtitles string configuration = string.IsNullOrEmpty(configurationFile) ? "" : File.ReadAllText(configurationFile); ITask task = job.Tasks.AddNew("My Indexing Task", processor, configuration, TaskOptions.None); <?xml version="1.0" encoding="utf-8"?> <configuration version="2.0"> <input> <metadata key="title" value="[Title of the media file]" /> <metadata key="description" value="[Description of the media file]" /> </input> <settings> </settings> <features> <feature name="ASR"> <settings> <add key="Language" value="English"/> <add key="CaptionFormats" value="ttml;sami;webvtt"/> <add key="GenerateAIB" value ="true" /> <add key="GenerateKeywords" value ="true" /> </settings> </feature> </features> </configuration>
  • 15. Creating your with Azure Youtube Vimeo Dailymotion MP4 Video Upload and Create Asset Media Services Account Media Services Encoding Units Process Asset Subtitles Thumbnails manifest Adaptive bitrate MP4 video Media Services Streaming EndpointsCDN WEB APP
  • 16. Creating the Endpoint public static void createStreamingEndpoint(CloudMediaContext amsAccount, string seName) { IStreamingEndpoint amsEndpoint = amsAccount.StreamingEndpoints.Create(seName, 1); amsEndpoint.StartAsync(); }
  • 17. Get the streaming URL (1/2) static string streamSmoothLegacy = "(format=fmp4-v20)"; static string streamDash = "(format=mpd-time-csf)"; static string streamHLSv4 = "(format=m3u8-aapl)"; static string streamHLSv3 = "(format=m3u8-aapl-v3)"; static string streamHDS = "(format=f4m-f4f)"; private static string GetStreamingOriginLocatorEndPoint(CloudMediaContext amsAccount, IAsset assetToStream) { var theManifest = from f in assetToStream.AssetFiles where f.Name.EndsWith(".ism") select f; // Cast the reference to a true IAssetFile type. IAssetFile manifestFile = theManifest.First(); IAccessPolicy policy = null; ILocator originLocator = null; // Create a 30-day readonly access policy. policy = amsAccount.AccessPolicies.Create("Streaming policy", TimeSpan.FromDays(30), AccessPermissions.Read); …
  • 18. // Create an OnDemandOrigin locator to the asset. originLocator = amsAccount.Locators.CreateLocator(LocatorType.OnDemandOrigin, assetToStream, policy, DateTime.UtcNow.AddMinutes(-5)); // Create a full URL to the manifest file. Use this for playback // in streaming media clients. string urlForClientStreaming = originLocator.Path + manifestFile.Name + "/manifest"; // Return the locator. return urlForClientStreaming; } Get the streaming URL (2/2) …
  • 19. Managing Media Services from «code» • Command Line • Windows: PowerShell • Code • Azure Media Services REST APIs • Azure Media Services SDK for .NET • Azure SDK for Java • Azure Media Services for Node.js • Azure PHP SDK
  • 20. Wrapping up: what makes a Media Service Media Service Account Storage Account AssetAssetAsset Streaming Endpoint Streaming Unit Encoding Job Task Live Streaming Channel Program
  • 21. Creating your with Azure Youtube Vimeo Dailymotion MP4 Video Upload and Create Asset Media Services Account Media Services Encoding Units Process Asset Subtitles Thumbnails manifest Adaptive bitrate MP4 video Media Services Streaming EndpointsCDN Azure Search WEB APP <video /> <img /> <input /> <div />
  • 22. Create Search Account #only lowercase letters and numbers accepted $searchdeploymentname = "vitolosearch01" $dbdeploymentname = "vitotestdb02" $dbservername = "vitotestdbsrv02" $dbadminname = "vito" $dbpassword = Read-Host "Type DB password" #parameters for creating the search service $searchparams = @{name=$deploymentname; location=$location; sku= "standard"; replicaCount=1; partitionCount=1} Switch-AzureMode AzureResourceManager Add-AzureAccount -Credential $credential Select-AzureSubscription $subscriptionName New-AzureResourceGroup –Name $resourcegroupname –Location $location New-AzureResourceGroupDeployment -ResourceGroupName $resourcegroupname - nameFromTemplate $searchdeploymentname -DeploymentName $searchdeploymentname - TemplateFile .Microsoft.Search.1.0.5.json -TemplateParameterObject $searchparams
  • 23. Create Index string searchServiceName = ConfigurationManager.AppSettings["SearchServiceName"]; string apiKey = ConfigurationManager.AppSettings["SearchServiceApiKey"]; _searchClient = new SearchServiceClient(searchServiceName, new SearchCredentials(apiKey)); _indexClient = _searchClient.Indexes.GetClient(_moviesIndexName); _serviceUri = new Uri("https://" + ConfigurationManager.AppSettings["SearchServiceName"] + ".search.windows.net"); _httpClient = new HttpClient(); _httpClient.DefaultRequestHeaders.Add("api-key", apiKey); CreateMovieIndex();
  • 24. CreateMovieIndex() internal static void CreateIndex(string collectionName) { try { var definition = new Index() { Name = collectionName, Fields = new[] { new Field(“MOVIE_KEY", DataType.String) { IsKey = true, IsSearchable = false, IsFilterable = false, IsSortable = false, IsFacetable = false, IsRetrievable = true}, new Field(“MOVIE_DATA", DataType.String) { IsKey = false, IsSearchable = true, IsFilterable = true, IsSortable = false, IsFacetable = true, IsRetrievable = true} } }; _searchClient.Indexes.Create(definition); } catch (Exception ex) { Console.WriteLine("Error creating index: {0}rn", ex.Message.ToString()); } }
  • 25. Wrap up: Azure Search Search Service Client Collection Index Fields Facets Indexer Search Query key
  • 26. Creating your with Azure Youtube Vimeo Dailymotion MP4 Video Upload and Create Asset Media Services Account Media Services Encoding Units Process Asset Subtitles Thumbnails manifest Adaptive bitrate MP4 video Media Services Streaming EndpointsCDN Azure Search WEB APP <video /> <img /> <input /> <div />
  • 27. The web page: Media Player <link href=“http://amp.azure.net/libs/amp/latest/skins/amp- default/azuremediaplayer.min.css" rel="stylesheet"> <script src= “http://amp.azure.net/libs/amp/[version]/azuremediaplayer.min.js"></script> <video id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" poster="poster.jpg" data- setup='{"nativeControlsForTouch": false}'> <source src="http://amssamples.streaming.mediaservices.windows.net/91492 735-c523-432b-ba01- faba6c2206a2/AzureMediaServicesPromo.ism/manifest" type="application/vnd.ms-sstr+xml" /> <p class="amp-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video </p> </video>
  • 28. The web page: Search <html> <head> <script src="azure-search.min.js"></script> </head> <body> <script> var client = AzureSearch({ url: "https://MY_SEARCH_SERVICE_NAME.search.windows.net", key:"MY_QUERY_KEY" }); client.search('myindex', {search:'document'}, function(err, results){ // results is an array of matching documents }); </script> </body> </html>
  • 30. Useful links Azure Media Services Dev Center http://azure.microsoft.com/en-us/develop/media-services/ Azure Media Services Explorer http://aka.ms/amse Azure Media Player http://aka.ms/azuremediaplayer Azure Search https://azure.microsoft.com/en- us/documentation/articles/search-workflow/