ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

MP4 bitrate value is always -1

Open AntonAFA opened this issue 8 years ago • 2 comments

Hello guys. Have some small question. From what i see mp4 bitrate is always equal to -1. Is it correct? Is there any way to obtain its bitrate, or it should be a correct behaviour? For example video from your demo app: https://html5demos.com/assets/dizzy.mp4

AntonAFA avatar Jan 16 '18 12:01 AntonAFA

This is working as intended. -1 is the value assigned to Format#NO_VALUE. In this case, means it is not known . I don't know if ExoPlayer fills in the bitrate for any Container format outside of the context of adaptive streaming, I suppose it would require the file having some kind of descriptor, and adding support for it. Other than that, you will have to calculate it yourself, unfortunately. It depends on your usecase in the end, as bitrate is not necessarily easy to define. For this specific case, you could get an approximation by doing size/duration, but that does not differentiate between media types, and also assumes constant bitrate.

AquilesCanta avatar Jan 16 '18 17:01 AquilesCanta

FYI - Propagating a file size in Format for non-adaptive streams (which would also let us automatically populate the bitrate field with the size divided by the duration) is tracked by https://github.com/google/ExoPlayer/issues/2638.

ojw28 avatar Jan 17 '18 10:01 ojw28