FFmpeg命令仅适用于root(centos 6.10)

问题描述 投票:0回答:1

我有专门的服务器。我在我的root上安装了FFmpeg。如果我以root身份登录但是如果我以用户身份登录,则没有命令正常工作,所有与FFmpeg相关的命令都有效。我也尝试过向sudoers添加一个用户。我还想在PHP shell_exec()或exec()中使用FFmpeg命令。有人可以告诉我解决方案。提前致谢。

用户命令:

$ ffmpeg

输出:

-bash: ffmpeg: command not found

root命令:

$ ffmpeg

产量

ffmpeg version N-93394-g14eea7c Copyright (c) 2000-2019 the FFmpeg 
developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-23)
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static -- 
extra-cflags=-I/root/ffmpeg_build/include -
-extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs=-lpthread --extra- 
libs=-lm --bindir=/root/bin --enable-gpl --enab
le-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus -- 
enable-libvpx --enable-libx264 --enable-libx
265 --enable-nonfree
libavutil      56. 26.100 / 56. 26.100
libavcodec     58. 47.103 / 58. 47.103
libavformat    58. 26.101 / 58. 26.101
libavdevice    58.  6.101 / 58.  6.101
libavfilter     7. 48.100 /  7. 48.100
libswscale      5.  4.100 /  5.  4.100
libswresample   3.  4.100 /  3.  4.100
libpostproc    55.  4.100 / 55.  4.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] 
outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
ffmpeg root centos6 shell-exec ffmpeg-php
1个回答
1
投票

确保用户的PATH包含ffmpeg二进制文件所在的目录(通常为/usr/local/bin/opt/local/bin)。

如果您找不到它,您可以询问系统当您使用以下命令以root用户身份登录时使用的是:

which ffmpeg

在您的情况下,根据您添加到问题的信息,看起来二进制文件位于/ root / bin中

如果/ root / bin不是世界可读的并且内容世界可执行,那么这本身可能是一个问题。

© www.soinside.com 2019 - 2024. All rights reserved.