A basic implementation would be: if the source file is already encoded in a lossy format, ignore transcoding setting and serve the file as is.
I use Navidrome as backend. My library is a mix of lossless (FLAC) and lossy (mp3, ogg, aac) music. If I enable transcoding, I’m served an encoded file regardless of the source format.
This causes two problems:
- if source bitrate is lower than the setting, the served file is larger than source.
- Transcoding across lossy formats (e.g. mp3 to ogg) causes - admittedly very minor - artifacts in the audio.
Data saving for problem 1). Peace to the dozens of audiophiles bothered by 2)
From a data saving point of view, default behaviour should be that if source bitrate is lower than quality setting, the file should be served as-is.
For quality, options could be added in the ‘Playback’ section of the settings:
- Never transcode from lossy format/only transcode lossless formats
- only transcode if source bitrate is greater than…