Hi,
i am working on ffmpeg as i done it on my local computer XP fine but it giving me error on winow server 2003 as exec is working fine because when i run this command
exec("whoami",$res,$res2);
print_r($res);
it return me : Array ( [0] => caronet-4agcutk\iwpd_4(relaxpkftp) )

but when i run this command:
exec("C:\ffmpeg\ffmpeg -i C:\videos\1.avi -r 23 -ab 32 -ar 22050 -b 50000 -f flv -s 320x240 C:\videos\1.flv",$res,$res2);

$res give me empty array and $res2 (Error Code) return me 1
if i run above command in cmd (dos) then it work fine.

I think thier is little bit security which i am missing to understand.
Can anybody guid me?

    You shouldn't need the double \ I am running the same thing for the most part on my server. and I don't use them. What I do is put the path to ffmpeg into my global PATH variable and just call ffmpeg like this

    exec("ffmpeg"); //add the rest of your cli
    

    Also, don't specify filesystem paths if you can avoid it. Use web paths like /path/to/video.avi

      Thanks rsmith,
      but problem is still remain one thing is here that this script working perfectly when i am using xxamp in XP but its not working window server 2003 with iis 6.

      Can you please explain me how you using global PATH variable?

        The global PATH variable is a variable in Windows that stores all the paths in which the OS looks for executables. If you open command prompt and type "path" without the quotes and hit enter, it will echo your current system path.

        Like you, I am using Windows XP with Xampp. If you are using Server 2003 you are going to run into permissions issuse with the IIS account. It has to be given rights to execut, etc. Check those. I would just uninstall IIS and run Xampp on there too.

          Thanks for you nice help problem is solved now
          i skip the path and past the video files in same folder where i am running script and it work fine i think there is problem in path asigning.
          I past every thing in one folder i know its not good practice but yet i need to done work so i do it.
          One thing more i guess the path which work fine in xp not work in win server 2003 so what path i need to use here?
          Again thank for your help.

            Write a Reply...