Skip to content

Commit ca2e27b

Browse files
mnicolescumnicolescu
mnicolescu
authored and
mnicolescu
committed
Update documentation
1 parent 04df78e commit ca2e27b

File tree

3 files changed

+139
-1
lines changed

3 files changed

+139
-1
lines changed
Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1-

1+
# Analyzing Samples
2+
3+
## Analyse Asset
4+
5+
The sample :
6+
7+
1. Ingest a new asset
8+
2. Launch the analyse task
9+
2. Download the result then remove input/output asset
10+
11+
12+
```c#
13+
14+
public class AnalyzeAssetWorkflow : IWorkflow<AnalyzeAssetWorkflowData>
15+
{
16+
public void Build(IWorkflowBuilder<AnalyzeAssetWorkflowData> builder)
17+
{
18+
builder
19+
.UseDefaultErrorBehavior(WorkflowErrorHandling.Terminate)
20+
.StartWith<Tasks.IngestFromDirectoryTask>()
21+
.Input(task => task.AssetDirectoryPath, data => data.MediaDirectory)
22+
.Input(task => task.AssetName, data => data.InputAssetName)
23+
.Then<Tasks.AnalyzeAssetTask>()
24+
.Input(task => task.AssetName, data => data.InputAssetName)
25+
.Output(data => data.OutputAssetName, task => task.Output.Result.OutputAssetName)
26+
.Then<Tasks.DeleteAssetTask>()
27+
.Input(task => task.AssetName, data => data.InputAssetName)
28+
.If(data => !string.IsNullOrEmpty(data.OutputAssetName))
29+
.Do(then =>
30+
//Get the analysing result
31+
then.StartWith<Tasks.DownloadAssetTask>()
32+
.Input(task => task.AssetName, data => data.OutputAssetName)
33+
.Input(task => task.DirectoryToDownload, data => data.DirectoryToDownload)
34+
//Delete output asset (analysing result)
35+
.Then< Tasks.DeleteAssetTask>()
36+
.Input(task => task.AssetName, data => data.OutputAssetName));
37+
}
38+
}
39+
40+
public class AnalyzeAssetWorkflowData
41+
{
42+
public string MediaDirectory { get; set; }
43+
44+
public string InputAssetName { get; set; }
45+
46+
public string OutputAssetName { get; set; }
47+
48+
public string DirectoryToDownload { get; set; }
49+
}
50+
51+
```
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Analyzing Tasks
2+
3+
## AnalyzeFileTask
4+
5+
Annalyse a media file. This task produce an asset the analysing result.
6+
The primary output file of analyzing videos is called insights.json.
7+
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).
8+
9+
<table>
10+
<caption>Input</caption>
11+
<tr>
12+
<th>Property Name</th>
13+
<th>Type</th>
14+
<th>Description</th>
15+
<th>Is Required ?</th>
16+
</tr>
17+
<tr>
18+
<td>FilePath</td>
19+
<td>string</td>
20+
<td>Full path of the file to analyse.</td>
21+
<td>Yes</td>
22+
</tr>
23+
<tr>
24+
<td>AnalyzingParameters</td>
25+
<td>AnalyzingParameters</td>
26+
<td>Analyse options</td>
27+
<td>No</td>
28+
</tr>
29+
</table>
30+
31+
<table>
32+
<caption>Output</caption>
33+
<tr>
34+
<th>Property Name</th>
35+
<th>Type</th>
36+
<th>Description</th>
37+
</tr>
38+
<tr>
39+
<td>Result</td>
40+
<td>AnalyzingResult</td>
41+
<td>Get the asset id of the analyzing result.</td>
42+
</tr>
43+
</table>
44+
45+
## AnalyzeAssetTask
46+
47+
Annalyse a media asset. This task produce an asset the analysing result.
48+
The primary output file of analyzing videos is called insights.json.
49+
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).
50+
51+
<table>
52+
<caption>Input</caption>
53+
<tr>
54+
<th>Property Name</th>
55+
<th>Type</th>
56+
<th>Description</th>
57+
<th>Is Required ?</th>
58+
</tr>
59+
<tr>
60+
<td>AssetName</td>
61+
<td>string</td>
62+
<td>Asset name to analyse.</td>
63+
<td>Yes</td>
64+
</tr>
65+
<tr>
66+
<td>AnalyzingParameters</td>
67+
<td>AnalyzingParameters</td>
68+
<td>Analyse options</td>
69+
<td>No</td>
70+
</tr>
71+
</table>
72+
73+
<table>
74+
<caption>Output</caption>
75+
<tr>
76+
<th>Property Name</th>
77+
<th>Type</th>
78+
<th>Description</th>
79+
</tr>
80+
<tr>
81+
<td>Result</td>
82+
<td>AnalyzingResult</td>
83+
<td>Get the asset id of the analyzing result.</td>
84+
</tr>
85+
</table>
86+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Install-Package ProcessMyMedia -Version 1.0.0.56
1515

1616
* [Asset Tasks](ProcessMyMedia/Tasks/Media/Asset)
1717
* [Encoding Tasks](ProcessMyMedia/Tasks/Media/Encoding)
18+
* [Analyzing Tasks](ProcessMyMedia/Tasks/Media/Analyzing)
1819
* [Data Factory Tasks](ProcessMyMedia/Tasks/Data)
1920

2021
### Model documentation
@@ -27,6 +28,7 @@ Install-Package ProcessMyMedia -Version 1.0.0.56
2728

2829
* [Asset Samples](ProcessMyMedia.Samples/Samples/Asset)
2930
* [Encoding Samples](ProcessMyMedia.Samples/Samples/Encoding)
31+
* [Analyzing Samples](ProcessMyMedia.Samples/Samples/Analyzing)
3032
* [Data Factory Samples](ProcessMyMedia.Samples/Samples/Data)
3133

3234
## License

0 commit comments

Comments
 (0)