Azure Video Indexer 示例项目教程

Azure Video Indexer 示例项目教程

azure-video-indexer-samples Contains the Azure Media Services Video Indexer samples azure-video-indexer-samples 项目地址: https://gitcode.com/gh_mirrors/az/azure-video-indexer-samples

1. 项目目录结构及介绍

azure-video-indexer-samples/
├── API-Samples/
│   ├── C#/
│   ├── Python/
│   └── ...
├── BringYourOwn-Samples/
│   ├── ...
│   └── ...
├── Deploy-Samples/
│   ├── ARM/
│   ├── Bicep/
│   └── ...
├── Embedding widgets/
│   ├── ...
│   └── ...
├── LogicApp-Samples/
│   ├── ...
│   └── ...
├── VideoIndexerEnabledByArc/
│   ├── ...
│   └── ...
├── VideoQnA-Demo/
│   ├── ...
│   └── ...
├── media/
│   ├── ...
│   └── ...
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
└── SECURITY.md

目录结构介绍

  • API-Samples: 包含使用不同编程语言(如C#、Python等)的API示例代码。
  • BringYourOwn-Samples: 包含自定义示例代码,展示如何将Video Indexer集成到现有产品中。
  • Deploy-Samples: 包含使用ARM或Bicep进行资源部署的示例。
  • Embedding widgets: 展示如何将Video Indexer的嵌入式小部件添加到应用程序中。
  • LogicApp-Samples: 包含使用逻辑应用的示例。
  • VideoIndexerEnabledByArc: 包含通过Arc启用的Video Indexer示例。
  • VideoQnA-Demo: 包含视频问答演示的示例。
  • media: 包含用于Markdown文件的媒体文件。
  • .gitignore: 定义在提交时忽略的文件。
  • CODE_OF_CONDUCT.md: 行为准则文件。
  • CONTRIBUTING.md: 贡献指南文件。
  • LICENSE: 项目许可证文件。
  • README.md: 项目自述文件。
  • SECURITY.md: 安全策略文件。

2. 项目启动文件介绍

API-Samples目录下,每个子目录(如C#、Python等)都包含一个启动文件,用于演示如何使用Video Indexer API上传和索引视频。例如,在API-Samples/C#/目录下,可能会有一个Program.cs文件,这是C#示例的启动文件。

示例启动文件

// API-Samples/C#/Program.cs
using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace AzureVideoIndexerSample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            // 初始化HttpClient
            var client = new HttpClient();
            // 设置API密钥
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "YOUR_API_KEY");
            // 上传视频并索引
            var response = await client.PostAsync("https://api.videoindexer.ai/videos", new StringContent("video_url"));
            // 处理响应
            var result = await response.Content.ReadAsStringAsync();
            Console.WriteLine(result);
        }
    }
}

3. 项目的配置文件介绍

Deploy-Samples目录下,通常会有一个配置文件,用于定义资源部署的参数。例如,在Deploy-Samples/ARM/目录下,可能会有一个azuredeploy.json文件,这是ARM模板的配置文件。

示例配置文件

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "location": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]",
      "metadata": {
        "description": "The location in which the resources will be deployed."
      }
    },
    "videoIndexerAccountName": {
      "type": "string",
      "metadata": {
        "description": "The name of the Video Indexer account."
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.VideoIndexer/accounts",
      "apiVersion": "2021-01-01",
      "name": "[parameters('videoIndexerAccountName')]",
      "location": "[parameters('location')]",
      "properties": {}
    }
  ]
}

这个配置文件定义了部署Video Indexer账户所需的参数和资源。

azure-video-indexer-samples Contains the Azure Media Services Video Indexer samples azure-video-indexer-samples 项目地址: https://gitcode.com/gh_mirrors/az/azure-video-indexer-samples

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

宁烈廷

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值