GetEncoderMediaProcessor() public static method

public static GetEncoderMediaProcessor ( CloudMediaContext context ) : IMediaProcessor
context CloudMediaContext
return IMediaProcessor
示例#1
0
        private IAsset CreateMbrMp4Asset(AssetCreationOptions options)
        {
            IMediaProcessor encoder = JobTests.GetEncoderMediaProcessor(_mediaContext);
            IJob            job     = _mediaContext.Jobs.Create("Job for ValidateEffectiveEncryptionStatusOfMultiBitRateMP4");

            ITask adpativeBitrateTask = job.Tasks.AddNew("MP4 to Adaptive Bitrate Task",
                                                         encoder,
                                                         "H264 Adaptive Bitrate MP4 Set 720p",
                                                         TaskOptions.None);

            // Specify the input Asset
            IAsset asset = AssetTests.CreateAsset(_mediaContext, WindowsAzureMediaServicesTestConfiguration.SmallMp41, AssetCreationOptions.None);

            adpativeBitrateTask.InputAssets.Add(asset);

            // Add an output asset to contain the results of the job.
            // This output is specified as AssetCreationOptions.None, which
            // means the output asset is in the clear (unencrypted).
            IAsset abrAsset = adpativeBitrateTask.OutputAssets.AddNew("Multibitrate MP4s", options);

            job.Submit();

            job.GetExecutionProgressTask(CancellationToken.None).Wait();

            job.Refresh();

            return(job.OutputMediaAssets[0]);
        }
        public void ShouldCreateTaskUsingStorageEncryptedAsset()
        {
            var             filePaths = new[] { WindowsAzureMediaServicesTestConfiguration.SmallWmv };
            IAsset          asset     = AssetTests.CreateAsset(_mediaContext, Path.GetFullPath(WindowsAzureMediaServicesTestConfiguration.SmallWmv), AssetCreationOptions.StorageEncrypted);
            IMediaProcessor processor = JobTests.GetEncoderMediaProcessor(_mediaContext);
            IJob            job       = _mediaContext.Jobs.Create("Encode Job with encrypted asset");
            ITask           task      = job.Tasks.AddNew("Task 1", processor, JobTests.GetWamePreset(processor), TaskOptions.None);

            task.InputAssets.Add(asset);
            task.OutputAssets.AddNew("Encrypted Output", AssetCreationOptions.StorageEncrypted);
            job.Submit();
            JobTests.WaitForJob(job.Id, JobState.Finished, JobTests.VerifyAllTasksFinished);

            CloudMediaContext context2 = WindowsAzureMediaServicesTestConfiguration.CreateCloudMediaContext();
            IJob job2 = context2.Jobs.Where(c => c.Id == job.Id).Single();

            foreach (IAsset outputAsset in job2.Tasks[0].OutputAssets)
            {
                VerifyFileAndContentKeyMetadataForStorageEncryption(outputAsset, _mediaContext);
            }
        }