Jump to content

How would I make a YouTube-like script?


Cory94bailly

Recommended Posts

Hey guys..

 

To start off.. No, I do not want a youtube 'clone', I want to make my own scripts and integrate them into my current site.

 

I want it so the user uploads any movie file type and have the server convert that into a flash format then I want to display that to the user..

 

I already know how to make it so only members can upload and that stuff...

 

Thanks for any opinions, help, etc.

Link to comment
https://forums.phpfreaks.com/topic/153571-how-would-i-make-a-youtube-like-script/
Share on other sites

Unless you got a dedicated server there's a good chance your host might

A) Not offer a way to convert videos.

B) Not be happy with you doing so, considering the resources it takes.

 

If A and B aren't a problem for you then indeed look into ffmpeg, or alternatively mplayer. (Using MPlayer myself to create thumbnails from videos)

A friend of mine has a dedicated server.. ;)

 

Is it possible to have a user upload a video, but send the uploaded file to a different server, then have the server encode it and everything, then have the server send to the main server?

 

Ok, I'll rephrase that..

 

Server A is my basic webhost, Server B is another dedicated server.

 

I want it so if someone goes to a page on server a and it switches the information (file) to server b, then server b changes it to a flash-based file, then server b sends the re-encoded file back to server a.

 

I would guess ftp? Curl?

You guessed it right, you could let curl send a post request with the file or like you mentioned use ftp.

Some quick googling with 'curl ftp php upload' etc gives good results.

 

I just tried a basic curl upload and it took VERY long and in the end, it didn't even send the file..

 

Any other ways?

Reverse the logic maybe.

 

Once the file is uploaded to your server notify the remote server it should start downloading the file, from your server.

Once it's done you can do the same thing the other way around, let the remote server tell your server to download the file.

 

I suggest (as you probably are already doing) first getting a file (start with something small like an image) from one server to the other. Once that works you can add the whole convert routine.

 

If you use the http protocol at least port problems shouldn't be an issue and downloading from one server to the other should be as fast as you would download in a browser.

Reverse the logic maybe.

 

Once the file is uploaded to your server notify the remote server it should start downloading the file, from your server.

Once it's done you can do the same thing the other way around, let the remote server tell your server to download the file.

 

I suggest (as you probably are already doing) first getting a file (start with something small like an image) from one server to the other. Once that works you can add the whole convert routine.

 

If you use the http protocol at least port problems shouldn't be an issue and downloading from one server to the other should be as fast as you would download in a browser.

 

That is actually a very good idea..

 

But on 'server b' (the dedicated server), it doesn't have curl..

 

Is there any other way to download files without curl? (fopen?)

i want this where can i find it please?

Mmmh could you start a new thread? I'll post my code in a reply.. can't remember if it was a single file or multiple.. so might just post a zip if it's more than one.

 

 

Back on topic:

Well if your friend is in control of the server then it shouldn't be too much trouble to install curl? I mean if you're in a position to install either mplayer or ffmpeg then curl seems like a small task.

(Using MPlayer myself to create thumbnails from videos)

 

i want this where can i find it please?

 

http://www.google.com/search?hl=en&q=mplayer&btnG=Search

http://www.mplayerhq.hu

 

Great searching! Wow.

 

 

 

i want this where can i find it please?

Mmmh could you start a new thread? I'll post my code in a reply.. can't remember if it was a single file or multiple.. so might just post a zip if it's more than one.

 

 

 

Back on topic:

Well if your friend is in control of the server then it shouldn't be too much trouble to install curl? I mean if you're in a position to install either mplayer or ffmpeg then curl seems like a small task.

 

That's true but I am just wondering if there are any other methods (faster possibly) and the owner is away right now so yeah :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.