-2

I'm trying to execute ffmpeg within a website and it never output's a file, nothing return's, I have tried it with parameters -version and that works fine. I can copy and paste the main command into dos and it also works fine.

I'm stuck, I have tried many things including shell_exec but to no avail, nothing comes back other than array(0) { } int(0). help?

 //$cmd = 'C:\ffmpeg.exe ffmpeg -version';
 $cmd = "C:\ffmpeg.exe -i C:\1.mp3 -i C:\2.mp3 -filter_complex amerge -c:a libmp3lame -q:a 4 C:\out.mp3";
 echo exec($cmd, $o, $v);
 var_dump($o);
 var_dump($v);
user3725395
  • 145
  • 2
  • 13
  • Probably a permission issue. Keep in mind that the http server (hopefully!) runs with different permissions than your normal user account. So have a try running that command manually as the user the http server is executed under. An: _take a look into the http servers error log file if php is executed under anhttp server._ – arkascha Aug 24 '15 at 15:27
  • How are you running this script? command line or through URL? If so you need allow certain permissions in php.ini (CLI or web) – Pradeep Aug 24 '15 at 15:54
  • using web. I have tried adding IUSR to the c:\ folder and the exe and still have the same problem. – user3725395 Aug 24 '15 at 15:59
  • also, I can do exec("dir > c:\zz.txt"); from php web and that works as in creates a new file ok. – user3725395 Aug 24 '15 at 15:59

1 Answers1

1

got it working, a couple of things.

  1. set IUSR permissions on ffmpeg.exe all input filename and output filename folders to full control.

  2. added double back slash to all filenames. e.g. C:\\out.mp3

now works.

user3725395
  • 145
  • 2
  • 13