ffmpeg4.4.2 gcc 15.2.0 编译错误

编译环境

  • msys2 mingw64
  • gcc 15.2.0
  • ffmpeg 4.4.2

问题描述

复制代码
libavcodec/aacps.c:54:13: note: in a call to function 'hybrid2_re'
   54 | static void hybrid2_re(INTFLOAT (*in)[2], INTFLOAT (*out)[32][2], const INTFLOAT filter[8], int len, int reverse)
      |             ^~~~~~~~~~
CC      libavcodec/ac3_parser.o
C:\msys64\tmp\cc0klAyf.s: Assembler messages:
C:\msys64\tmp\cc0klAyf.s:326: Error: operand type mismatch for `shr'
C:\msys64\tmp\cc0klAyf.s:358: Error: operand type mismatch for `shr'
C:\msys64\tmp\cc0klAyf.s:620: Error: operand type mismatch for `shr'
C:\msys64\tmp\cc0klAyf.s:716: Error: operand type mismatch for `shr'
C:\msys64\tmp\cc0klAyf.s:860: Error: operand type mismatch for `shr'
C:\msys64\tmp\cc0klAyf.s:917: Error: operand type mismatch for `shr'
CC      libavcodec/ac3tab.o
make: *** [ffbuild/common.mak:67: libavcodec/aacps_common.o] Error 1
make: *** Waiting for unfinished jobs....
C:\msys64\tmp\ccJghkQE.s: Assembler messages:
C:\msys64\tmp\ccJghkQE.s:3336: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:4412: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:4569: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:4674: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:5080: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:5165: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:5283: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:5356: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:5459: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:7660: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccJghkQE.s:7805: Error: operand type mismatch for `shr'
make: *** [ffbuild/common.mak:67: libavcodec/aacdec.o] Error 1
C:\msys64\tmp\ccygYwPo.s: Assembler messages:
C:\msys64\tmp\ccygYwPo.s:1171: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccygYwPo.s:1261: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccygYwPo.s:1391: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccygYwPo.s:1497: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccygYwPo.s:1670: Error: operand type mismatch for `shr'
C:\msys64\tmp\ccygYwPo.s:1751: Error: operand type mismatch for `shr'
make: *** [ffbuild/common.mak:67: libavcodec/aacsbr.o] Error 1

解决方案

  • 方案一:禁用asm,但可能会影响性能

    ./configure --disable-asm --disable-inline-asm

  • 方案二:回退GCC版本(之前使用GCC 12.2.0编译成功过),但在msys2回退gcc太麻烦,依赖项很多,很容易把环境搞乱

  • 方案三:修改源码,官方有该问题的补丁,修改libavcodec/x86/mathops.h文件
    参考链接
    针对该问题的官方提交

  • 方案四:下载修复该问题的新版本,如ffmpeg 4.4.5\4.4.6等
    ffmpeg release版本下载地址

相关推荐
2401_885885044 小时前
开发视频短信接口好开发吗?图文视频短信接口对接教程
android·音视频
CyL_Cly9 小时前
Bilidown下载 1.2.7 bilibili视频下载
音视频
非凡ghost9 小时前
AIMP(音乐播放软件)
前端·windows·音视频·firefox
sir565655610 小时前
即梦生成的视频无水印保存方法分享
音视频
小手智联老徐11 小时前
OpenClaw 2026.4.11 :记忆导入革命、视频生成升级与多平台体验优化
音视频·ai写作·openclaw
步达硬件12 小时前
【MATLAB】读取视频,提取视频每一帧特征值并存成EXCEL,并保存个别图像
matlab·excel·音视频
reasonsummer12 小时前
【教学类-160-05】20260412 AI视频培训-练习5“豆包AI视频《幼儿园之父:福禄贝尔(英声中字)》+豆包图片风格:伦勃朗(古典油画)竖版”
音视频·豆包·通义万相
m晴朗12 小时前
ffmpeg(2)-音频相关知识
ffmpeg·音视频
sp_fyf_202412 小时前
【大语言模型】 AVGen-Bench:一个用于文本到音频-视频生成的多粒度、任务驱动型评估基准
人工智能·深度学习·神经网络·机器学习·语言模型·数据挖掘·音视频
山栀shanzhi12 小时前
【FFmpeg实战】手撕音频转码:WAV转AAC的全链路解析与C++实现
ffmpeg·音视频·aac