muiplayer / hello-muiplayer

💡 An excellent HTML5 video player component
https://muiplayer.js.org/
GNU General Public License v3.0
503 stars 100 forks source link

how to play live http-flv media? #12

Closed tony7tony closed 2 years ago

tony7tony commented 2 years ago

code:

var mp = new MuiPlayer({ container:document.getElementById("mui-player"), src:'http://192.168.1.10:8080/live/stream.flv', parse:{ type:'flv', loader:Flv, config:{ isLive:true, withCredentials:false, cors:true, }, }, });

but can't play..

muiplayer commented 2 years ago

Please check media and code.

tony7tony commented 2 years ago

概览 Complete name : H:\live\demo.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 35.8 MiB Duration : 3 分 55 秒 Overall bit rate : 1 275 kb/s Writing application : ShanaEncoder

视频 ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Baseline@L1.3 Format settings : 1 Ref Frames Format settings, CABAC : 否 Format settings, Reference frames : 1 帧 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 3 分 55 秒 Bit rate : 1 174 kb/s Width : 1 024 像素 Height : 576 像素 Display aspect ratio : 16:9 Frame rate mode : 恒定帧率 (CFR) Frame rate : 24.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 位 Scan type : 逐行扫描 (连续) Bits/(Pixel*Frame) : 0.083 Stream size : 32.9 MiB (92%) Writing library : x264 core 161 r3048 b86ae3c Encoding settings : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 编码配置区块 (box) : avcC

音频 ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 Duration : 3 分 55 秒 Source duration : 3 分 55 秒 Bit rate mode : 恒定码率 (CBR) Bit rate : 96.0 kb/s Channel(s) : 2 声道 Channel layout : L R Sampling rate : 44.1 kHz Frame rate : 43.066 FPS (1024 SPF) Compression mode : 有损 Stream size : 2.69 MiB (8%) Source stream size : 2.69 MiB (8%) Default : 是 Alternate group : 1 mdhd_Duration : 235404

tony7tony commented 2 years ago

ffmpeg.exe -re -stream_loop -1 -i demo.mp4 -c copy -f flv rtmp://192.168.1.10:1935/live/stream

use ffmpeg to push flow

tony7tony commented 2 years ago

use vlc or flv.js can play this live media

tony7tony commented 2 years ago

// 示例 hls 配置 var mp = new MuiPlayer({ container:document.getElementById("mui-player"), src:'http://192.168.1.10:8080/live/stream.m3u8', title: '演示视频', width:'50%', parse:{ type:'hls', loader:Hls, // hls config to:https://github.com/video-dev/hls.js/blob/HEAD/docs/API.md#fine-tuning config:{ debug:false, }, }, });

test hls,it works. so just http-flv not work.

tony7tony commented 2 years ago

loader:Flv, report error: Uncaught ReferenceError: Flv is not defined

muiplayer commented 2 years ago

https://muiplayer.js.org/zh/guide/preset.html#配置