Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ffmpeg不能与PHP exec()一起使用_Php_Video_Ffmpeg - Fatal编程技术网

ffmpeg不能与PHP exec()一起使用

ffmpeg不能与PHP exec()一起使用,php,video,ffmpeg,Php,Video,Ffmpeg,我需要转换视频和创建图像使用ffmpeg。我从zeranoe for windows 8 64x下载并放入c:/ffmpeg文件夹 我使用cmd:ffmpeg-version ffmpeg version N-60959-g669043d built on Feb 27 2014 22:07:15 with gcc 4.8.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avi

我需要转换视频和创建图像使用ffmpeg。我从zeranoe for windows 8 64x下载并放入
c:/ffmpeg
文件夹

我使用cmd:
ffmpeg-version

ffmpeg version N-60959-g669043d
built on Feb 27 2014 22:07:15 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avis
ynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable
-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enabl
e-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-lib
opus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspee
x --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aace
nc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpac
k --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-z
lib
libavutil      52. 66.100 / 52. 66.100
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter     4.  2.100 /  4.  2.100
libswscale      2.  5.101 /  2.  5.101
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100
现在我使用php测试转换视频:

$raw_video_path = 'C:\xampp\htdocs\video\ff\examples\5.flv';
$new_flv = DIRNAME(DIRNAME(__FILE__)).'/ff/examples/video/2654.flv';
$new_png = DIRNAME(DIRNAME(__FILE__)).'/ff/examples/video/2647-resampled.jpg';

@exec("ffmpeg -i ".$raw_video_path."  -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv ".$new_flv."");
@exec("ffmpeg  -itsoffset -4  -i ".$new_flv." -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 ".$new_png." ");
现在,这对我不起作用!!我怎样才能解决这个问题


对于ffmpeg,我需要安装/active php ffmpeg extension?

尝试将exec行转换为$variable=shell_exec(“此处的ffmpeg命令”),回显它并请写下您看到的内容。看起来您混合了不同的路径格式,源为windows路径格式,目标为*nix路径格式。可能会让事情变得混乱。