[FFmpeg-user] Is this the best method to keep audio quality when converting lossy audio to another lossy audio?

Reino Wijnsma rwijnsma at xs4all.nl
Fri Jun 1 14:03:58 EEST 2018


Hello Farhad,

On 1-6-2018 10:37, Farhad Mohammadi Majd <farhadbenyamin-at-yahoo.com at ffmpeg.org> wrote:
> Hello, I have a large collection of audio files contains music in mp3
> format, due to need to free space of hard disk, I need to reduce their
> size.
>
> It seems opus is the best format for this purpose, in order to have the
> quality of original mp3 files, currently I use ffmpeg command to
> convert them to FLAC and then use opusenc, the official opus encoder,
> to convert FLAC files to opus.
>
> By using one standard and good quality headphone, My ears don't notice
> any difference between original mp3 files versus new opus files.
>
> 1. Is this the best method to keep audio quality when converting lossy
> audio to another lossy audio?
First of all I would never recommend a lossy to lossy conversion as you'd always lose audio quality in the process. If you can get a hold of the lossless source (the original cd's, or FLAC/WV/TAK files), then it's always recommended to convert those to opus!
But if you insist,... an intermediate FLAC file isn't necessary. 'opusenc' mentions "The input format can be Wave, AIFF, FLAC, Ogg/FLAC, or raw PCM.", so instead of converting the mp3 files to flac, you can also pipe the decoded mp3 audio from 'ffmpeg' to 'opusenc':

ffmpeg -i input.mp3 -f wav - | opusenc --bitrate 64 - output.opus

On the other hand, if you compiled FFmpeg with libopus, then you don't need 'opusenc' at all. 'ffmpeg' is then all you need:

ffmpeg -i input.mp3 -c:a libopus -ab 64k output.opus
> 2. Is there any quailty loss in this method? if yes, is it noticeable?
> how much is it?
Yes there is, as is always the case with a lossy to lossy conversion.
Not necessarily. If the bitrate of the mp3 files is high enough, then you may not notice it at all. If that's okay with you, then fine.

-- Reino



More information about the ffmpeg-user mailing list