這個場景中,我們可以直接利用強大的ffmpeg將本地文件,以直播的方式輸出
ffmpeg -re -stream_loop -1 -fflags +genpts -i F:\05CACHE\ss.mp4 -vcodec copy -acodec copy -strict -2 -f flv -y rtmp://demo.liveqing.com:10085/hls/marvin1311
此處的rtmp://demo.liveqing.com:10085/hls/test 是示例的推流服務地址
運行如下:
此時rtmp://demo.liveqing.com:10085/hls/marvin1311 也是播放地址
如何解決無插件直播?
除了一路
- rtmp://demo.liveqing.com:10085/hls/marvin1311
此時流媒體服務提供了另外的兩路流
- http://demo.liveqing.com:10080/hls/marvin1311/marvin1311_live.m3u8
- http://demo.liveqing.com:10080/flv/hls/marvin1311.flv
Web直播/點播播放器
也可以使用流媒體服務提供的播放器服務
http://demo.liveqing.com:10080/LivePlayer.html
點擊下面的地址即可播放
http://demo.liveqing.com:10080/LivePlayer.html?videoUrl=rtmp://demo.liveqing.com:10085/hls/marvin1311