Skip to content

[Bug] Docker: FFmpeg lost amr encoder (libavcodec-extra) #7246

@WenqiOfficial

Description

@WenqiOfficial

What happened / 发生了什么

当使用Docker部署的AstrBot发送语音消息至微信客服平台时,由于容器内ffmpeg缺少amr相关编解码器导致音频转换失败。

安装 libavcodec-extra 包后问题解决。

Reproduce / 如何复现?

  1. 在任意平台部署Docker环境下的AstrBot。
  2. 启用TTS功能,并在任意使用amr音频格式的平台下执行发送语音操作。
  3. TTS服务商返回的音频由于缺少amr编码器无法完成转码。

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot: v4.22.1
Platform: Linux Docker
LLM: NVIDIA
TTS: OpenAI TTS
Message: 企业微信(企业客服)

OS

Linux

Logs / 报错日志

[2026-04-01 00:06:36.171] [Core] [ERRO] [v4.22.1] [respond.stage:255]: 发送消息链失败: chain = MessageChain(chain=[Record(type=<ComponentType.Record: 'Record'>, file='/AstrBot/data/temp/openai_tts_api_2532932f-4a63-48dd-a64d-2b4aa6a70aaa.wav', magic=False, url='/AstrBot/data/temp/openai_tts_api_2532932f-4a63-48dd-a64d-2b4aa6a70aaa.wav', cache=True, proxy=True, timeout=0, text='我在… 刚刚正在整理刚才的运算数据', path=None)], use_t2i_=None, type=None), error = ffmpeg conversion failed: ffmpeg version 7.1.3-0+deb13u1 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 14 (Debian 14.2.0-19)
configuration: --prefix=/usr --extra-version=0+deb13u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-libmfx --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
[wav @ 0x65005cc09240] Ignoring maximum wav data size, file may be invalid
[wav @ 0x65005cc09240] Estimating duration from bitrate, this may be inaccurate
[aist#0:0/pcm_s16le @ 0x65005cc4b6c0] Guessed Channel Layout: mono
Input #0, wav, from '/AstrBot/data/temp/openai_tts_api_2532932f-4a63-48dd-a64d-2b4aa6a70aaa.wav':
Duration: 00:00:06.75, bitrate: 352 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
[aost#0:0 @ 0x65005cc4bc80] Automatic encoder selection failed Default encoder for format amr (codec amr_nb) is probably disabled. Please choose an encoder manually.
[aost#0:0 @ 0x65005cc4bc80] Error selecting an encoder
Error opening output file /AstrBot/data/temp/media_audio_11f393e4796e4774ad5760ebbc39f25b.amr.
Error opening output files: Encoder not found

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions