首页 > 系统相关 >centos7 安装 ffmpeg踩坑后纪

centos7 安装 ffmpeg踩坑后纪

时间:2023-11-07 16:14:15浏览次数:41  
标签:后纪 enable ffmpeg -- make hls cd centos7 ls

从网上看了一篇在LINUX上安装FFMPEG作为流媒体服务器的文章后,不知深浅的照着教程来学,一个坑接一个坑。

1、我看的教程原文,写的非常好,;

https://www.jianshu.com/p/b1680d3ecd4f

2、修路填坑之旅(小白的电脑什么都没有装 );

  首先, 先要安装 gcc,再要安装x264,还要装 yasm 

  •  错误1,遇到 cannot load libcuba.so.1错误,加入
  •  错误2 : libx264.c 文件中, 头文件大小写引起的错误,要将x264_bit_depth 替换成 X264_BIT_DEPTH
  •  错误3: ffmpeg: error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or director

 

 附:乱七八遭的安装代码

   1  echo "source /opt/rh/devtoolset-11/enable" >>/etc/profile
    2  gcc --version
    3  reboot
    4  ls
    5  yum list installed | grep openssh-server
    6  yum list installed | grep openssh
    7  ls
    8  cd /
    9  ls 
   10  cd usr
   11  ls
   12  cd local
   13  wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
   14  yum install wget
   15  wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
   16  tar -xvf yasm-1.3.0.tar.gz 
   17  cd yasm-1.3.0
   18  ./configure && make && make install
   19  cat conifg.log
   20  yum install -y centos-release-scl centos-release-scl-rh
   21  vi /etc/yum.repos.d/CentOS-Base.repo
   22  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
   23  curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
   24  yum clean all 
   25  yum makecache
   26  yum list updates
   27  yum -y update
   28  gcc --version
   29  yum -y install centos-release-scl
   30  yum -y install devtools-11-gcc 
   31  yum -y install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils
   32  scl enable devtoolset-11 bash
   33  gcc --ver
   34  gcc --version
   35  ls 
   36  cd /usr/local
   37  ls
   38  cd yasm-1.3.0
   39  ls
   40  ./configure && make && make install
   41  cd ..
   42  ls
   43  wget http://wwww.ffmpeg.org/releases/ffmpeg-3.4.tar.gz
   44  wget http://www.ffmpeg.org/releases/ffmpeg-3.4.tar.gz
   45  tar -xvf ffmpeg-3.4.tar.gz 
   46  cd ffmpeg-3.4
   47  ./configure && make && make install
   48  ls
   49  ffmpeg -ver
   50  ffmpeg -version
   51  cd ..
   52  yum install nginx
   53  find / -name nginx
   54  rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
   55  cd /etc/yum.repos.d
   56  ls
   57  yum install -y nginx
   58  nginx
   59  systemctl stop firewalld
   60  systemctl status firewalld
   61  ngnix
   62  nginx
   63  systemctl enable nginx
   64  cd /usr/share/nginx
   65  cd html
   66  ls
   67  ffmpeg -version
   68  ffmpeg -i test.mp4 -hls_time 10 -hls_list_size 0 -hls_segment_filename ./hls/test_%05d.ts ./hls/test.m3u8
   69  find / -name libcuda.so.1
   70  find / -name libcuda.so
   71  find / -name libcuda
   72  cd /home
   73  cd /usr
   74  ls
   75  cd local
   76  git clone http://git.videolan.org/git/x264.git
   77  yum install git
   78  git clone http://git.videolan.org/git/x264.git
   79  ls
   80  cd x264
   81  ./configure --enable-shared --disable-asm
   82  make
   83  make install
   84  cd /
   85  cd /usr
   86  ls
   87  cd local
   88  ls
   89  cd ffmpeg-3.4
   90  ls
   91   ./configure --enable-shared --disable-yasm --enable-libx264  --enable-gpl  --prefix=/usr/local/
   92   ./configure --enable-shared --enable-x86asm / --disable-x86asm  --enable-libx264  --enable-gpl  --prefix=/usr/local/
   93   ./configure --enable-shared --enable-x86asm  --disable-x86asm  --enable-libx264  --enable-gpl  --prefix=/usr/local/
   94   ./configure --enable-sharedm  --disable-x86asm  --enable-libx264  --enable-gpl  --prefix=/usr/local/
   95   ./configure --enable-shared   --disable-x86asm  --enable-libx264  --enable-gpl  --prefix=/usr/local/
   96  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
   97  echo $PKG_CONFIG_PATH
   98  ./configure --disable-yasm --enable-libx264 --enable-swscale --enable-avresample --enable-gpl --enable-sharedsudo make && make install
   99   ./configure --disable-yasm --enable-libx264 --enable-swscale --enable-avresample --enable-gpl --enable-shared
  100   ./configure --enable-shared   --disable-x86asm  --enable-libx264  --enable-gpl  --prefix=/usr/local/
  101  make && make install 
  102  find / libx264.c
  103  find / -name libx264.c
  104  cd libvcodec
  105  cd libavcodec
  106  vi x264_config.h
  107  find / -name x264_config.h
  108  cd ..
  109  find / -name x264_config.h
  110  vi x264_config.h
  111  cat /usr/local/include/x264_config.h
  112  cd libavcodec
  113  cat libx264.c
  114  vi libx264.c
  115  cd ..
  116  make && make install
  117  make clean
  118  make
  119  make install
  120  cd /usr/share/nginx/html
  121  ls
  122  ffmpeg -i test.mp4 -hls_time 10 -hls_list_size 0 -hls_segment_filename ./hls/test_%05d.ts ./hls/test.m3u8
  123  find / -name libcuda.so.*
  124  find / -name libcuda.so
  125  cd /home
  126  ls
  127  cd /home
  128  cd /
  129  cd usr
  130  ls
  131  cd local
  132  cd x264
  133  ls
  134  ./configure --enable-shared --disable-asm
  135  make 
  136  make install
  137  install -d /usr/local/bin
  138  install x264 /usr/local/bin
  139  make install
  140  find / -name pkgconfig
  141  echo $ PKG_CONIG_PATH
  142  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
  143  echo $ PKG_CONIG_PATH
  144  cd ..
  145  ls
  146  cd ffmpeg-3.4
  147  ls
  148  ./configure --disable-yasm --enable-libx264 --enable-swscale --enable-avresample --enable-gpl --enable-shared
  149  make 
  150  make install
  151  cd /usr/local/share/nginx/html
  152  ls
  153  cd /
  154  cd usr
  155  cd local
  156  cd nginx
  157  ls
  158  cd ..
  159  ls
  160  cd share
  161  ls
  162  cd nginx
  163  ls
  164  cd html
  165  ffmpeg -i test.mp4 -hls_time 10 -hls_list_size 0 -hls_segment_filename ./hls/test_%05d.ts ./hls/test.m3u8
  166  cd ..
  167  cd loacl
  168  ls
  169  cd local
  170  ls
  171  echo "/usr/local/lib" >> /etc/ld.so.conf
  172  ldconfig
  173  ls
  174  cd .,
  175  ls
  176  cd ..
  177  ls
  178  cd share
  179  cd nginx
  180  cd html
  181  ffmpeg -i test.mp4 -hls_time 10 -hls_list_size 0 -hls_segment_filename ./hls/test_%05d.ts ./hls/test.m3u8
  182  mkdir hls
  183  ffmpeg -i test.mp4 -hls_time 10 -hls_list_size 0 -hls_segment_filename ./hls/test_%05d.ts ./hls/test.m3u8
  184  ls
  185  cd hls
  186  ls
  187  history
View Code

 

标签:后纪,enable,ffmpeg,--,make,hls,cd,centos7,ls
From: https://www.cnblogs.com/lrzy/p/17815222.html

相关文章

  • centos7安装docker compose
    1、安装docker-compose前需要先安装docker2、下载地址:https://github.com/docker/compose/releases/tag/v2.23.03、下载对应的版本,我下载的docker-compose-linux-x86_644、放到对应的目录,我看网上有几个都是放到/usr/local/bin中,虽然不明白为什么要放到这里,反正就随大流了5、......
  • Centos7 安装 Mysql5.7
    一、下载mysql5.7的安装包下载地址:https://dev.mysql.com/downloads/mysql/5.7.html①、选择linux版的②、选择64bit,根据自己的情况来看③、选择下载tar包④、点击下载⑤、等待下载完二、上传到服务器上传到服务器有好几种方法,任意采用一种就可以......
  • 记一次centos7安装python的mysql-client
    Exception:Cannotfindvalidpkg-configname.SpecifyMYSQLCLIENT_CFLAGSandMYSQLCLIENT_LDFLAGSenvvarsmanually起初安装发现缺少pkg-config和 MYSQLCLIENT_LDFLAGS环境变量,安装和手动声明环境变量后又报新的错MYSQL_OPT_SSL_ENFORCE......
  • centos7.9 安装 openGauss 5.0.0
    openGauss下载地址:https://opengauss.org/zh/download(选择企业版下载) 1.1首先检查THP的启用状态,如果两个输出都是madvisenever则忽略1.2,否则需要进行1.2设置#>cat/sys/kernel/mm/transparent_hugepage/defrag[always]madvisenever#>cat/sys/kernel/mm/tr......
  • centos7 中 安装 rmblast 软件
     静态二进制(免安装) 001、系统(base)[root@pc1software]#cat/etc/redhat-releaseCentOSLinuxrelease7.6.1810(Core)##centos7.6 002、下载安装包(最新版是2.14.1,但是centos7.6不能使用该版本,因为GLIBC库版本过低等因素;经过测试,只能调用2.14.0版本)......
  • Centos7 报No suitable device found for this connection错误,无法启动网卡
    #先备份网卡配置文件[root@xiaojing~]#cd/etc/sysconfig/network-scripts/[root@xiaojingnetwork-scripts]#cpifcfg-ens33ifcfg-ens33.bak#生成新的UUID,并追加到网卡配置文件中。[root@xiaojing~]#uuidgenens3346ff4fc9-9fa1-4010-856f-48d06388e2c5[root@xiaoj......
  • CentOS7.X 部署 Docker
    Docker安装包下载地址:https://download.docker.com/linux/static/stable/x86_64/第一步:将docker安装包上传到服务器上。 解压安装包tar-xzvfdocker-19.03.9.tgz在该命令中,"x"表示解开tar包,"z"表示解压tar包,"v"表示显示详细信息,"f"表示指定文件名。 启动docker......
  • centos7防火墙配置详细
     一、条件防火墙是开启的[root@ac~]#systemctlstatusfirewalld●firewalld.service-firewalld-dynamicfirewalldaemonLoaded:loaded(/usr/lib/systemd/system/firewalld.service;disabled;vendorpreset:enabled)Active:active(running)sinceSun......
  • Centos7安装Docker
    在CentOS7上安装Docker需要以下步骤:更新系统:使用以下命令更新CentOS系统,确保已经安装了最新的软件包和依赖项。sudoyumupdate安装Docker依赖项:Docker运行需要一些依赖项,使用以下命令安装这些依赖项。sudoyuminstall-yyum-utilsdevice-mapper-persistent-da......
  • Centos7安装openJdk17
    yum安装安装EPEL软件源:使用以下命令安装EPEL软件源,它包含了OpenJDK17的安装包。sudoyuminstallepel-releasesudoyuminstalljava-17-openjdk-develjava--version手动下载压缩包安装解压安装包tar-xvfjdk-17_linux-x64_bin.tar.gz移动解压后的文件夹到/u......