编码现有blob而不是从本地文件夹上载

时间:2016-08-26 07:58:48

标签: c# azure azure-storage azure-media-services

我有一个C#程序,可以从我的本地文件夹上传编码发布视频。我想更改"文件路径"到了" blob"的URI在azure存储帐户中。即,不是上传视频和编码发布,而是处理上传的视频和编码发布。任何人都建议采用一种方法来实现这一点。

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);
            }
         }   
     } 
 }

1 个答案:

答案 0 :(得分:0)

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