You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何为含Vorbis音频的OGG文件添加章节?FFmpeg报错求助

Fixing "Unsupported codec id in stream 0" When Adding Chapters to OGG/Vorbis Files with FFmpeg

Let’s break down what’s going wrong here and get your chapters added properly.

The Root Problem

Your original command uses -i metadata_OGG.txt, which tells FFmpeg to treat your text metadata file as a media input stream instead of a metadata source. FFmpeg tries to parse the text file like an audio/video file, which obviously fails—hence the "Unsupported codec id" error.

The Corrected Command

Instead of using -i for your metadata file, use the -metadata_file parameter to load the chapter data correctly. Here’s the fixed command:

ffmpeg -threads auto -y -i in.ogg -metadata_file metadata_OGG.txt -codec copy out_METADATA.ogg

Double-Check Your Metadata Format

Great news—your metadata_OGG.txt structure is already valid for FFmpeg’s chapter handling. Just make sure each key-value pair is on its own line (this helps FFmpeg parse them reliably):

CHAPTER00=00:00:00.000
CHAPTER00NAME=Chapter 01
CHAPTER01=00:00:05.000
CHAPTER01NAME=Chapter 02
CHAPTER02=00:00:10.000
CHAPTER02NAME=Chapter 03

Quick Additional Tips

  • Update FFmpeg: If you still hit snags, ensure you’re using a recent version of FFmpeg. Older builds had inconsistent support for OGG chapter metadata.
  • Test Playback: Most modern players (like VLC) will recognize these chapters, but some lightweight OGG players might not—this is a player limitation, not an issue with your file.

内容的提问来源于stack exchange,提问作者MayurK

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:15:02