我有一个基于 Icecast 服务器的流。它适用于大多数设备和浏览器,但有一个问题,例如在 Android 移动版 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>
当然,要求的行为是不要打扰