Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

-Thanks

Peeyush

like image 796
Peeyush Avatar asked Jul 15 '10 08:07

Peeyush


People also ask

Should you put videos on your website?

Videos keep people on your website longer and engage them with your content. People work with people, and video helps people get to know, like and trust you. Videos keep your audience interested, no matter your product or service. Videos are fast and convenient.

Can I embed YouTube videos on my website?

On a computer, go to the YouTube video or playlist you want to embed. From the list of Share options, click Embed. From the box that appears, copy the HTML code. Paste the code into your website HTML.


1 Answers

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.

like image 162
bhups Avatar answered Sep 29 '22 02:09

bhups