View Full Version : Get External Program's Output (in windows, but need to be linux friendly too)


forthex
03-26-2007, 07:36 AM
I'm making a website where people input a link from Imeem.com for a song or movie they want, and my website will dl and convert the song/video (in flv format) to mp3/DIVX avi using php and ffmpeg (a really good command line conversion software).

The various songs (and videos for that matter) that people upload on Imeem.com are in different bitrates (128 to 320 Kbp/s I believe) and Imeem.com doesn't convert them to a standard bitrate, so all of the songs can be of different quality. So if i find the song is 128 kbp/s, i'll give the user that, but if the song they want is of higher bitrate, they'll get a song of that quality.

I need all of the raw in-command-line output from ffmpeg because it can give key facts about the flv file (like video/audio bitrate, sample rate, frame rate, etc) so i can better process the song / movie.

I can't figure out for the life of me the proper syntax because php has such redundant and useless syntaxes sometimes (it's known for that, right?).


To recap, I want to:

- run ffmpeg with with no output file given, so it will output in the command line (I'm running windows, but want linux to be compatible too) the .flv's specs.
- save the output into a variable (I'll know how to filter out the garbage and get the info I want, don't worry about that).


Thanks!!!

iGeek
03-28-2007, 05:38 AM
You want to do WHAT?

Sorry. :D

I really don't know if this is possible. I've never heard of ffmpeg. I can probably help with the PHP part. I seriously doubt you can pull this off.

ponygrl2
03-28-2007, 05:36 PM
I agree i don't think it is possible unless Imeen was it? has every song/video stored in some sort of database such as MySQL PostgreSQL Oracle etc. then you could probably do it

bejayel
03-28-2007, 07:38 PM
I dont really know what you want to do, but you can do it with this command:

http://ca.php.net/manual/en/function.popen.php

I also have no idea how to use it. You could also use exec() (dont knwo if it works in windows, and i am pretty sure it doesnt fork). Or you could try system() (dont knwo if it works in windows, but i think this one actually forks)

Also, ffmpeg output may be different between operating systems, you should check up on that before coding specifically for windows, or linux.

iGeek
03-28-2007, 08:01 PM
And to store all those videos you'd need one huge database, which means a huge server, which means dedicated hosting, which means a $400.00US bill every month.