如何使用ffmpeg将音频文件分为两个?

发布于 2025-01-31 02:06:34 字数 724 浏览 3 评论 0原文

ffmpeg 使用|来指定时间段以拆分文件。此命令返回错误?我在滥用吗?

命令:

ffmpeg -i input.wav -f segment=timestamps="60|150" -c copy output%03d.wav
>>> Requested output format 'segment=timestamps=60|150' is not a suitable output format
./tmp/test_split%03d.wav: Invalid argument
ffmpeg -i input.wav -f segment timestamps="60|150" -c copy output%03d.wav
>>> Output file #0 does not contain any stream

使用|的正确方法是什么?

The ffmpeg docs mentions that you can use the | to specify the timesteps to split the file. This command returns an error? Am I misusing it?

Command:

ffmpeg -i input.wav -f segment=timestamps="60|150" -c copy output%03d.wav
>>> Requested output format 'segment=timestamps=60|150' is not a suitable output format
./tmp/test_split%03d.wav: Invalid argument
ffmpeg -i input.wav -f segment timestamps="60|150" -c copy output%03d.wav
>>> Output file #0 does not contain any stream

What is the correct way to use the |?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴情 2025-02-07 02:06:34

根据 不使用使用|分隔符用于您要做的事情。我相信您正在寻找此选项:

segment_times times
指定拆分点列表。时代包含以增加顺序的逗号分隔持续时间规格的列表。另请参阅segment_time选项。

因此,您的命令应读取,

ffmpeg -i input.wav -f segment -segment_times 60,150 output%03d.wav

请注意,如果要准确拆分,则不建议使用-c复制

According to the docs, segment demuxer does not use | separator for what you want to do. I believe you are looking for this option:

segment_times times
Specify a list of split points. times contains a list of comma separated duration specifications, in increasing order. See also the segment_time option.

So, your command should read

ffmpeg -i input.wav -f segment -segment_times 60,150 output%03d.wav

Note that -c copy is not recommended if you want accurate split.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文