1

我正在尝试使用以下代码在我的本地主机服务器上生成一些帧(目前):

$cmd = 'avconv -i "../videos/medium.mp4" -vsync 1 -r 10 -f image2 -an -y -qscale 20 -s 120*90 -ss 00:00:05 -t 00:00:10 "out_%05d.jpg" 2>&1';

passthru($cmd, $out);

我收到以下消息:

[image2 @ 0x646120]Could not open file : out_00001.jpg av_interleaved_write_frame(): Input/output error failed1

问题是如果我在终端中运行这个命令,它就可以工作。有谁知道是什么问题?是因为许可还是其他原因?

4

1 回答 1

0

在执行之前$cmd,您需要先更改目录,然后才能执行命令。

chdir('path_to_your_location/videos/');
$cmd = 'avconv -i "../videos/medium.mp4" -vsync 1 -r 10 -f image2 -an -y -qscale 20 -s 120*90 -ss 00:00:05 -t 00:00:10 "out_%05d.jpg" 2>&1';

passthru($cmd, $out);
于 2014-03-10T14:08:07.583 回答