WebRTC Simulcast测试--用Janus
一 Simulcast和SVC的区别:
Simulcast:客户端将三层流同时发布,其它客户端拉流时,根据网络情况,选择一种。每一层能使用硬件编解码器。
SVC:发布的是一路码流,由多层组成。多层的没有硬件支持。(见图,图是其它文章的)
声网用的Simulcast分层,zoom和思科用的svc。svc复杂些。
二 使用Janus测试
https://ip/echotest.html?simulcast=true?vcodec=h264
必须是https,否则报getUserMedia失败。
H264没有simulcast,直接改var doSimulcast = true--echotest.js。
SDP新增的字段:rtp加了扩展头rtp-stream-idrtp-stream-id。
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=rid:h send
a=rid:m send
a=rid:l send
a=simulcast:send h;m;l
//接收的
a=rid:h recv
a=rid:m recv
a=rid:l recv
a=simulcast:recv h;m;l
RTP扩展头,Identifier是10,6c是l,表示low那路,ssrc是0xcfe94bdc。服务器就知道具体是那路simulcast了。
simulcast是三路流,用不同的ssrc表示。音视频都是同一个端口。