ffmpeg错误Invalid audio stream. Exactly one MP3 audio stream is required. Could not write header for output file #0 (incorrect codec parameters
错误消息
Invalid audio stream. Exactly one MP3 audio stream is required.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Only AAC streams can be muxed by the ADTS muxer
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Unable to find a suitable output format for 'bandicam 2024-09-02 15-04-11-031.mp4.aac1'
bandicam 2024-09-02 15-04-11-031.mp4.aac1: Invalid argument
一、说明
环境:
Windows 11 家庭版 23H2 22631.3737 Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
二、报错
2.1 报错内容
Invalid audio stream. Exactly one MP3 audio stream is required. Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 --
2.2 原因
输出文件名后缀和指定的 -acodec copy 不匹配,
2.3 解决方法
输出文件后缀要和-acodec 的参数知道要一样,如不对会提示 Invalid argument
例: 输入文件,-i test.mp4 -acodec copy 输出文件后缀 xxx.mp4 (和输入文件后缀一样是可以的,但不能是未知后缀。比如 aac1、aac2) -acodec mp3 输出文件后缀 xxx.mp3 -acodec aac 输出文件后缀 xxx.aac
还可以不使用 -acodec 参数,ffmpeg 会自动根据输出文件后缀判断编码
三、
3.1
文件名:
3.2
文件名:
四、
4.1
文件名:
4.2
文件名:
免责声明:本号所涉及内容仅供安全研究与教学使用,如出现其他风险,后果自负。
参考、来源:
https://blog.csdn.net/sinat_33588424/article/details/79989795 (根据后缀判断)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)