我已经成功安装了ffmpeg版本。4.4.7在centos上,启用了共享:
[root@localhost ~]# ffmpeg
ffmpeg version N-81555-g496d97f Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
configuration: --prefix=/usr/local/ffmpeg_build --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-shared
libavutil 55. 29.100 / 55. 29.100
libavcodec 57. 54.102 / 57. 54.102
libavformat 57. 48.102 / 57. 48.102
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 60.100 / 6. 60.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
然而,当我在php中运行时,通过exec,我得到
"/usr/local/bin/ffmpeg:加载共享库时出错:libavdevice.so。从共享对象映射段失败。没有权限"
我知道web服务器以'apache'用户而不是root用户的身份执行命令,但出于这个特定原因,我将ffmpeg安装在/usr/local/ffmpeg_build中,以便普通用户可以使用ffmpeg。
我错过了什么?这个错误意味着什么?
好的,我在这个链接上找到了答案http://www.idmworks.com/fix-failed-map-segment-shared-object-permission-denied/
原来是SElinux的强制模式,而不是允许模式,它开始工作,只要我把它设置为允许模式。
$ getenforce
Enforcing
$ sudo setenforce 0
$ getenforce
Permissive
使其永久
vi /etc/selinux/config
并将强制更改为permit
SELINUX=enforcing