ffmpeg测试本地文件推流报错 Could not find a valid device can‘t configure encoder解决办法

在尝试使用`./configure --enable-shared`编译FFmpeg并集成x264时遇到错误'Found no assembler'。解决这个问题需要安装nasm汇编器。首先下载nasm,解压并安装,然后重新配置和编译x264,最后再重新编译FFmpeg。完成这些步骤后,应该能够成功集成x264并解决编译问题。
摘要由CSDN通过智能技术生成

[root@VM-16-6-centos ~]# ffmpeg -re -i "/root/ZLMediaKit/release/linux/Debug/www/record/rtp/0BEBE85B/2021-11-10/21-33-37.mp4" -vcodec h264 -acodec aac -f flv rtmp://127.0.0.1/live/test
ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: 
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/root/ZLMediaKit/release/linux/Debug/www/record/rtp/0BEBE85B/2021-11-10/21-33-37.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2021-11-10T13:33:37.000000Z
  Duration: 00:20:32.12, start: 0.000000, bitrate: 691 kb/s
    Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080, 690 kb/s, 25.02 fps, 25 tbr, 1k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2021-11-10T13:33:37.000000Z
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_v4l2m2m))
Press [q] to stop, [?] for help
[h264_v4l2m2m @ 0x2f2c640] Could not find a valid device
[h264_v4l2m2m @ 0x2f2c640] can't configure encoder
#下载x264源码编译生成libx264.so库,重新编译FFmpeg并将x264添加进去
[root@VM-16-6-centos ~]# git clone https://code.videolan.org/videolan/x264.git

cd x264			//进入x264源码文件目录下
./configure --enable-shared
make
sudo make install
sudo cp /usr/local/lib/libx264.so.164 /lib	     	//生成文件的默认路径为:/usr/local/lib

cd ffmpeg    	//进入ffmpeg源码文件目录下
./configure --enable-shared --disable-yasm --enable-libx264  --enable-gpl  --prefix=/home/jiajia/ffmpeg-x64
make
make install
 

./configure --enable-shared编译想264报错Found no assembler

Minimum version is nasm-2.13 处理方式如下

 Linux下编译x264 If you really want to compile without asm, configure with --disable-asm 的解决办法

下载 nasm

https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/

解压

tar -zxvf nasm-2.13.03.tar.gz

进入目录

cd nasm-2.13.03

安装即可

./configure

make

make install

安装nasm之后再进入x264目录 

./configure 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值