views:

63

answers:

2

hello

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 media server for streaming?

-Thanks

Peeyush

+3  A: 

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.

bhups
A: 

Have you looked at the open source social photo web gallery http://www.phtagr.org?

phTagr handles video files as well. It generates flash videos with ffmpeg on demand and play back is realized via flowplayer. So you could build your own youtube with phtagr.

phtagr is web gallery to organize, enrich and share your photos and videos with your community. Photos or videos can be tagged with keywords, categories, location and geo location. Users can write comments and are notified via email on updates. Also user registration with an initial upload quota is supported. Be updated via RSS, MediaRSS or RSS of recent comments.

phTagr requires PHP5, MySQL, and ImageMagick or GD. For video converting you need ffmpeg. Have a look at the project page.

Xemle

xemle