Wav audio file compression not working

こ雲淡風輕ζ 提交于 2019-12-01 06:47:01

PCM ("WAV") is uncompressed, so -b:a/-ab is ignored.


Calculating PCM bitrate

Assuming a stereo input, 8000 samples per second, 16 bits per sample:

sample rate × number of channels × bits per sample = bitrate
8000 × 2 × 16 = 256000 bits/s, or 256 kb/s

Determine channels, sample rate, bit depth

You can just view the output of ffmpeg -i input.wav or use ffprobe for a more concise output:

$ ffprobe -loglevel error -select_streams a -show_entries stream=sample_rate,channels,bits_per_sample -of default=nw=1 input.wav 
sample_rate=8000
channels=2
bits_per_sample=16

Reducing bitrate

You can reduce the number of channels, change the sample rate, and/or change the bit depth, but another option is to use a lossless compressed format such as FLAC:

$ ffmpeg -i audio.wav audio.flac
$ ls -alh audio.wav audio.flac
  6.1M audio.flac
   11M audio.wac

I usually do this using Audacity

1) import the wav file to audacity

2) Then File>Export

3) Choose "Constant" and then from the Quality drop-down select your required bit-rate


I haven't tried that with ffmpeg, but the command should be:

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