Why does it take so long for Android's MediaPlayer to prepare some live streams for playback?

后端 未结 6 1017
北荒
北荒 2020-11-28 04:08

I am finding big differences in the time it takes the Android MediaPlayer to prepare for live stream playback with different streams.

The hard data<

6条回答
  •  温柔的废话
    2020-11-28 04:21

    If you're streaming from Icecast, take a look at the burst-size setting:

    The burst size is the amount of data (in bytes) to burst to a client at connection time. Like burst-on-connect, this is to quickly fill the pre-buffer used by media players. The default is 64 kbytes which is a typical size used by most clients so changing it is not usually required. This setting applies to all mountpoints unless overridden in the mount settings. Ensure that this value is smaller than queue-size, if necessary increase queue-size to be larger than your desired burst-size. Failure to do so might result in aborted listener client connection attempts, due to initial burst leading to the connection already exceeding the queue-size limit.

    I increased the burst-size to 131072 on my server, and now my Android app based on MediaPlayer plays streams without much delay.

提交回复
热议问题