nathom / streamrip

A scriptable music downloader for Qobuz, Tidal, SoundCloud, and Deezer
GNU General Public License v3.0
2.35k stars 209 forks source link

Fix lossless conversion bit depth issues #616

Closed disconnect78 closed 5 months ago

disconnect78 commented 5 months ago

When converting to a lossless codec, there are two issues relating to the bit depth:

This can be fixed by refactoring lossless conversion to always pass an aformat filter, containing sampling rate and/or bit depth (whereas previously only the sampling rate was in an aformat filter). This allows us to pass a list of bit depths; so not only can we specify both planar and non-planar formats (so ffmpeg can simply pick whichever applies to the specified codec), but if a list of bit depths is specified then ffmpeg won't use a bit depth higher than that of the source file.

nathom commented 5 months ago

Looks good. Thanks!