Kurento KMS 流媒体服务器 webRTC转rtmp http flv | 您所在的位置:网站首页 › docker 流媒体服务器 › Kurento KMS 流媒体服务器 webRTC转rtmp http flv |
mugennsou/http-flv http-flv/README_CN.md at master · mugennsou/http-flv (github.com)
nginx-http-flv-module/README.CN.md at master · winshining/nginx-http-flv-module (github.com) 下载docker镜像: docker pull mugennsou/nginx-http-flv 运行流媒体服务器: docker run --rm -it -p 80:80 -p 1935:1935 mugennsou/nginx-http-flv 往指定的服务器推流 ffmpeg -re -i ~/Videos/b.mp4 -c copy -f flv rtmp://127.0.0.1/demo/stream-1 访问 http://127.0.0.1Ubuntu安装ffmpeg: sudo apt-get install ffmpeg srs流媒体服务器 推流: RTMP使用Frame,即帧级别对象。 RTC使用RTP,即包级别对象,Video Frame可能会包含多个RTP packet。 RTMP转RTC,使用Bridger,这样使RTMP和RTC的逻辑相对独立。 RTC下行NACK和PLI都支持,上行NACK还未支持,能跑通了。详细改动可以参考:c768a8c...3cb797d
https://blog.csdn.net/lixiang987654321/article/details/108714690 webRTC推流 视频教学:https://www.bilibili.com/video/av800024876/ SRS文档: https://github.com/ossrs/srs/tree/4.0releasehttps://github.com/ossrs/srs/wiki/v4_CN_Home 源码编译: 国内: 1, 源码克隆 git clone https://gitee.com/winlinvip/srs.oschina.git srs && cd srs/trunk && git remote set-url origin https://github.com/ossrs/srs.git && git pull 2, 转到最新4.0开发版,因要使用webRTC git checkout 4.0release 3,–rtc=on 默认 ./configure --with-hls --with-ssl --with-http-server --with-http-callback --with-http-api --with-ingest --with-stream-caster && make成功后显示: ![]() ![]() ![]() ![]() 运行 输出webRTC(参考:https://github.com/ossrs/srs/issues/307): ./objs/srs -c conf/rtc.conf [2020-12-14 16:57:41.108][Trace][38868][34doo9ww] XCORE-SRS/4.0.56(Leo) [2020-12-14 16:57:41.108][Trace][38868][34doo9ww] config parse complete [2020-12-14 16:57:41.108][Trace][38868][34doo9ww] you can check log by: tail -f ./objs/srs.log (@see https://github.com/ossrs/srs/wiki/v1_CN_SrsLog) [2020-12-14 16:57:41.108][Trace][38868][34doo9ww] please check SRS by: ./etc/init.d/srs status用FFMPEG或OBS推送RTMP流到服务器: 用rtmp来传输flv流: ffmpeg -re -i doc/source.200kbps.768x320.flv -c copy \ -f flv -y rtmp://192.168.1.3/live/livestreamobs的界面设置,后面的串流密钥a.flv是要接到url就可以观看了。 播放器中url写: http://localhost:8000/live/a.flv flv播放器h5源码: ![]() ![]() ![]() ![]() webRTC推流:https://ossrs.net/players/srs_player.html 这个页面都有包括播放,推流。 推流拉流工具ffmpeg,obs界面 方法:https://cloud.tencent.com/developer/article/1505068 sudo add-apt-repository ppa:obsproject/obs-studio sudo apt update sudo apt install obs-studio
可播放的流地址: rtmp://127.0.0.1/live/livestream webrtc://127.0.0.1/live/livestream http flv地址是: http://192.168.16.133:8080/live/livestream.flv 对于http flv需要在conf/rtc.conf中添加 http remux:![]() ![]()
播放验证,用网页的播放器直接播放:https://ossrs.net/players/srs_player.html 输入网址即可播放 webrtc rtmp等 go实现的webrtc。 开源的monibuca,简洁和可插拔,架构不错:http://docs.monibuca.com/ 首先我们知道,Rtmp是一种客户端到服务端的技术,Peer to Server。WebRTC是一种客户端到客户端的技术,Peer to Peer。 Rtmp通过一个TCP连接,向服务端发送或接收连接信息,媒体数据。 WebRTC先使用ICE技术连接STUN/TURN,得到自己的连接信息。再绑定音视频设备获取媒体信息,拼装为SDP信令。两个客户端通过任意方式交换信令,建立客户端直接的连接,再使用RTP发送和接收媒体数据。 如果一个服务端实现了WebRTC客户端的能力,那么它也可以被认为是一个Peer,与用户浏览器的WebRTC客户端创建连接,获得客户端推送过来的媒体数据,就完成了Peer to Server的转换。 需要定义信令交换的方式,web编程当然最简单的就是WebSocket了,定义了一个URL格式wss://serverip:port/live/stream.rtc 这种格式和RTMP,HTTP-FLV等相互通用。必须是wss,因为现在的浏览器对webrtc访问摄像头,测试用localhost可以不用ssl。信令交换后,客户端创建了和服务端的udp连接,并源源不断的发送H.264+Opus的rtp包。目前客户端能使用的视频编码是vp8,vp9,h264,音频有PCMA,Opus,不会有AAC,因此我们还需要定义flv封装Opus。Opus和AAC类似,我们定义id为13。这样实现rtmp播放客户端的时候,加入opus解码能力和flv负载opus的能力,就可以播放啦。服务端将Opus直接转码为AAC todo。 webRTC不是localhost时需要https,可以做个代理实现: https://github.com/ossrs/go-oryx/tree/develop/httpx-static 文档都在上面的链接中,做为代理的命令: go get github.com/ossrs/go-oryx/httpx-static && cd $GOPATH/src/github.com/ossrs/go-oryx/httpx-static && openssl genrsa -out server.key 2048 && subj="/C=CN/ST=Beijing/L=Beijing/O=Me/OU=Me/CN=me.org" && openssl req -new -x509 -key server.key -out server.crt -days 365 -subj $subj && $GOPATH/bin/httpx-static -https 8443 -root `pwd`/html -proxy http://ossrs.net:1985/api/v1windows上启动,https端口在8443 set PATH=%gopath%\bin;E:\dev\TASSL-1.1.1b-master\apps;%PATH%; cd C:\Users\zhibin\go\src\github.com\ossrs\go-oryx\httpx-static rem openssl genrsa -out server.key 2048 rem openssl req -new -x509 -key server.key -out server.crt -days 365 -subj "/C=CN/ST=Beijing/L=Beijing/O=Me/OU=Me/CN=me.org" rem httpx-static -t 8088 -s 8443 -r ./html -p http://localhost:8081 -d 192.168.50.206 -k server.key -c server.crtWebRTC 研究系列 二、打通webrtc与rtmp pion/webrtc go语言的。 https://github.com/pion/example-webrtc-applications/tree/master/twitch 一个利用ffmpeg转发到rtmp的示例
WebRTC video stream broadcastwith conversion to RTMP WebRTC broadcast with republishing as RTMP WebRTC as RTMP republishing 商用的: 1,http://bashell.nodemedia.cn/archives/webrtc-research-series-2-get-through-webrtc-and-rtmp.html WebRTC推流--ShowDoc (nodemedia.cn) 2,https://flashphoner.com/webrtc-as-rtmp-re-publishing/ 带你吃透RTMP SRS 代码分析 https://blog.csdn.net/ManagerUser/article/details/73840130/ srs部署/webrtc拉流 webrtc 资源 WebRTC for the Curious |
CopyRight 2018-2019 实验室设备网 版权所有 |