Open besarmemishi opened 2 years ago
-1
is Format.NO_VALUE
- so this suggests that ExoPlayer's MetadataRetriever
didn't read a bitrate value from the provided media.
Have you read the caveats on Format.averageBitrate
and Format.peakBitrate
as to when you will see NO_VALUE
(since bitrate
is just one or other of these values)?
ExoPlayer metadata extraction is motivated by the information needed for playback. For non-adaptive playback (e.g. just an MP4 file) the bitrate isn't very useful, because there are no adaptive track selection decisions to be made - so it's often not read from these sorts of files.
while the Android MetadataRetriever returns correct bitrate.
I assume you mean android.media.MediaMetadataRetriever
here?
I'm marking this as an enhancement to output these values from MetadataRetriever
. Just to set expectations: we currently have no plans to work on this.
Yes, I meant `android.media.MediaMetadataRetriever``
I am using Exo MetadataRetriever as it is extremly faster comparing to MediaMetadataRetriever.
When I receive -1
which happens for most of .mp3
files, also the Format.averageBitrate and Format.peakBitrate are -1
May be willing to work on this in the future if I get enough time. How feasible is it to get an approximate bitrate for VBR progressive containers @icbaker? One of the big reasons I want this to be added is so that I can show a correct approximate bitrate for VBR files, something that MediaExtractor
doesn't do.
For the record Exoplayer already extract the mp3 bitrate, in mp3extractor.java
readInternal
you can just add .setAverageBitrate(synchronizedHeader.bitrate)
.
Wanted to check for more formats and it's not that hard for Alac and FLAC (at least approximate).
I also wanted to expose bit per sample for FLAC but I'm not sure if adding a new field to MetaData would have been accepted.
Question
I wonder why for some audio/video files (https sources) the bitrate returns -1, while the Android MetadataRetriever returns correct bitrate.
Example
Version
com.google.android.exoplayer:exoplayer:2.17.1