0

I can successfully run an executable from the command line, but when I try to do the same thing from PHP with exec() the outcome is different.

The command is:

ffmpeg -i a.wav -i a.m2v a.mpeg

When running from PHP, the Movie Player simply states 'The file contains no playable streams'.

You know why?

6
  • what command are you running?
    – user1931
    Jan 7, 2010 at 12:16
  • the command is 'ffmpeg -i a.wav -i a.m2v a.mpeg'
    – user23945
    Jan 7, 2010 at 12:20
  • and what is the different output ffmpeg is giving you?
    – user1931
    Jan 7, 2010 at 12:21
  • from terminal the output file is a working video. When run from PHP though, the Movie Player simply states 'The file contains no playable streams'.
    – user23945
    Jan 7, 2010 at 12:22
  • But is the output generated? And does it have a non-zero file length?
    – Arjan
    Jan 7, 2010 at 13:25

1 Answer 1

0

I would check the environment variables. Maybe ffmpeg can't find (or can't access due to permission restritions) its resources when you run it from php.

4
  • Good point. The ffmpeg executable is found though and can use the files with right permissions, do you have any other names of the variables?
    – user23945
    Jan 7, 2010 at 13:12
  • I'm not very familiar with ffmpeg, maybe it could use some environment variables that point explicitly to the directories where it finds its codecs?
    – geek
    Jan 7, 2010 at 13:47
  • I'd also investigate if ffmpeg has a "-v" option that you could use to increase its verbosity when you run it from php. Then you could capture the output and investigate it, maybe it will complain there about something that it is missing.
    – geek
    Jan 7, 2010 at 13:48
  • Solved it! The -v option was indeed useful, i used ffmpeg -v 5 and got useful information. The problem was that ffmpeg terminated after a while, maybe phps' max_exection time, dont know. However, I now run nohup php myfile.php. Thank you!
    – user23945
    Jan 7, 2010 at 16:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .