此步骤也可使用git clone下载源码包,本质上是同样的 java
cd /usr/local/ffmpeg tar xvJf ffmpeg-4.0.tar.xz
cd ffmpeg-4.0 ./configure --enable-shared --prefix=/usr/local/ffmpeg
报错:gcc is unable to create an executable file C compiler test failed.此错误解决办法查看node
gcc is unable to create an executable file. If gcc is a cross-compiler, use the --enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed. If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem. [csy@root@instance-m4tjyg0q ffmpeg-4.0]#
cd ffmpeg-4.0 ./configure --enable-shared --prefix=/usr/local/ffmpeg
回车以后,可能会等待一段时间,耐心等候linux
make
此过程有点久,会编译各个库文件git
/usr/local/ffmpeg/installlocation/bin/ffmpeg --version
web
此时又报错:ffmpeg -bash: ffmpeg: command not found
linux下ffmpeg -bash: ffmpeg: command not found解决办法apache
再次输入/usr/local/ffmpeg/installlocation/bin/ffmpeg --version
又报错vim
/usr/local/ffmpeg/installlocation/bin/ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory
tomcat
提示库文件找不到 修改文件/etc/ld.so.conf 内容增长/usr/local/ffmpeg/lib/ vim /etc/ld.so.conf
输入i才能插入编辑bash
最后文件内容是app
include ld.so.conf.d/*.conf /usr/local/ffmpeg/lib/
添加以后按esc再:wq保存退出。
再输入ldconfig使修改生效。
这样错误就解决了,再回答第八步输入 /usr/local/ffmpeg/installlocation/bin/ffmpeg --version
可见ffmpeg安装成功,接下来配置环境变量 path(不配置的haul只能每次cd /usr/local/ffmpeg/installlocation/bin/ 才能执行命令)
详细查看:[linux下ffmpeg -bash: ffmpeg: command not found及环境变量设置]()
cd到有gif文件的目录 cd /usr/local/java/apache-tomcat-8.5.24/webapps/it399/src/ffmpeg/temp/gif2video
输入命令 ffmpeg -f gif -i test.gif test.mp4
回车以后输入命令或者xftp客户端查看该目录下文件,可见已经成功将test.gif转成了test.mp4
转载请注明:本文转载自在线助手|在线工具博客,原文连接:http://www.it399.com/blog/ffmpeg/201807011600