how to upload,play and store videos in a better way on my website
i am trying to making(just for knowledge purpose) a website similar to "you tube" and i am
using LAMP(linux+apache+php+mysql).
so please guide me on these topics(please keep in mind that the website is a high traffic
web site like you tube):
1.i am taking video uploads from user using a simple form like:
<form enctype="multipart/form-data" action="upload.php" method="POST">
.............
................
</form>
suggest me if their exists a better way.
2.i am storing videos in a folder on my server and saving the file name in mysql database.
suggest me if their exists a better way to store my uploads.
3.i want to show videos uploaded by user on my website using a flash video player,
so suggest me the name of a good flash media player(must be open source).
4.how can i serve videos in a better way if so many users viewing videos on my
website simultaneously?
5.should i use a flash med开发者_开发问答ia server for streaming?
-Thanks
Peeyush
Uploading Video:
You can use open source library swfupload which can handle multiple uploads seamlessly.
Storing Videos:
You can upload them to your server or you can directly upload them to S3 (tweaking the swfupload library) and in the DB you can store the location of the source video.
Encoding the Video:
For showing in the browser you need to either encode the video using H.263 (for flash video players) or to H.264 (for flash players and HTML5 video tags) to flv/mp4 formats. For this you can either use ffmpeg which will take a while to set up (compiling it with varios codecs) and the output quality won't be that good. (correct me if I am wrong) You can use third party encoding services. (nirvanix etc.) But this will be costly.
Showing video into the Browser:
If you are converting all the videos using H.264 then you can use either of them (flash or html5). For flash there are quite good open source video player. Flowplayer and JWPlayer are very popular.
Scalability:
Either buy lots of servers or use some Content Delivery Network like Akamai.
Flash Media Server?:
If you are using some CDN then they might have been offering this kind of service. But using FMS will again increase your cost. If you think that people might hotlink / copy / redistribute your content, then probably you can have a look at this.
Bottom line is that the upfront cost of setting up this type of service is going to be huge. (storing / encoding / serving). Storing cost will increase gradually as your content will grow. Encoding is quite costly, but thankfully its one time cost. Serving is going to be the costliest as video are likely to be big in size so you will end up paying a lot for bandwidth.
精彩评论