Поток из Icecast прерван через несколько секунд
У меня есть поток на основе сервера Icecast. Он работает на большинстве устройств и браузеров, но есть проблема, например, в Android Mobile Chrome: я могу запустить поток, но он длится 2 секунды и останавливается. Отчеты пользователей, а также о других браузерах и устройствах.
Это информация об игроке с мобильного телефона, где возникла проблема:
{
"properties": {},
"messages": [
{
"level": "info",
"message": "FFmpegDemuxer: created audio stream, config codec: mp3, profile: unknown, bytes_per_channel: 2, channel_layout: STEREO, channels: 2, samples_per_second: 44100, sample_format: Signed 16-bit planar, bytes_per_frame: 4, seek_preroll: 0us, codec_delay: 0, has extra data: false, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: NONE, target_output_sample_format: Unknown sample format, has aac extra data: false"
},
{
"level": "info",
"message": "Selected FFmpegAudioDecoder for audio decoding, config: codec: mp3, profile: unknown, bytes_per_channel: 2, channel_layout: STEREO, channels: 2, samples_per_second: 44100, sample_format: Signed 16-bit planar, bytes_per_frame: 4, seek_preroll: 0us, codec_delay: 0, has extra data: false, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: STEREO, target_output_sample_format: Unknown sample format, has aac extra data: false"
},
{
"level": "info",
"message": "Effective playback rate changed from 0 to 1"
},
{
"level": "debug",
"message": "FFmpegDemuxer: av_read_frame(): End of file"
}
],
"events": [
{
"timestamp": 428923.310863,
"value": {
"created": "2022-06-07 11:42:54.362 UTC"
},
"displayTimestamp": "0.000",
"event": "kMediaLogCreated"
},
{
"timestamp": 428923.311442,
"value": {
"origin_url": "https://stream.xxxx.xxx:8443/"
},
"displayTimestamp": "0.001",
"event": "kWebMediaPlayerCreated"
},
{
"timestamp": 428923.311785,
"value": {
"url": "https://stream.xxxx.xxx:8443/xxxxxxx.mp3?16545998452"
},
"displayTimestamp": "0.001",
"event": "kLoad"
},
{
"timestamp": 428923.405597,
"value": {
"pipeline_state": "kStarting"
},
"displayTimestamp": "0.095",
"event": "kPipelineStateChange"
},
{
"timestamp": 428923.432143,
"value": {
"pipeline_state": "kPlaying"
},
"displayTimestamp": "0.121",
"event": "kPipelineStateChange"
},
{
"timestamp": 428923.426763,
"value": {
"duration": 2.718765
},
"displayTimestamp": "0.116",
"event": "kDurationChanged"
},
{
"timestamp": 428923.439653,
"value": {
"pipeline_buffering_state": {
"for_suspended_start": false,
"state": "BUFFERING_HAVE_ENOUGH"
}
},
"displayTimestamp": "0.129",
"event": "kBufferingStateChanged"
},
{
"timestamp": 428926.138386,
"value": {},
"displayTimestamp": "2.828",
"event": "kPlay"
},
{
"timestamp": 428929.103,
"value": {},
"displayTimestamp": "5.792",
"event": "kEnded"
},
{
"timestamp": 428929.105783,
"value": {},
"displayTimestamp": "5.795",
"event": "kPause"
}
],
"errors": []
}
Эта информация об игроке с рабочего стола, где нет проблем:
{
"properties": {},
"messages": [
{
"level": "info",
"message": "FFmpegDemuxer: created audio stream, config codec: mp3, profile: unknown, bytes_per_channel: 2, channel_layout: STEREO, channels: 2, samples_per_second: 44100, sample_format: Signed 16-bit planar, bytes_per_frame: 4, seek_preroll: 0us, codec_delay: 0, has extra data: false, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: NONE, target_output_sample_format: Unknown sample format, has aac extra data: false"
},
{
"level": "info",
"message": "Selected FFmpegAudioDecoder for audio decoding, config: codec: mp3, profile: unknown, bytes_per_channel: 2, channel_layout: STEREO, channels: 2, samples_per_second: 44100, sample_format: Signed 16-bit planar, bytes_per_frame: 4, seek_preroll: 0us, codec_delay: 0, has extra data: false, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: STEREO, target_output_sample_format: Unknown sample format, has aac extra data: false"
},
{
"level": "info",
"message": "Effective playback rate changed from 0 to 1"
}
],
"events": [
{
"timestamp": 45942.954686,
"value": {
"created": "2022-06-07 11:48:19.885 UTC"
},
"displayTimestamp": "0.000",
"event": "kMediaLogCreated"
},
{
"timestamp": 45942.954777,
"value": {
"origin_url": "https://stream.xxxx.xxx:8443/"
},
"displayTimestamp": "0.000",
"event": "kWebMediaPlayerCreated"
},
{
"timestamp": 45942.954829,
"value": {
"url": "https://stream.xxxx.xxx:8443/xxxx.mp3"
},
"displayTimestamp": "0.000",
"event": "kLoad"
},
{
"timestamp": 45943.121403,
"value": {
"pipeline_state": "kStarting"
},
"displayTimestamp": "0.167",
"event": "kPipelineStateChange"
},
{
"timestamp": 45946.605256,
"value": {
"duration": "unknown"
},
"displayTimestamp": "3.651",
"event": "kDurationChanged"
},
{
"timestamp": 45946.609078,
"value": {
"pipeline_state": "kPlaying"
},
"displayTimestamp": "3.654",
"event": "kPipelineStateChange"
},
{
"timestamp": 45946.609662,
"value": {
"pipeline_buffering_state": {
"for_suspended_start": false,
"state": "BUFFERING_HAVE_ENOUGH"
}
},
"displayTimestamp": "3.655",
"event": "kBufferingStateChanged"
},
{
"timestamp": 45949.870751,
"value": {},
"displayTimestamp": "6.916",
"event": "kPlay"
}
],
"errors": []
}
Я заметил, что на мобильном телефоне указана продолжительность, но не знаю почему.
Это фрагмент конфига Icecast.xml, который не содержит уязвимых данных:
<http-headers>
<header name="Cache-control" value="no-cache" />
</http-headers>
<limits>
<clients>500</clients>
<sources>10</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>60</source-timeout>
<burst-on-connect>1</burst-on-connect>
<burst-size>65535</burst-size>
</limits>
Конечно, требуемое поведение не должно прерывать