![]() Video:0kB audio:46125kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000457% ![]() We can see that this audio file is a mp3 (this is not obvious, despite of the extension of the input file, just check the bytes) has a bitrate of 128 kb/s, the codec was s16p, sampling at 44100 Hz, so we choose accordingly: $ ffmpeg -i sample.mp3 -acodec pcm_s16le -ar 44100 sample.wavįile 'sample.wav' already exists. Estimating duration from bitrate, this may be inaccurateĭuration: 00:04:27.76, start: 0.000000, bitrate: 128 kb/s Here's an example of doing both: ffmpeg -i song.mp3 -acodec pcm_u8 -ar 22050 song.wavĪccording to comment, I would follow this process to detect the best acodec: $ ffmpeg -formats | grep PCMĭE f32be PCM 32-bit floating-point big-endianĭE f32le PCM 32-bit floating-point little-endianĭE f64be PCM 64-bit floating-point big-endianĭE f64le PCM 64-bit floating-point little-endianĭE u16le PCM unsigned 16-bit little-endianĭE u24le PCM unsigned 24-bit little-endianĭE u32le PCM unsigned 32-bit little-endianĪt this point, consider your platform to choose between big-endian, little-endian, the choose bitrate: $ ffmpeg -i sample.mp3 If you want a smaller file size for the PCM-encoded WAV file, set a sample format with less bit depth (see -encoders option for a complete list of them) and/or choose a lower sample rate ( -ar 22050 would use 22.05 kHz for example). This results in about 1411 kBit/s for the entire container, likely much, much bigger than the MP3 input file. ffmpeg -i song.mp3 song.wav will therefore get you a PCM-encoded WAV file with 44,100 Hz sample rate and 16 bits per sample. It depends on the encoder itself.įor lossless codecs, you cannot set a variable bitrate, since each sample takes a predefined number of bits. When you use lossy output codecs (such as MPEG-1 Layer III or AAC), ffmpeg chooses a default bitrate for the output stream, or a variable bitrate. I usually use some other audio file player software to determine whether VBR is being used, as many will display that (Foobar2000 does for example). ![]() VBR in MP3 files is usually implemented simply by changing the bitrate for each frame, so whether it's being used can't be determined by just reading the header of first frame. However this only tells you bitrate of the first frame. You can get some info about the bitrate of your input files by using the ffprobe song.mp3 command. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |