linux系统安装ffmpeg,视频流截图,解决openssl not found

下载文件
wget http://www.ffmpeg.org/releases/ffmpeg-4.3.tar.gz
解压文件
tar -xvf ffmpeg-4.3.tar.gz
进入文件夹
cd ffmpeg-4.3
编译并开启https
./configure  --enable-openssl
如出现错误
ERROR: openssl not found
解决办法
进入到日志目录
 cd ffbuild
 cat config.log 
 #出现下面错误信息
 fatal error: openssl/ssl.h: No such file or directory
安装openssl
yum install -y openssl
yum install -y openssl-devel
#回到编译目录
cd ..
重新编译
./configure  --enable-openssl
安装
make && make install
测试
ffmpeg -y -i https://1.m3u8 -f image2 -ss 1 -vframes 1 /home/camerafile/1.jpg 
说明
1、ffmpeg 扩展,如果不存在需要手动加入环境变量
或者whereis ffmpeg 查找目录位置改成目录位置对应即可
2、https://1.m3u8 视频流地址
3、-ss 1 一秒钟后截取
4、/home/camerafile/1.jpg 截取图片保存的位置及文件名
遇到错误
ffmpeg: error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory
解决办法
vi /etc/ld.so.conf
#添加
/usr/local/lib
#重新加载
ldconfig
#查看版本
ffmpeg
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
  configuration: --enable-shared --enable-openssl
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100

你可能感兴趣的:(Linux,ffmpeg,ffmpeg)