编码现有的 blob 而不是从本地文件夹上传
Encode existing blob instead of uploading from a local folder
我有一个 C# 程序可以从我的本地 folder.I 上传-编码-发布视频,想将 "filepath" 更改为 Azure 存储帐户中的 "URI of blob"。即,不是上传视频并编码发布,而是处理上传的视频并编码发布。任何人都请提出一种实现此方法的方法。
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 媒体服务资产
我有一个 C# 程序可以从我的本地 folder.I 上传-编码-发布视频,想将 "filepath" 更改为 Azure 存储帐户中的 "URI of blob"。即,不是上传视频并编码发布,而是处理上传的视频并编码发布。任何人都请提出一种实现此方法的方法。
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 媒体服务资产