bilibili / flv.js

HTML5 FLV Player
Apache License 2.0
22.96k stars 3.38k forks source link

使用某些摄像头设备推流时 flv.js 播放音频会卡顿,甚至音视频不同步 #406

Open ludai223 opened 5 years ago

ludai223 commented 5 years ago

浏览器警告: image

流信息: image

浏览器日志:

{
  "1511:4": {
    "id": "1511:4",
    "properties": {
      "render_id": 1511,
      "player_id": 4,
      "info": "Selected video track: [1]",
      "video_buffering_state": "BUFFERING_HAVE_ENOUGH",
      "for_suspended_start": false,
      "pipeline_buffering_state": "BUFFERING_HAVE_ENOUGH",
      "pipeline_state": "kStopped",
      "event": "WEBMEDIAPLAYER_DESTROYED"
    },
    "allEvents": [
      {
        "time": 0,
        "key": "info",
        "value": "Selected video track: [1]"
      },
      {
        "time": 0.04800000786781311,
        "key": "video_buffering_state",
        "value": "BUFFERING_HAVE_NOTHING"
      },
      {
        "time": 666.8319999873638,
        "key": "video_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 684.2930000126362,
        "key": "for_suspended_start",
        "value": false
      },
      {
        "time": 684.2930000126362,
        "key": "pipeline_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 2258.324999988079,
        "key": "video_buffering_state",
        "value": "BUFFERING_HAVE_NOTHING"
      },
      {
        "time": 2494.2680000066757,
        "key": "video_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 2494.389999985695,
        "key": "pipeline_state",
        "value": "kStopping"
      },
      {
        "time": 2495.7599999904633,
        "key": "pipeline_state",
        "value": "kStopped"
      },
      {
        "time": 2496.053999990225,
        "key": "event",
        "value": "WEBMEDIAPLAYER_DESTROYED"
      }
    ],
    "lastRendered": 0,
    "firstTimestamp_": 180935353.28,
    "destructed": true
  },
  "1511:11": {
    "id": "1511:11",
    "properties": {
      "render_id": 1511,
      "player_id": 11,
      "origin_url": "https://shangzhibo.tv/",
      "frame_url": "https://shangzhibo.tv/watch/9680885",
      "frame_title": "p3推流测试",
      "url": "blob:https://shangzhibo.tv/cc6aaba7-535a-4be1-9d1d-e7d904d137cc",
      "info": "Selected video track: []",
      "pipeline_state": "kPlaying",
      "found_video_stream": true,
      "video_codec_name": "h264",
      "found_audio_stream": true,
      "audio_codec_name": "aac",
      "audio_dds": false,
      "audio_decoder": "FFmpegAudioDecoder",
      "is_platform_audio_decoder": false,
      "debug": " Detected midstream configuration change PTS:542000 Sample Rate: 64000 vs 32000, ChannelLayout: 3 vs 2, Channels: 2 vs 1",
      "video_dds": false,
      "video_decoder": "GpuVideoDecoder",
      "is_platform_video_decoder": true,
      "warning": "Failed to reconcile encoded audio times with decoded output.",
      "audio_buffering_state": "BUFFERING_HAVE_ENOUGH",
      "seek_target": 0.01,
      "video_buffering_state": "BUFFERING_HAVE_ENOUGH",
      "height": 720,
      "width": 1280,
      "for_suspended_start": false,
      "pipeline_buffering_state": "BUFFERING_HAVE_ENOUGH",
      "event": "PLAY",
      "duration": "unknown"
    },
    "allEvents": [
      {
        "time": 0,
        "key": "origin_url",
        "value": "https://shangzhibo.tv/"
      },
      {
        "time": 0.007999986410140991,
        "key": "frame_url",
        "value": "https://shangzhibo.tv/watch/9680885"
      },
      {
        "time": 0.013000011444091797,
        "key": "frame_title",
        "value": "p3推流测试"
      },
      {
        "time": 0.09700000286102295,
        "key": "url",
        "value": "blob:https://shangzhibo.tv/cc6aaba7-535a-4be1-9d1d-e7d904d137cc"
      },
      {
        "time": 0.1419999897480011,
        "key": "info",
        "value": "ChunkDemuxer: buffering by DTS"
      },
      {
        "time": 0.19900000095367432,
        "key": "pipeline_state",
        "value": "kStarting"
      },
      {
        "time": 1359.0020000040531,
        "key": "found_video_stream",
        "value": true
      },
      {
        "time": 1359.013000011444,
        "key": "video_codec_name",
        "value": "h264"
      },
      {
        "time": 1359.1730000078678,
        "key": "found_audio_stream",
        "value": true
      },
      {
        "time": 1359.1789999902248,
        "key": "audio_codec_name",
        "value": "aac"
      },
      {
        "time": 1363.8659999966621,
        "key": "audio_dds",
        "value": false
      },
      {
        "time": 1363.8759999871254,
        "key": "audio_decoder",
        "value": "FFmpegAudioDecoder"
      },
      {
        "time": 1363.8779999911785,
        "key": "is_platform_audio_decoder",
        "value": false
      },
      {
        "time": 1364.0090000033379,
        "key": "info",
        "value": "Selected FFmpegAudioDecoder for audio decoding, config: codec: aac bytes_per_channel: 2 channel_layout: 2 channels: 1 samples_per_second: 32000 sample_format: 2 bytes_per_frame: 2 seek_preroll: 0ms codec_delay: 0 has extra data? false encryption scheme: Unencrypted discard decoder delay? false"
      },
      {
        "time": 1364.136000007391,
        "key": "debug",
        "value": "Video rendering in low delay mode."
      },
      {
        "time": 1366.505999982357,
        "key": "video_dds",
        "value": false
      },
      {
        "time": 1366.511000007391,
        "key": "video_decoder",
        "value": "GpuVideoDecoder"
      },
      {
        "time": 1366.513000011444,
        "key": "is_platform_video_decoder",
        "value": true
      },
      {
        "time": 1366.5309999883175,
        "key": "info",
        "value": "Selected GpuVideoDecoder for video decoding, config: codec: h264 format: 1 profile: h264 high coded size: [1280,720] visible rect: [0,0,1280,720] natural size: [1280,720] has extra data? false encryption scheme: Unencrypted rotation: 0°"
      },
      {
        "time": 1366.555999994278,
        "key": "pipeline_state",
        "value": "kPlaying"
      },
      {
        "time": 1366.9970000088215,
        "key": "warning",
        "value": "Failed to reconcile encoded audio times with decoded output."
      },
      {
        "time": 1367.791000008583,
        "key": "audio_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 1402.013000011444,
        "key": "seek_target",
        "value": 0.01
      },
      {
        "time": 1402.2129999995232,
        "key": "pipeline_state",
        "value": "kSeeking"
      },
      {
        "time": 1402.2540000081062,
        "key": "audio_buffering_state",
        "value": "BUFFERING_HAVE_NOTHING"
      },
      {
        "time": 1404.2739999890327,
        "key": "pipeline_state",
        "value": "kPlaying"
      },
      {
        "time": 1405.324999988079,
        "key": "warning",
        "value": "Failed to reconcile encoded audio times with decoded output."
      },
      {
        "time": 1406.3149999976158,
        "key": "audio_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 1429.1850000023842,
        "key": "video_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 1429.361999988556,
        "key": "height",
        "value": 720
      },
      {
        "time": 1429.361999988556,
        "key": "width",
        "value": 1280
      },
      {
        "time": 1429.3959999978542,
        "key": "for_suspended_start",
        "value": false
      },
      {
        "time": 1429.3959999978542,
        "key": "pipeline_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 1429.5769999921322,
        "key": "info",
        "value": "Effective playback rate changed from 0 to 1"
      },
      {
        "time": 1429.6590000092983,
        "key": "event",
        "value": "PLAY"
      },
      {
        "time": 1742.208999991417,
        "key": "debug",
        "value": " Detected midstream configuration change PTS:542000 Sample Rate: 64000 vs 32000, ChannelLayout: 3 vs 2, Channels: 2 vs 1"
      },
      {
        "time": 1359.069000005722,
        "key": "duration",
        "value": "unknown"
      },
      {
        "time": 12130.711999982595,
        "key": "info",
        "value": "Selected video track: []"
      },
      {
        "time": 12130.840000003576,
        "key": "video_buffering_state",
        "value": "BUFFERING_HAVE_NOTHING"
      },
      {
        "time": 12131.888000011444,
        "key": "video_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      },
      {
        "time": 12131.921000003815,
        "key": "for_suspended_start",
        "value": false
      },
      {
        "time": 12131.921000003815,
        "key": "pipeline_buffering_state",
        "value": "BUFFERING_HAVE_ENOUGH"
      }
    ],
    "lastRendered": 0,
    "firstTimestamp_": 180939690.053
  }
}
saysmy commented 5 years ago

音视频不同步现在是很大问题,试了多个commit,都解决不了。。。。如何才能规范推流端的音频呢?

exolution commented 5 years ago

@ludai223 你这个json格式的 media-internals日志 有啥api可以直接获取么

boyyi commented 4 years ago

请问后台使用websocket需要传哪些东西给前端呢

waiter89 commented 3 years ago

这个问题解决了吗?怎么解决的?

boyyi commented 3 years ago

不知道你用的是什么框架,我这边后面是用的node-media-server来实现浏览器播放实时视频的

---原始邮件--- 发件人: @.> 发送时间: 2021年6月1日(周二) 凌晨5:03 收件人: @.>; 抄送: @.**@.>; 主题: Re: [bilibili/flv.js] 使用某些摄像头设备推流时 flv.js 播放音频会卡顿,甚至音视频不同步 (#406)

这个问题解决了吗?怎么解决的?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.