【问题标题】:How to change the bit rate of audio while converting from midi file to mp3 using ffmpeg/fluidsynth如何在使用 ffmpeg/fluidsynth 从 midi 文件转换为 mp3 时更改音频的比特率
【发布时间】:2021-06-11 05:54:04
【问题描述】:

我正在尝试在 Windows 10 操作系统上使用流体合成器和 ffmpeg 将 midi 文件转换为 mp3。

fluidsynth -a alsa -T raw -F - "FluidR3Mono_GM.sf3" simple.mid |  ffmpeg -ab 192k -f s32le -i  simple.mp3

音频比特率规范:-ab 192k 或 -b:a 192k 产生错误:

You are applying an input option to an output file or viceversa.

上面的命令中是否有指定比特率的选项。

取自Convert midi to mp3

【问题讨论】:

    标签: ffmpeg mp3 midi bitrate fluidsynth


    【解决方案1】:

    选项放置对ffmpeg 很重要。您正在尝试将输出选项应用于输入。

    ffmpeg [input options] input [output options] output
    

    更正的命令:

    fluidsynth -T raw -F - sound_font_file.sf3 input.mid | ffmpeg -y -f s32le -i - -b:a 192k output.mp3
    

    有关使用ffmpeg 进行 MP3 编码的更多信息,请参阅FFmpeg Wiki: MP3

    【讨论】:

    • 该命令确实有效。音量很低。如何增加音量。
    • @Vinod 请参阅fluidsynth --help。请参阅-g/--gain 选项。
    【解决方案2】:

    使用胆小和ffmpeg

    sudo apt-get install timidity
    
    sudo apt-get install ffmpeg
    

    如果我有 Honorthyfather.mid 文件,你可以选择

    midi转mp3

    timidity honorthyfather.mid -Ow -o - | ffmpeg -i - -acodec libmp3lame -ab 320k honorthyfather.mp3
    

    要获得更高质量,请使用 WAV

    timidity honorthyfather.mid -Ow -o - | ffmpeg -i - -acodec pcm_s16le honorthyfather.wav
    

    对于质量相同但尺寸较小的 WAV,请使用 FLAC

    timidity honorthyfather.mid -Ow -o - | ffmpeg -i - -acodec flac honorthyfather.flac
    

    【讨论】:

    • 在 Windows 10 系统上工作。 Timdity 在我的 W10 中不起作用。
    猜你喜欢
    • 2017-08-14
    • 2017-05-08
    • 2011-03-16
    • 1970-01-01
    • 2016-10-12
    • 2014-02-14
    • 2018-04-15
    • 2022-01-06
    • 2017-03-28
    相关资源
    最近更新 更多