1

我已经在我的 Windows 2008 服务器上安装了 ffmpeg。

我在 CMD 中使用这个字符串,我得到了我想要的

PHP 文件:

 ffprobe -v quiet -print_format json -show_format -show_streams "C:\wamp\www\uploads\fc30e528b500b26a391ed4f5ed484310.mp4" 

这是我在另一个 stackoverflow 问题上找到的 PHP 函数,它有很好的反馈,所以我对其进行了测试。

$file_name = 'fc30e528b500b26a391ed4f5ed484310';
$file_ext = 'mp4';
$ffprobe = 'C:\\ffmpeg\\bin\\ffprobe.exe';
$videoFile = 'C:\\wamp\\www\\uploads\\'.$file_name.'.'.$file_ext;

$cmd = shell_exec($ffprobe .' ffprobe -v quiet -print_format json -show_format -show_streams "'.$videoFile.'"');
$parsed = json_decode($cmd, true);
print_r($parsed);

回来什么都不是。我还尝试使用与 ffmpeg 相同的功能(我为 ffmpeg 工作)。

$cmd = $ffprobe.' ffprobe -v quiet -print_format json -show_format -show_streams "'.$videoFile.'" 2>&1';
echo shell_exec($cmd);

这也没有带来任何回报。

有任何想法吗?

4

1 回答 1

1

包含 .exe 后删除了 ffprobe 修复了问题:

$file_name = 'fc30e528b500b26a391ed4f5ed484310';
$file_ext = 'mp4';
$ffprobe = 'C:\\ffmpeg\\bin\\ffprobe.exe';
$videoFile = 'C:\\wamp\\www\\uploads\\'.$file_name.'.'.$file_ext;
$cmd = shell_exec($ffprobe .' -v quiet -print_format json -show_format -show_streams "'.$videoFile.'"');
$parsed = json_decode($cmd, true);
print_r($parsed);
于 2014-04-05T11:40:20.220 回答