janus webrtc gateway docker

2025-12-11 0 537

Caustion!

This repo is not maintained anymore. Use this repository https://g*ithub.c*om*/wangsrGit119/januswebrtcgatewaydocker to raise issues or PRs. Thanks.

How to use

https://www.usel**o*om.com/share/325799006d6f4b64a6ce0662ca3f1d57

1. git clone https://github**.*com/atyenoria/janus-webrtc-gateway-docker.git && cd janus-webrtc-gateway-docker
2. make build
3. make run
4. star this repository after succeeding. Create the issue if you failed. We will help you as much as possible
  • open in Safari (http can\’t work in Chrome and Firefox)
  • use the host having global ip

Dockerfile Characteristics

  • libwebsocket v3.1.0, build with LWS_MAX_SMP=1, ipv6=true for single thread processing
  • libsrtp v2.2.0
  • ffmpeg 4.2.1 with vpx, libx264, alsa(for headless chrome screen caputreing)
  • gstreamer installation from gstreamer1.0-tools. (WIP for meson ninja build)
  • coturn v4.5.0.8 in order to test turn, use iceTransportPolicy=relay https://www.**w*3.org/TR/webrtc/#rtcicetransportpolicy-enum
  • openresty 1.13.6.2
  • nvm + node.js v12.18.3 (Latest LTS: Erbium)
  • certbot for let\’s encyrpt ssl setting
  • boringssl stable https://boringssl.googlesour***ce.com/boringssl/+/chromium-stable
  • libnice v0.1.14 https://gith*ub.co**m/libnice/libnice/releases/tag/0.1.14
  • golang 1.7.5 for building boringssl
  • janus v0.10.9, enable all janus plugins(like videoroom, streaming, audiobridge…etc
  • [optional] GDB, Address Sanitizer(optional, see Dockerfile) for getting more info when crashing
  • nginx-rtmp-module and ffmpeg compile for MCU functionalilty experiment. For example, WEBRTC-HLS, DASH, RTMP…etc
  • use –net=host for network performance. If you use docker network, some overhead might appear (ref. https://hub.**d*ocker.com/_/consul/)

Introduction

This is a docker image for Janus Webrtc Gateway. Janus Gateway is still under active development phase. So, as the official docs says, some minor modification of the middleware library versions happens frequently. I try to deal with such a chage as much as I can. If you need any request about this repo, free to contact me. About the details of setup for this docker image, you should read the official docs https://janus.c*on*f.meete*cho.com/index.html carefully.

Janus WebRTC Gateway Performance

With the latest libnice, janus gateway seems to be great performance. This repo contains this patch(see https://gitlab.*fre*ed*esktop.org/libnice/libnice/merge_requests/13 )
https://webrtch**a*cks.com/sfu-load-testing/

(right side janus graph is available for this docker image )

[wip]Janus WebRTC Gateway vs Jitsi Video Bridge(Personal Opinion)

I think that janus is better for webinar(web seminar), and jitsi is better for web conference system.
The scalability of the current Jitsi Video Bridge(20181007) is poor because of having no local recording file(I\’m not sure of this..). https://www.you*t*ub*e.com/watch?v=OHHoqKCjJ0E
Jitsi last-n + VP8 simulcasting has the very good performance for web conference https://jit**si.org*/wp-content/uploads/2016/12/nossdav2015lastn.pdf
For the video format, janus recording is per video streaming, jitsi is for mixed video conference by using chrome headlesss + ffmpeg(alsa, libxcb).
From these points, janus is suitable for webinar, jitsi is for web conference.
Of course, both WebRTC SFU are amazing work!! I\’m using both.

[wip]Network benchmarking for preparing WebRTC SFU development

use iperf, netperf

Janus ./configure

libsrtp version:           2.x
SSL/crypto library:        BoringSSL
DTLS set-timeout:          yes
Mutex implementation:      GMutex (native futex on Linux)
DataChannels support:      yes
Recordings post-processor: yes
TURN REST API client:      yes
Doxygen documentation:     no
Transports:
    REST (HTTP/HTTPS):     yes
    WebSockets:            yes
    RabbitMQ:              no
    MQTT:                  no
    Unix Sockets:          no
    Nanomsg:               no
Plugins:
    Echo Test:             yes
    Streaming:             yes
    Video Call:            yes
    SIP Gateway (Sofia):   yes
    SIP Gateway (libre):   no
    NoSIP (RTP Bridge):    yes
    Audio Bridge:          yes
    Video Room:            yes
    Voice Mail:            yes
    Record&Play:           yes
    Text Room:             yes
    Lua Interpreter:       no
    Duktape Interpreter:   no
Event handlers:
    Sample event handler:  no
    RabbitMQ event handler:no
    MQTT event handler:    no
JavaScript modules:        no

RTMP -> RTP -> WEBRTC

IP=0.0.0.0
PORT=8888
/root/bin/ffmpeg -y -i  \"rtmp://$IP:80/rtmp_relay/$1  live=1\"  -c:v libx264 -profile:v main -s 640x480  -an -preset ultrafast  -tune zerolatency -f rtp  rtp://$IP:$PORT

you should use janus streaming plugin
https://**github*.com/meetecho/janus-gateway/blob/8b388aebb0de3ccfad3b25f940f61e48e308e604/plugins/janus_streaming.c

WEBRTC -> RTP -> RTMP

IP=0.0.0.0
PORT=8888
SDP_FILE=sdp.file
/root/bin/ffmpeg -analyzeduration 300M -probesize 300M -protocol_whitelist file,udp,rtp  -i $SDP_FILE  -c:v copy -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency  -f flv rtmp://$IP:$PORT/rtmp_relay/atyenoria

In order to get the keyframe much easier, it is useful to set fir_freq=1 in janus conf
you should use janus video room or audiobridge plugin
https://gith**ub.c*om/meetecho/janus-gateway/blob/8b388aebb0de3ccfad3b25f940f61e48e308e604/plugins/janus_videoroom.c
https://*gith*ub.c*om/meetecho/janus-gateway/blob/8b388aebb0de3ccfad3b25f940f61e48e308e604/plugins/janus_audiobridge.c
After publishing your feed in your room, you should use rtp-forward. The sample javascript command is

# Input this in Google Chrome debug console. you must change publisher_id, room, video_port, host, secret for your conf.
var register = { \"request\" : \"rtp_forward\", \"publisher_id\": 3881836128186438, \"room\" : 1234, \"video_port\": 8050, \"host\" : \"your ip address\", \"secret\" : \"unko\" }
sfutest.send({\"message\": register});

[wip] Mixing for janus recording

  1. ffmpeg mixing from the janus recording outputs files
    I think that it is very difficult to align the file from the multiples timestamps in the case of the long mp4 file. you may consider the lipsync.
`#{ffmpeg_path} -y \\
              -ss #{member[0].ss_at_time} -t #{member[0].t_at_time} -i #{member[0].file_path} -ss #{member[1].ss_at_time} -t #{member[1].t_at_time}  -i #{member[1].file_path} \\
              -ss #{member[2].ss_at_time} -t #{member[2].t_at_time} -i #{member[2].file_path}  -f lavfi -i \"color=White\" \\
                -filter_complex \\\"
                nullsrc=size=640x480 [base];
                [0:v] setpts=PTS-STARTPTS, scale=320x240 [upperleft];
                [1:v] setpts=PTS-STARTPTS, scale=320x240 [upperright];
                [2:v] setpts=PTS-STARTPTS, scale=320x240 [lowerleft];
                [3:v] setpts=PTS-STARTPTS, scale=320x240 [lowerright];
                [base][upperleft] overlay=shortest=1 [tmp1];
                [tmp1][upperright] overlay=shortest=1:x=320 [tmp2];
                [tmp2][lowerleft] overlay=shortest=1:y=240 [tmp3];
                [tmp3][lowerright] overlay=shortest=1:y=240:x=320;
                [0:a][1:a][2:a] amerge=inputs=3
              \\\" \\
                -preset ultrafast -r 30 -b:v 300k -c:v libx264 #{\"/tmp/\" + @conference[\"room_name\"] + \"/\" + index.to_s + \".mp4\"}`
  1. jibri\’s solution
    headless chrome + grab the screen with ffmpeg is agressive approach. It is possible, but the scalabilitiy is poor.
    For example, the jibri\’s ffmpeg + chrome process consumes about 300% in my vps server.

Example nginx.conf for rtp => rtmp => hls for scalablity

server_names_hash_bucket_size 64;

server {
    listen 443 ssl;
    server_name temp;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers \"EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED\";

    add_header Strict-Transport-Security \"max-age=31536000\";

    ssl_certificate /usr/local/nginx/server.crt;
    ssl_certificate_key /usr/local/nginx/server.key;

    access_log  /app/log/nginx_access.log  ;
    error_log  /app/log/nginx_error.log  debug;

    location /janus {
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection \"upgrade\";
         proxy_set_header Host $host;
         proxy_redirect off;

         proxy_pass http://127.***0.0.1:8188;
     }

     location /janus_http {
     proxy_pass http://127.*0.**0.1:8078;
     }

    location /janus_admin {
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header Host $host;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection \"upgrade\";
         proxy_set_header Host $host;
         proxy_pass http://127.0.***0.1:7188;
    }

    location /janus_admin_http {
     proxy_pass http://127.***0.0.1:7088;
     }

    location /hls {
         types {
             application/vnd.apple.mpegurl m3u8;
             video/mp2t ts;
         }
         root /tmp;
         add_header Cache-Control no-cache;
     }

}

TODO

  • janus docker image
  • janus performance improvement patch
  • jitsi vide bridge image ( in other repo)
  • example app for transcording
  • demo site for RTMP -> RTP -> WEBRTC
  • demo site for WEBRTC -> RTP -> RTMP
  • client video mixing in janus gateway
  • rtp => HLS with ffmpeg using GPU transcording

Project Contributor

Akinori Nakajima
https://tw*i*tt*er.com/atyenori

Anyone welcomed.

下载源码

通过命令行克隆项目:

git clone https://github.com/atyenoria/janus-webrtc-gateway-docker.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 建站资源 janus webrtc gateway docker https://www.zuozi.net/34857.html

freshplayerplugin
上一篇: freshplayerplugin
swf2js
下一篇: swf2js
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务