flv.js
flv.js copied to clipboard
flvjs 不能播放纯视频问题,部分流 MediaDataSource.hasAudio = false 仍不能解决
当流里只有视频流,没有音频流时,即便通过 MediaDataSource.hasAudio = false 仍不能解决, 具体流信息如下:
Metadata:
displayWidth : 1280
displayHeight : 960
fps : 0
profile :
level :
videocodecreal : 0
cdn_ip : 115.231.71.158
Server : Tengine
author : johnson
copyright : johnson
description : live-ipcamera
Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x960 [SAR 1:1 DAR 4:3], 25 fps, 30 tbr, 1k tbn, 50 tbc
I'm running into the same problems. It appears a lot of assumptions were made about there being audio when this was written. There definitely isn't a quick fix here.
@ludai223
Please paste the error message from console
and chrome://media-internals
In my opinion, it is caused by the pixel format yuvj420p
which may not be supported(?) by the browser.
我也碰到了同样的问题,不知道现在改问题有解决吗 @ludai223 @xqq
console 信息:
Uncaught (in promise) DOMException
flv.js:11675 [MSEController] > MediaSource onSourceOpen
flv.js:11590 [TransmuxingController] > DemuxException: type = FormatError, info = Flv: Invalid AVCDecoderConfigurationRecord
e @ flv.js:11590
flv.js:1251 Uncaught (in promise) Error: Uncaught, unspecified "error" event. (MediaError)
at EventEmitter.emit (flv.js:1251)
at EventEmitter.
chrome://media-internals: render_id: 408 player_id: 0 origin_url: http://xxx.xx.xx.xxx:xxxx/ frame_url: http://xxx.xx.xx.xxx:xxxx/html/play.html?id=1234 frame_title: surface_layer_mode: kOnDemand url: blob:http://xxx.xx.xx.xxx:xxxx/4aa68fcb-f2d2-456a-8b4a-bca6fde54666 info: ChunkDemuxer: buffering by DTS pipeline_state: kStopped pipeline_error: DEMUXER_ERROR_COULD_NOT_OPEN
我也遇到同样问题,后来发现客户端视频编码打包时 sps pps 中包含了帧界定符(0,0,0,1)。去除后就 OK 了
纯视频的话你可以参考这样设置。亲测有效。
var flvPlayer = flvjs.createPlayer({ type: 'flv', hasAudio: false,//<====加个这个 isLive: true, url: 'http://www.test.com/live/test.flv' });
是因为yuvj420p的原因吗?我也出现了类似问题