简体   繁体   English

来自Blob存储的Azure媒体服务

[英]azure media services from blob storage

I find some relevant answers but none that explains if I really need all the code from the Azure Media Services teams example at https://azure.microsoft.com/en-us/documentation/articles/media-services-copying-existing-blob/ I just want to upload a file from blob to Azure Media Services. 我找到了一些相关的答案,但没有一个能解释我是否真的需要来自Azure媒体服务团队示例的所有代码, 网址https://azure.microsoft.com/zh-cn/documentation/articles/media-services-copying-existing- blob /我只想将文件从blob上传到Azure媒体服务。 Like this: 像这样:

  var uploadFilePath = blobUrl;
  var uploadAsset = _context.Assets.Create(Path.GetFileNameWithoutExtension(uploadFilePath), AssetCreationOptions.None);
  var assetFile = uploadAsset.AssetFiles.Create(Path.GetFileName(uploadFilePath));
  assetFile.Upload(uploadFilePath);

But I'm getting 但是我越来越

AggregateException was unhandled by user code, "An exception of type 'System.AggregateException' occurred in mscorlib.dll but was not handled in user code" 用户代码未处理AggregateException,“ mscorlib.dll中发生类型'System.AggregateException'的异常,但未在用户代码中处理”

Stack trace 堆栈跟踪

at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Microsoft.WindowsAzure.MediaServices.Client.AssetFileData.Upload(String path) at UploadMediaServicesExample.Services.MediaHandler.AddFileToMediaServices(String blobUrl) in C:\\Source\\UploadMediaServicesExample\\UploadMediaServicesExample\\Services\\MediaHandler.cs:line 51 at UploadMediaServicesExample.Controllers.HomeController.UploadVideo(IEnumerable 1 file) in C:\\Source\\UploadMediaServicesExample\\UploadMediaServicesExample\\Controllers\\HomeController.cs:line 24 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary 2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext 在System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)在System.Threading.Tasks.Task.Wait(Int32毫秒超时,CancellationToken cancellingToken)在Microsoft.WindowsAzure.MediaServices.Client.AssetFileData.Upload(String路径)在UploadMediaServicesExample。 C:\\ Source \\ UploadMediaServicesExample \\ UploadMediaServicesExample \\中的UploadMediaServicesExample.Controllers.HomeController.UploadVideo(IEnumerable 1 file) in C:\\Source\\UploadMediaServicesExample\\UploadMediaServicesExample\\Controllers\\HomeController.cs:line 24 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary处的C:\\ Source \\ UploadMediaServicesExample \\ UploadMediaServicesExample \\ Services \\ MediaHandler.cs:line 51中的Services.MediaHandler.AddFileToMediaServices(String blobUrl) 1 file) in C:\\Source\\UploadMediaServicesExample\\UploadMediaServicesExample\\Controllers\\HomeController.cs:line 24 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary 2参数)在System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext) controllerContext, ActionDescriptor actionDescriptor, IDictionary 2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult 2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.b__3f() 2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult controllerContext,ActionDescriptor actionDescriptor,IDictionary 2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult 2.CallEnd位于System.Web.Mvc.Async.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()处,位于System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3d()处System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)在System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters。<> c__DisplayClass46.b__3f()

Additional information: One or more errors occurred. 附加信息:发生一个或多个错误。

Here is the blob Uri which is public.. " https://mulimo.blob.core.windows.net/temporary-files/clip.mp4 " 这是公开的Blob Uri。“” https://mulimo.blob.core.windows.net/temporary-files/clip.mp4

Asset file upload method not supporting upload from blobs. 资产文件上传方法不支持从Blob上传。 It is only working with local files. 它仅适用于本地文件。 Regarding exception you should see message in inner exception message property. 关于异常,您应该在内部异常消息属性中看到消息。 You can use azure media services extensions (or see how it is done there) https://github.com/Azure/azure-sdk-for-media-services-extensions to create asset from existing blob. 您可以使用azure媒体服务扩展(或在此处查看如何完成) https://github.com/Azure/azure-sdk-for-media-services-extensions从现有Blob创建资产。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM