PDA

View Full Version : Here is a tough one. . .



Jas
09-28-2007, 06:08 PM
1,000,000 bonus points to whoever can get this one:

I need a way to re-format an .avi/.wmv/.mpeg file to a flash movie file. And, I need it to be done over the internet when someone submits a video. I would prefer it to work with PHP if at all possible, but if you know of another way, let me know.

BTW You don't need to spend time writing the script. I am just interested in finding out how to do it. (But if you want to post a script, that would be great too!)

Thanks everyone!

djr33
09-28-2007, 10:32 PM
Very hard thing you've decided on there.

I have no idea where to start.

You could look through php.net's functions, such as the ming library (flash stuff), but I'm confident that would prove futile.

Your only real chance here is using an extension. Google... google lots, and good luck.

Converting to flv is hard enough with freeware/shareware you can download... wouldn't want to play with it from the command line.

If you can't find anything, then I guess the next step would be one of the following:
1. Write it yourself by using the documentation of the formats, most of which is closed source (...fun). This isn't PHP. It's probably Java or C++ or CGI, writing our own server program, then configuring it to run. (I guess you could use PHP, but it would likely be difficult to access the formats with it.)
2. Write some sort of super-macro for the server that will run shareware or freeware on your system and automatically convert the video. That seems fairly easy, compared to the other option, if you can find a way to write a program that will simulate user input (no clue there).

...3. Just give up on this (unfortunately), and upload, then create a queue which you can later access and convert manually.


As I've said before in several other threads, this is what the full time expert staff at youtube does. It's a complex difficult task.

insanemonkey
09-28-2007, 10:44 PM
im sorry. but I don't think there is a website that has this capabitility... if you had a flash program you could do this, but I dont think your going to find one anytime soon.... srryz

Jas
09-29-2007, 09:53 PM
Hmm. How do sites like YouTube do it? I'm guessing a Java program (or C++) on the server? (I think thats what you are talking about djr33?)

djr33
09-29-2007, 11:01 PM
It's a program on the server the converts it. It may be a macro or a standalone, both of the options I described above. I'd assume a standalone.
I really have no idea how it works, but you can imagine the steps involved, from reading the format to conversion to writing, etc.

Jas
10-07-2007, 07:21 PM
You changed your picture! -Had to say it.
I found a function called passthru() and one called system(), but I don't understand what they do. First, what to they do, and second, could these help if I used a converter that could go through the cmd? If so, then how might I go about it. If not, I heard-- through much google searching-- that you can do something similar with the php using a cmd capable converter. Any ideas? (I can try to find those sources again if they would help)

Thanks!

djr33
10-07-2007, 09:21 PM
They're all possibilities, but they all sound incredibly hard to me.
Using passthru() may work in itself, but you'd need to find what you're passing through, etc.
That is the right direction, probably, as I said with building some sort of macro on the server, but it's also going to be tough.
However, if you do figure it out, that's cool.

Jas
10-08-2007, 01:43 AM
Are you aware of any resources on the subject? I have googled, but strange enough, it's not a hot topic lol. :p Anyway, if you know of anything, let me know, and thanks for the help.

benslayton
10-08-2007, 01:47 AM
well this place actually does the oppisite. take a flv and make it an avi. they have release the source, but maybe they have somethin that does what u want: http://vixy.net/

djr33
10-08-2007, 07:10 AM
Very nice. That will be a great reference and might even help with some code.

twohawks
10-08-2007, 07:36 PM
I saw this here:
Internet and Network Art ffmpeg - upload and convert to .flv ... (http://72.14.253.104/search?q=cache:L0yLnAbLnDsJ:zappa.tvu.ac.uk/~02menzingerd/netart/%3Fp%3D158+php+%22convert+to+flash%22&hl=en&ct=clnk&cd=5&gl=us)
..the link was bad, but its cached at google.
Don't know if this relates or is useful?

Cheers,
TwoHawks