I am trying to get info from a file with ffmpeg, if inside php I have this code:

exec("ffmpeg -i ffmpeg_directory/4.flv");

Returns nothing, even tough same command inside SSH would print a large list of file info (fps, duration, etc).

But this command converts the file properly, so I am thinking it is no permission problem:

exec("ffmpeg -i ffmpeg_directory/4.flv ffmpeg_directory/4.avi");

It is the same for system() function too. Any idea why that -i command would not return anything?

closed as off topic by freiheit, sysadmin1138 Jan 18 '12 at 0:23

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

locked by HopelessN00b Jan 21 '15 at 22:20

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. See the help center for guidance on writing a good question.

Read more about locked posts here.


If you run ffmpeg -i ffmpeg_directory/4.flv 2> /dev/null from the command line and get output, I don't know the answer. If it becomes blank, then I would say that when you specify an input file, but no output file, it is printing the output to standard error.

  • Yes, I think it WAS related to the output being an ERROR, I was able to do it by: system("ffmpeg -i ffmpeg_directory/4.flv 2>&1"); – adrianTNT Jan 18 '12 at 0:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.