提高比特率 有损 无损 Video-and-Audio-file-format-conversion 视频声音转码
阅读原文时间:2023年07月16日阅读:1

3 Ways to Change Bitrate on MP3 Files https://www.online-tech-tips.com/software-reviews/change-bitrate-on-mp3-files-tutorial/

3 Ways to Change Bitrate on MP3 Files

Want to change the bitrate on your MP3 files? This can be useful if you need to reduce the size of your MP3 files, for example. A MP3 file at 320 kbps, the highest bitrate allowed for MP3 files, could be reduced to 192 kbps in order to significantly reduce the size of the MP3 file.

There would be a loss of quality, but the difference would be negligible to most listeners using standard speakers or headphones. If you’re an audiophile, then in addition to having expensive audio equipment, you’re probably never going to use the MP3 format anyway.

Most likely you’ll be using a compressed or uncompressed lossless format like PCM Audio, WAV, AIFF, FLAC, ALAC, or APE. An uncompressed PCM audio file is about 10 times bigger than a CD quality MP3 file.

The MP3 format is a lossy format, which means audio quality is sacrificed in order to keep the relatively small size of the files. Pretty much every site will tell you that you should never convert a lossless format audio file to MP3 format unless you are OK with losing some audio quality.

This is true almost all of the time. The only time it might make sense is if you have a lower bitrate audio file in a high quality format like WAV. For example, it might make sense to convert a 96 kbps WAV file to MP3, but only if you choose a bitrate of 192 kbps or higher. The higher bitrate on the MP3 file will allow it to maintain the same quality as the WAV file, even though it is a lower bitrate.

The second thing you’ll read is that you should never convert a lower bitrate stream to a higher bitrate stream and hope that it sounds better. You cannot gain quality by increasing the bitrate. This is exactly correct. You will actually reduce the quality of your MP3 file if you try to convert up the bitrate.

If you want a higher bitrate MP3 than you currently have, you need to go back to the source (CD, etc) and extract that audio at full quality. Then you can convert that file into a higher bitrate MP3 file.

The last thing you should know is that it is not advisable to convert between lossy formats as you will continue to loss quality. It is OK, however, to convert between lossless formats as the quality is retained.

So now that you understand a few of the basics of the best ways to convert audio files to different bitrates, let’s talk about the programs that can help us. Note that I checked all of these programs on VirusTotal to make sure they are 100% clean.

ffmpeg:编解码过程,基本用法 - zxqstrong - 博客园 https://www.cnblogs.com/zxqstrong/p/4555517.html

# ffmpeg -i film.avi -b 1.5M film.mp4
#You can encode to several formats at the same time and define a mapping from input stream to output streams:
#ffmpeg Documentation http://ffmpeg.org/ffmpeg.html#Video-and-Audio-file-format-conversion
'''
You can encode to several formats at the same time and define a mapping from input stream to output streams:
ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. ’-map file:index’ specifies which input stream is used for each output stream, in the order of the definition of output streams.
'''
bm_mp3='192kbps.mp3'
bm_mp3_320 = bm_mp3.replace('.mp3', '_320kbps34.mp3')
d = '{} -i {} -map 0:a -b:a 320K {}'.format(ffmpeg_f_dir, bm_mp3, bm_mp3_320)
os.system(d)
print(d)

C:\Users\sas\AppData\Roaming\Python\Python36\site-packages\requests\__init__.py:80: RequestsDependencyWarning: urllib3 (1.16) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
ffmpeg version N-90553-gbe502ec6cd Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 12.100 / 56. 12.100
libavcodec 58. 16.100 / 58. 16.100
libavformat 58. 10.100 / 58. 10.100
libavdevice 58. 2.100 / 58. 2.100
libavfilter 7. 13.100 / 7. 13.100
libswscale 5. 0.102 / 5. 0.102
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, mp3, from '192kbps.mp3':
Metadata:
title : 夜的钢琴曲(五)
artist : 非笔墨
album_artist : 非笔墨
TYER : NaN
track : 1
disc : 1/2
lyrics-eng : 1801835885
Duration: 00:02:10.85, start: 0.025056, bitrate: 233 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s
Metadata:
encoder : LAME3.99r
Side data:
replaygain: track gain - -4.500000, track peak - unknown, album gain - unknown, album peak - unknown,
Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 72:72 DAR 16:9], 90k tbr, 90k tbn, 90k tbc
Metadata:
comment : Cover (front)
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to '192kbps_320kbps34.mp3':
Metadata:
TIT2 : 夜的钢琴曲(五)
TPE1 : 非笔墨
TPE2 : 非笔墨
TYER : NaN
TRCK : 1
TPOS : 1/2
lyrics-eng : 1801835885
TSSE : Lavf58.10.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p, 320 kb/s
Metadata:
encoder : Lavc58.16.100 libmp3lame
Side data:
replaygain: track gain - -4.500000, track peak - unknown, album gain - unknown, album peak - unknown,
size= 5112kB time=00:02:10.82 bitrate= 320.1kbits/s speed=16.4x
video:0kB audio:5111kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.023845%
ffmpeg-20180331-be502ec-win64-static_ffmpeg.exe -i 192kbps.mp3 -map 0:a -b:a 320K 192kbps_320kbps34.mp3

Process finished with exit code 232