From ca2e27b2c6dd70c24c3b983adb53e39c68ebc9aa Mon Sep 17 00:00:00 2001 From: mnicolescu Date: Mon, 26 Nov 2018 17:25:58 +0100 Subject: [PATCH] Update documentation --- .../Samples/Analyzing/README.md | 52 ++++++++++- .../Tasks/Media/Analyzing/README.md | 86 +++++++++++++++++++ README.md | 2 + 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 ProcessMyMedia/Tasks/Media/Analyzing/README.md diff --git a/ProcessMyMedia.Samples/Samples/Analyzing/README.md b/ProcessMyMedia.Samples/Samples/Analyzing/README.md index 5f28270..0101cfa 100644 --- a/ProcessMyMedia.Samples/Samples/Analyzing/README.md +++ b/ProcessMyMedia.Samples/Samples/Analyzing/README.md @@ -1 +1,51 @@ - \ No newline at end of file +# Analyzing Samples + +## Analyse Asset + +The sample : + +1. Ingest a new asset +2. Launch the analyse task +2. Download the result then remove input/output asset + + +```c# + + public class AnalyzeAssetWorkflow : IWorkflow +{ + public void Build(IWorkflowBuilder builder) + { + builder + .UseDefaultErrorBehavior(WorkflowErrorHandling.Terminate) + .StartWith() + .Input(task => task.AssetDirectoryPath, data => data.MediaDirectory) + .Input(task => task.AssetName, data => data.InputAssetName) + .Then() + .Input(task => task.AssetName, data => data.InputAssetName) + .Output(data => data.OutputAssetName, task => task.Output.Result.OutputAssetName) + .Then() + .Input(task => task.AssetName, data => data.InputAssetName) + .If(data => !string.IsNullOrEmpty(data.OutputAssetName)) + .Do(then => + //Get the analysing result + then.StartWith() + .Input(task => task.AssetName, data => data.OutputAssetName) + .Input(task => task.DirectoryToDownload, data => data.DirectoryToDownload) + //Delete output asset (analysing result) + .Then< Tasks.DeleteAssetTask>() + .Input(task => task.AssetName, data => data.OutputAssetName)); + } +} + +public class AnalyzeAssetWorkflowData +{ + public string MediaDirectory { get; set; } + + public string InputAssetName { get; set; } + + public string OutputAssetName { get; set; } + + public string DirectoryToDownload { get; set; } +} + +``` \ No newline at end of file diff --git a/ProcessMyMedia/Tasks/Media/Analyzing/README.md b/ProcessMyMedia/Tasks/Media/Analyzing/README.md new file mode 100644 index 0000000..f411bbb --- /dev/null +++ b/ProcessMyMedia/Tasks/Media/Analyzing/README.md @@ -0,0 +1,86 @@ +# Analyzing Tasks + +## AnalyzeFileTask + +Annalyse a media file. This task produce an asset the analysing result. +The primary output file of analyzing videos is called insights.json. +This file contains insights about your video. You can find description of elements found in the json file in the [Media intelligence article](https://docs.microsoft.com/fr-fr/azure/media-services/latest/analyzing-video-audio-files-concept). + + + + + + + + + + + + + + + + + + + + + +
Input
Property NameTypeDescriptionIs Required ?
FilePathstringFull path of the file to analyse.Yes
AnalyzingParametersAnalyzingParametersAnalyse optionsNo
+ + + + + + + + + + + + + +
Output
Property NameTypeDescription
ResultAnalyzingResultGet the asset id of the analyzing result.
+ +## AnalyzeAssetTask + +Annalyse a media asset. This task produce an asset the analysing result. +The primary output file of analyzing videos is called insights.json. +This file contains insights about your video. You can find description of elements found in the json file in the [Media intelligence article](https://docs.microsoft.com/fr-fr/azure/media-services/latest/analyzing-video-audio-files-concept). + + + + + + + + + + + + + + + + + + + + + +
Input
Property NameTypeDescriptionIs Required ?
AssetNamestringAsset name to analyse.Yes
AnalyzingParametersAnalyzingParametersAnalyse optionsNo
+ + + + + + + + + + + + + +
Output
Property NameTypeDescription
ResultAnalyzingResultGet the asset id of the analyzing result.
+ diff --git a/README.md b/README.md index 638a5f7..fccff7f 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Install-Package ProcessMyMedia -Version 1.0.0.56 * [Asset Tasks](ProcessMyMedia/Tasks/Media/Asset) * [Encoding Tasks](ProcessMyMedia/Tasks/Media/Encoding) +* [Analyzing Tasks](ProcessMyMedia/Tasks/Media/Analyzing) * [Data Factory Tasks](ProcessMyMedia/Tasks/Data) ### Model documentation @@ -27,6 +28,7 @@ Install-Package ProcessMyMedia -Version 1.0.0.56 * [Asset Samples](ProcessMyMedia.Samples/Samples/Asset) * [Encoding Samples](ProcessMyMedia.Samples/Samples/Encoding) +* [Analyzing Samples](ProcessMyMedia.Samples/Samples/Analyzing) * [Data Factory Samples](ProcessMyMedia.Samples/Samples/Data) ## License