在Lampp服务器中从php运行ffmpeg时找不到GLIBCXX_3.4.9
我编写了一个php程序,该程序使用ffmpeg根据图像序列创建视频.
I've written a php program which creates a video from sequence of images using ffmpeg.
<?php
$res = shell_exec("ffmpeg -framerate 50 -i image/image%d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 2>&1");
echo "$res";
运行时,
说GLIBCXX_3.4.15
,GLIBCXX_3.4.9
,GLIBCXX_3.4.11
未找到.
ffmpeg:/opt/lampp/lib/libstdc++.so.6:版本"GLIBCXX_3.4.15"不是
ffmpeg: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not
找到了(/usr/lib/i386-linux-gnu/libjack.so.0要求)ffmpeg:
found (required by /usr/lib/i386-linux-gnu/libjack.so.0) ffmpeg:
/opt/lampp/lib/libstdc ++.so.6:未找到版本"GLIBCXX_3.4.9"
/opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
(/usr/lib/i386-linux-gnu/libzmq.so.3要求)ffmpeg:
(required by /usr/lib/i386-linux-gnu/libzmq.so.3) ffmpeg:
/opt/lampp/lib/libstdc ++.so.6:未找到版本"GLIBCXX_3.4.11"
/opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found
(/usr/lib/i386-linux-gnu/libopencv_core.so.2.4要求)ffmpeg:
(required by /usr/lib/i386-linux-gnu/libopencv_core.so.2.4) ffmpeg:
/opt/lampp/lib/libstdc ++.so.6:未找到版本"GLIBCXX_3.4.9"
/opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
(/usr/lib/i386-linux-gnu/libopencv_core.so.2.4所需)
(required by /usr/lib/i386-linux-gnu/libopencv_core.so.2.4)
但是从终端,ffmpeg -framerate 50 -i image/image%d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
命令可以正常工作. 为什么php无法在终端机上正常运行而找不到库?而我该怎么做才能解决php中的问题呢?预先感谢.
But from the terminal, ffmpeg -framerate 50 -i image/image%d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
command works fine. Why php can't find the libraries while from the terminal it works fine? and what should I do to fix the problem in php? Thanks in advance.
从PHP脚本执行ffmpeg命令时,我也遇到了类似的问题.我通过从终端执行以下命令找到了解决方案.我要在此处粘贴该命令,以便有人从中获得帮助.
I also got similar problem while executing the ffmpeg command from PHP script. I found the solution by executing the following command from the terminal. I am pasting that command here so somebody get help from this.
sudo mv /opt/lampp/lib/libstdc++.so.6 /opt/lampp/lib/libstdc++.so.6.orig
现在只需运行您的php脚本,希望它能工作.
Now just run your php script, hope that will work.