【发布时间】:2014-01-06 00:53:37
【问题描述】:
我在使用 Azure 媒体服务时遇到了一些问题。我已成功将文件上传到 Azure 媒体服务并将其编码为 mp4,但这仅适用于 Visual Studio 中的 localhost。当我将以下代码部署到 Azure 虚拟机 Windows Datacenter 2012 版时,文件已上传但从未创建编码作业。
非常感谢任何帮助!
这是我用来创建作业的代码:
// Declare a new job.
job= _context.Jobs.Create("New Job");
// Get a media processor reference, and pass to it the name of the
// processor to use for the specific task.
IMediaProcessor processor = GetLatestMediaProcessorByName("Windows Azure Media Encoder");
// Create a task with the encoding details, using a string preset.
ITask task = job.Tasks.AddNew("LSVEncodingTask_" + v.CompanyId + "_user" + v.UserId,
processor,
"H264 Broadband 1080p",
TaskOptions.ProtectedConfiguration);
// Specify the input asset to be encoded.
task.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 not encrypted.
task.OutputAssets.AddNew("output asset",
AssetCreationOptions.None);
// Use the following event handler to check job progress.
job.StateChanged += new
EventHandler<JobStateChangedEventArgs>(StateChanged);
// Launch the job.
job.Submit();
// Check job execution and wait for job to finish.
Task progressJobTask = job.GetExecutionProgressTask(CancellationToken.None);
编辑:
进行了一些挖掘(记录...)并找到了堆栈跟踪:
System.Security.Cryptography.CryptographicException: Access is denied.
at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
at Microsoft.WindowsAzure.MediaServices.Client.EncryptionUtils.SaveCertificateToStore(X509Certificate2 certToStore)
at Microsoft.WindowsAzure.MediaServices.Client.ContentKeyBaseCollection.GetCertificateForProtectionKeyId(IMediaDataServiceContext dataContext, String protectionKeyId)
at Microsoft.WindowsAzure.MediaServices.Client.JobData.ProtectTaskConfiguration(TaskData task, X509Certificate2& certToUse, IMediaDataServiceContext dataContext)
at Microsoft.WindowsAzure.MediaServices.Client.JobData.InnerSubmit(IMediaDataServiceContext dataContext)
at Microsoft.WindowsAzure.MediaServices.Client.JobData.SubmitAsync()
at Microsoft.WindowsAzure.MediaServices.Client.JobData.Submit()
at Livescreen.Domain.Implementation.AzureMediaManager.CreateEncodingJob(IAsset asset, String inputMediaFilePath, String outputFolder, Int32 videoId)
【问题讨论】:
-
告诉我们到目前为止您为诊断/调试问题所做的尝试?有像 Fiddler 这样的工具非常适合跟踪 Web 请求。有诸如 Windows 事件日志之类的东西,您可以在其中查找可疑条目等。请先尝试自己解决问题,然后在此处提供尝试的解决方案和失败代码/堆栈跟踪以提供帮助。
标签: azure iis-8 windows-server-2012 azure-media-services