在对视频进行编码后创建缩略图时出现错误。我的脚本中没有任何错误,但是当我尝试在 asp:image 中加载 url 时,出现以下错误
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
ResourceNotFound
<Message>
The specified resource does not exist. RequestId:2224a828-0001-0011-4b57-900926000000 Time:2014-12-28T21:38:07.2803364Z
</Message>
</Error>
//Thumbnail Creation
IJob job1 = context.Jobs.Create("Thumbnail job");
IMediaProcessor processor1 = (from p in context.MediaProcessors where p.Name == "Windows Azure Media Encoder" select p).ToList().OrderBy(wame => new Version(wame.Version)).LastOrDefault();
ITask thumbnailTask = job1.Tasks.AddNew("Thumbnail Task", processor, "Thumbnails", TaskOptions.ProtectedConfiguration);
thumbnailTask.InputAssets.Add(inputAsset);
thumbnailTask.OutputAssets.AddNew(string.Format("{0} Thumbnails", CreateAsset), AssetCreationOptions.None);
job1.Submit();
job1.GetExecutionProgressTask(CancellationToken.None).Wait();
IAsset thumbnailAsset = job1.OutputMediaAssets[0];
var jpgAssetFile = thumbnailAsset.AssetFiles.ToList().Where(f => f.Name.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase)).First();
IAccessPolicy thumbpolicy = context.AccessPolicies.Create("Streaming policy", TimeSpan.FromDays(365), AccessPermissions.Read);
ILocator thumboriginLocator = context.Locators.CreateLocator(LocatorType.OnDemandOrigin, thumbnailAsset, thumbpolicy, DateTime.UtcNow.AddMinutes(-5));
编辑
IJob thumbjob = context.Jobs.Create("My Thumbnail job");
IMediaProcessor processor = (from p in context.MediaProcessors where p.Name == "Windows Azure Media Encoder" select p).ToList().OrderBy(wame => new Version(wame.Version)).LastOrDefault();
ITask task = thumbjob.Tasks.AddNew("My thumbnail task", processor, "Thumbnails", TaskOptions.ProtectedConfiguration);
task.InputAssets.Add(inputAsset);
task.OutputAssets.AddNew("Output asset", AssetCreationOptions.None);
thumbjob.Submit();
IAsset thumbnailAsset = context.Assets.Create(trainingfolder + "_" + Path.GetFileNameWithoutExtension(fileName) + "_thumb", AssetCreationOptions.None);
IAccessPolicy accessPolicy = context.AccessPolicies.Create("Thumb Policy", TimeSpan.FromDays(30), AccessPermissions.Read | AccessPermissions.Write);
ILocator locator = context.Locators.CreateLocator(LocatorType.Sas, thumbnailAsset, accessPolicy);