gpt4 book ai didi

c# - 对现有 blob 进行编码,而不是从本地文件夹上传

转载 作者:行者123 更新时间:2023-12-03 04:29:12 29 4
gpt4 key购买 nike

我有一个 C# 程序,可以从本地文件夹上传、编码和发布视频。我想将 azure 存储帐户中的“文件路径”更改为“blob 的 URI”。即不是上传视频并编码发布,而是处理上传的视频并编码发布。任何人都请建议一种实现此目的的方法。

namespace OnDemandEncodingWithMES
{
class Program
{
// Read values from the App.config file.

static void Main(string[] args)
{
try
{
// Create and cache the Media Services credentials in a static class variable.
_cachedCredentials = new MediaServicesCredentials(_mediaServicesAccountName,_mediaServicesAccountKey);

Console.WriteLine("Upload a file.\n");
IAsset inputAsset =
UploadFile(Path.(_mediaFiles, @"video.mp4"), AssetCreationOptions.None);

Console.WriteLine("Generate thumbnails and get URLs.\n");
IAsset thumbnailAsset = GenerateThumbnail(inputAsset, AssetCreationOptions.None);
PublishAssetGetURLs(thumbnailAsset, false, ".bmp");

Console.WriteLine("Encode to audio and get an on demand URL.\n");
IAsset audioOnly = EncodeToAudioOnly(inputAsset, AssetCreationOptions.None);
PublishAssetGetURLs(audioOnly);

Console.WriteLine("Encode to adaptive bitraite MP4s and get on demand URLs.\n");
IAsset encodedAsset =
EncodeToAdaptiveBitrateMP4s(inputAsset, AssetCreationOptions.StorageEncrypted);

PublishAssetGetURLs(encodedAsset);
}
}
}
}

最佳答案

检查https://azure.microsoft.com/en-us/documentation/articles/media-services-copying-existing-blob/ 。示例演示如何从现有的 Azure 存储帐户创建 Azure 媒体服务 Assets

关于c# - 对现有 blob 进行编码,而不是从本地文件夹上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39161245/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com