MPEG Audio Constant bit rate conversion

纵然是瞬间 提交于 2021-02-05 11:34:48

问题


I am trying to convert few .wav files to .mp3 format

The desired .mp3 format is :

I tried with FFmpeg with this code :

ffmpeg -i input.wav -vn -ac 2 -b:a 160k output1.mp3

This is the output of this command on one .wav format

I am getting the result but two things are different Overall bit rate mode and Writing library

  • Writing library: LAME3.99.5 vs LAME3.100 ( I think this shouldn't make any problem?)
  • bit rate mode Constant Vs variable

How to change bit rate mode from variable to Constant? and do I need to convert using the same Writing library?

Thanks!


回答1:


The output using ffmpeg -i input.wav -vn -ac 2 -b:a 160k output1.mp3 is constant bit rate, however ffmpeg writes a header with the title Xing and Mediainfo infers that to indicate VBR. Disable writing that header if you want Mediainfo to detect Constant bit rate.

ffmpeg -i input.wav -vn -ac 2 -b:a 160k -write_xing 0 output1.mp3

Note that the actual MP3 encoding won't change.




回答2:


I ended up using sox instead of FFmpeg :

sox -t wav -r 48000 -b 16 -c 2 file.wav -C 160 -t mp3 sock33.mp3
  • Sample rate of 48 kHz (-r 48000)
  • two channel (-c 2)
  • 16 bits bit depth (-b 16)


来源:https://stackoverflow.com/questions/63133963/mpeg-audio-constant-bit-rate-conversion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!