Closed jechosu closed 2 months ago
I too would love this
Something like having the option to just display for example: 24 - 96, 16 - 44.1 would also be a great qol addition!
The reason why the bitrate is not displayed when playing flac files is AVPlayer
(the audio player provided by apple). I use track?.load(.estimatedDataRate)
to load the bitrate, but it just doesn't work correctly when playing flac files. But fetching the data from the Jellyfin server might work
The properties of the track give pretty good insight assuming that metadata exists there
This is going to be impossible for future version of Jellyfin or you just want to lie to your users, if you ever display the bitrate for lossless codecs.
Music streaming may also have transcoding happening and in future version of Jellyfin the Music transcoding can support VBR and lossless transcoding as well, and the bitrate cannot be accurately predicted for those codecs anyway.
For now you can try to get the original file metadata but that could be different from what the actual audio the server is streaming for your user.
I think only the Sample rate and Bit depth ever matters for a lossless codec anyway, we can just remove the bitrate for all lossless codecs.
Remember: for a lossless codec, more bitrate does not mean better quality. It only means it is compressed worse.
For the actual file data, it is located in the /Users/{userId}/Items/{itemId}
endpoint, and you can get everything you want in the MediaSources
property. There will be multiple entries in the MediaStreams
under MediaSources
, pick the audio one(Type == Audio
) and BitRate
, BitDepth
and SampleRate
will be available there.
I kind of forgot that flac is a lossless codec, so it does make sense that it does not provide bitrate data. Using the metadata from Jellyfin is a good idea and the player could fallback to the data provided by AVPlayer
(for example when offline).
Any possibility to have the option to just see the sample rate and bit depth instead of the codec?
Yes, and I think it's reasonable to show them, instead of the Bitrate, by default when playing a lossless codec.
While AAC and MP3 files display bitrate in the now playing screen, playing FLACs does not display the bitrate nor the sample rate/bit-depth. Is there a way to get that information in the future, possibly from the properties of the track on Jellyfin?