gpt4 book ai didi

audio - 使用 ffmpeg [python soundfile] 从 opus 转换为 ogg 文件

转载 作者:行者123 更新时间:2023-12-04 23:01:23 24 4
gpt4 key购买 nike

我正在使用 python soundfile到我的一个项目中的音频文件。我有一个包含 opus 的数据集文件。
python soundfile无法直接读取 opus 文件,但可以读取 ogg 文件。 (https://github.com/bastibe/python-soundfile/issues/252)
如何使用 ffmpeg 将所有 opus 文件转换为 ogg 文件?
我尝试了以下命令,

 ffmpeg -i test_file_2.opus -c:a libvorbis -b:a 16k test_file_2.ogg

但我得到一个错误,
ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
configuration: --prefix=/opt/conda --cc=/opt/conda/conda-bld/ffmpeg_1597178665428/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-pic --enable-pthreads --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libmp3lame
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
[ogg @ 0x55bad6b9cbc0] 543 bytes of comment header remain
Input #0, ogg, from 'test_file_2.opus':
Duration: 00:00:14.10, start: 0.000000, bitrate: 34 kb/s
Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
Metadata:
album : Onder Moeders Vleugels
ENCODER_OPTIONS : --quiet
artist : Louisa May Alcott
title : 02 - Een vroolijk kerstfeest
encoder : opusenc from opus-tools 0.1.10;Lavf57.83.100
Unknown encoder 'libvorbis'

最佳答案

未知编码器“libvorbis”
您的 ffmpeg 没有 libvorbis 支持。它不见了--enable-libvorbisconfigure线。 libvorbis 是一个输出 Vorbis 音频格式的音频编码器。 Vorbis 是 OGG/OGA 容器中通常使用的音频格式。 libvorbis 是推荐的 Vorbis 音频编码器。
查找具有 --enable-libvorbis 的 ffmpeg 新版本/包或重新编译 ffmpeg 并包含它。
实验性 vorbis 编码器
FFmpeg 有一个名为 vorbis 的内置编码器,但它被认为是实验性的,无法与 libvorbis 相提并论。如果您关心质量,请改用 libvorbis。如果你想尝试 vorbis:

ffmpeg -i input.opus -c:a vorbis -strict experimental output.ogg
或通过管道连接到 oggenc
ffmpeg -i input.opus -f wav - | oggenc -o output.ogg -

关于audio - 使用 ffmpeg [python soundfile] 从 opus 转换为 ogg 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69342452/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com