Amazon S3 Hosting Streaming Video

妖精的绣舞 提交于 2020-12-27 07:52:05

问题


If I make an Amazon s3 MP4 resource publically availible and then throw the Html5 Video tag around the resource's URL will it stream? Is it really that simple. There are a lot of "encoding" api's out there such as pandastream and zencoder and I'm not sure exactly what these companies do. Do they just manage bandwidth allocation(upgrading/downgrading stream quality and delivery rate/cross-platform optimization?) Or do encoding services do more then that.


回答1:


This is Brandon from Zencoder. What you're looking for is probably something like Video JS (videojs.com) for video playback. You can just upload an MP4 to S3 and reference it in a player (or the video tag directly, but that has additional issues). Our service is actually used for transcoding the video itself, not delivery. We actually created Video JS to help our customers (and the web at large) with easy, compatible HTML5 playback. If you have any other questions just ask. Thanks.




回答2:


The answer to the first part of your question is, yes, it is really that simple. There is a how-to about it and a working demo at the end of the article that you can see as a proof of concept.




回答3:


Amazon S3 is a really good choice for serving up video content. We've been using it for a couple of years with no issues and the cost has been unbeatable. You should also look at using Amazon CloudFront and configuring your media to use their "streaming distributions". It basically uses your S3 files but copies them to edge locations around the internet and uses RTMP to provide a better playback experience for users and to save you money on bandwidth.

http://aws.amazon.com/cloudfront/




回答4:


I just had the same question as you and was happy to see that uploading an mp4 file to S3, setting "public" permissions on it, and then using this simple HTML worked great without any additional tools. And CloudFront wasn't even necessary.

<video id="clip" controls preload=auto width=640 height=264 data-setup="{}">
    <source src="https://s3.amazonaws.com/xxxxbucketnamexxxxx/xxxxfilenamexxxx.mp4" type='video/mp4'/>        
</video>



回答5:


Amazon S3 in combination with Amazon CloudFront as scalable CDN is pretty streight forward and good to build great video solutions, even Netflix-like systems using adaptive bitrate (ABR) video in HTML5 using the Media Source Extentions with MPEG-DASH or HLS, like done by Netflix or Youtube.

Here you can find a pretty good tutorial on that: http://www.bitcodin.com/blog/2015/02/create-mpeg-dash-hls-content-for-amazon-s3-and-cloudfront/




回答6:


You can encode the video yourself using a free encoder like https://HandBrake.fr . Or your video editor (I use Camtasia) should have standard encoding options.

Regarding the video player, you have a few options...

1) Simplest option: Upload to S3, make the file public, insert entire URL into WordPress, and it will automatically become a video player. But the player will have very basic options (no speed controls, ability to customize player controls, etc), and the URL is public, which means it's open to leeching and hotlinking and piracy.

2) If you wish to secure the file itself, then upload to S3, make it private, make it accessible only to the root account, and then use a plugin like https://S3MediaVault.com which will create signed URL's in real-time when the page loads, and the link will expire shortly thereafter, based on how many seconds you want it to be active.

3) And then if you want to protect the page itself, you'll have to use some kind of paywall software. So if you're using WordPress, this would be a WordPress membership plugin, which will protect the page and make one log in first using a username/password before they can access the page. And then the page will load, and signed URL's will be generated for your Video, and they can watch it from that page, or download it (if you let them).

4) You can also create streaming videos which are a lot harder to download for most regular people, because it is no longer just a .mp4 file - it is a .m3u8 and a bunch of .ts files, which are hard for most people to figure out. And then make those too signed URL's, and the video becomes even more harder to download.

And if you encode your streaming video using Apple's HLS technology, and set it to adaptive bit rate, then the stream will download as fast as, or as slow as, the viewer's internet connection. This can be good and bad depending on the situation, but that's an option.



来源:https://stackoverflow.com/questions/3505612/amazon-s3-hosting-streaming-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!