0

I am trying to execute ffmpeg on PHP using exec, shell_exec, command and proc_open and did not manage to get any to work.
This is my command:

exec("ffmeg -I test.fvl output.mp4 2>&1", $output, $retval); 

when I run this php command, the error happens when there's a duplicate output file and prompt a stderr asking if we want to overwrite it thus, waiting for a user input. Is there any way around this to ignore the stderr?

Zavfel
  • 39
  • 1
  • 8

3 Answers3

0

you can add the "-y" Parameter to overwrite the existing file.
Hope this helps.

Grtngs Dustin

0

Have you considered using proc_open ? Here's a sample code from another thread.

Edit: Knowing ffmeg, you can also add -y option in ffmpeg.

Gene M
  • 348
  • 2
  • 12
  • I did try proc_open to try to return a input to the prompt but it does not seem to be able to get the std_err value thus, unable to know when there is a duplicate from just the proc_open. However, it does work if I have known beforehand that it has a duplicate copy and write to stdin immediately. – Zavfel Dec 18 '17 at 09:06
  • If you don't mind overwriting the file, then you can add the -y option. – Gene M Dec 18 '17 at 09:08
0

There are few options, choose one that suits you the best:

ino
  • 2,345
  • 1
  • 15
  • 27