把摄像机的rtsp流转码播放
1. 启动ZLMediaKit
2. 执行addStreamProxy如下,stream是流ID,不要重复,可为字母数字等,
3. rtsp://10.136.238.143/live/123 这个地址可播放,如果stream变化则同步修改,vlc播放稳定
4. rtmp://10.136.238.143/live/123 这个地址可播放,vlc过一会掉线停止了
5. http://10.136.238.143/live/123.flv 这个地址可播放,vlc过一会掉线停止了
6. 网页播放用http://10.136.238.143/live/123.flv
<script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
<video id="videoElement"></video>
<button class="btn">播放</button>
<script>
if (flvjs.isSupported()) {
var videoElement = document.getElementById('videoElement');
var flvPlayer = flvjs.createPlayer({
type: 'flv',
url: 'http://10.136.238.143/live/123.flv'
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
document.querySelector('.btn').addEventListener('click', () => {
flvPlayer.play();
})
}
</script>
标签:ZLMediaKit,转码,flvPlayer,rtsp,10.136,live,123,238.143 From: https://www.cnblogs.com/81/p/18388821