通过从 HTML5 批量上传到 Azure 媒体服务来摄取视频

Ingesting videos via bulk uploading into Azure media services from HTML5

我正在开发一个项目(网络 api、Angularjs、HTML5、CSS3),目前允许用户一次上传一个视频文件通过从网络获取定位器的时间 api 使用定位器 url.

调用并通过分块上传视频

现在我必须提供一个页面,用户可以在其中将视频拖放到网页上的某个区域并将所有视频文件批量上传到 Azure 媒体服务。似乎为每个要上传的文件生成一个定位器并一次执行一个直到它们全部完成似乎不是最有效的。当需要通过 html5 拖放将所有视频文件大量上传到媒体服务时,最佳选择是什么?

我找到了详细说明如何使用批量上传的示例,其中提供了 url 以上传到此处:https://azure.microsoft.com/en-us/documentation/articles/media-services-dotnet-upload-files/。问题是我如何使用这个 url 从 html5 上传?我目前上传单个视频的方式是生成一个 SAS URL 并使用 http 方法 put 将块上传到单个 url 而从批量上传返回的 url 似乎是一个url 您用于通过第三方工具上传,根据上面发布的 link,而不是 html5 使用 FileReader。

对于这种情况应该使用哪种方法,我真的很困惑。关键项目是我必须使用 html5 但允许用户拖放任意数量的视频,这些视频需要在过程中的某个时刻全部发布到媒体服务。老实说,我目前的问题是我拥有所有这些选项,但不确定从哪里开始。

It seems like generating a locator for each file to be uploaded and doing one at a time until they are all complete does not seem the most efficient. What is the best option for mass uploading all video files into media services when it needs to be done via html5 with drag and drop?

一次上传一个文件可能是最好的解决方案,因为一般用户的上传速度非常有限。单次上传会使带宽饱和,并且 TCP 开销最小(仅来自一个连接)。

The problem with this is how would I use this url to upload from html5?

呼叫 Azzure's REST API (instead of .NET API from the link you provided) directly from JavaScript seems to be a better choice since it eliminates the need to write server-side code. The simplest way of calling REST API from angular is using $http service. You can also operate on higher level of abstraction by using $resource service.