Page 1 of 1

Exec and ffmpeg

Posted: Wed May 09, 2007 3:43 pm
by user___
Hi guys,
I have ffmpeg executable file in a folder on my document_root. When I try to execute it from other place different from the folder where it is installed it can not be found.

Do you know how to execute an executable file(In this case ffmpeg) from another directory?

Re: Exec and ffmpeg

Posted: Wed May 09, 2007 4:56 pm
by volka
user___ wrote:I have ffmpeg executable file in a folder on my document_root.
$_SERVER['DOCUMENT_ROOT'] contains the name of this directory. see http://www.php.net/manual/en/reserved.variables.php

Reply

Posted: Wed May 09, 2007 5:10 pm
by user___
Thank you, volka. I have read the info but I do not know how to start this ffmpeg from another directory.

Now the root looks like these:
C:/www/#The root
C:/www/movie_maker/executables/ffmpeg.exe#ffmpeg's location
C:/www/mySite/make_movie.php#Where I call it from.

Can you drop me a line with the exec() command in the above situation to see whether it will start working.

Posted: Wed May 09, 2007 5:29 pm
by volka
Just concatenate $_SERVER['DOCUMENT_ROOT'] and the "remaining path"ยง the get the absolute path to ffmpeg.

Re: Reply

Posted: Thu May 10, 2007 1:34 am
by dibyendrah
user___ wrote:Thank you, volka. I have read the info but I do not know how to start this ffmpeg from another directory.

Now the root looks like these:
C:/www/#The root
C:/www/movie_maker/executables/ffmpeg.exe#ffmpeg's location
C:/www/mySite/make_movie.php#Where I call it from.

Can you drop me a line with the exec() command in the above situation to see whether it will start working.
Follow the following statements:

Code: Select all

$path_to_ffmpeg = "movie_maker/executables/ffmpeg.exe"
$cmd = $_SERVER['DOCUMENT_ROOT']."/".$path_to_ffmpeg;
Now just execute the $cmd variable using exec() or system() or shell_exec() functions.