{"id":13526221,"url":"https://github.com/atyenoria/janus-webrtc-gateway-docker","last_synced_at":"2025-10-02T15:30:30.796Z","repository":{"id":45703570,"uuid":"62506147","full_name":"atyenoria/janus-webrtc-gateway-docker","owner":"atyenoria","description":"Perfect Docker Image for Media Streaming Expert User ( https://github.com/meetecho/janus-gateway )","archived":true,"fork":false,"pushed_at":"2023-01-09T05:06:30.000Z","size":12896,"stargazers_count":687,"open_issues_count":0,"forks_count":199,"subscribers_count":48,"default_branch":"master","last_synced_at":"2024-09-25T01:33:29.935Z","etag":null,"topics":["boringssl","dash","docker","docker-image","ffmpeg","flash","hls","janus","janus-gateway","janus-webrtc-gateway","libwebsockets","lua","media-player","media-server","nginx","nginx-rtmp","openresty","rtmp","rtsp-server","webrtc"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atyenoria.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-03T16:49:26.000Z","updated_at":"2024-09-11T15:52:16.000Z","dependencies_parsed_at":"2023-02-08T08:45:15.736Z","dependency_job_id":null,"html_url":"https://github.com/atyenoria/janus-webrtc-gateway-docker","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atyenoria%2Fjanus-webrtc-gateway-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atyenoria%2Fjanus-webrtc-gateway-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atyenoria%2Fjanus-webrtc-gateway-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atyenoria%2Fjanus-webrtc-gateway-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atyenoria","download_url":"https://codeload.github.com/atyenoria/janus-webrtc-gateway-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875832,"owners_count":16554706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boringssl","dash","docker","docker-image","ffmpeg","flash","hls","janus","janus-gateway","janus-webrtc-gateway","libwebsockets","lua","media-player","media-server","nginx","nginx-rtmp","openresty","rtmp","rtsp-server","webrtc"],"created_at":"2024-08-01T06:01:26.567Z","updated_at":"2025-10-02T15:30:30.338Z","avatar_url":"https://github.com/atyenoria.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"\n\n![system](https://github.com/atyenoria/janus-webrtc-gateway-docker/blob/master/system.png \"system\")\n[![Build Status](https://travis-ci.org/atyenoria/janus-webrtc-gateway-docker.svg?branch=master)](https://travis-ci.org/atyenoria/janus-webrtc-gateway-docker)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1939/badge)](https://bestpractices.coreinfrastructure.org/projects/1939)\n# Caustion!\nThis repo is not maintained anymore. Use this repository https://github.com/wangsrGit119/janus-webrtc-gateway-docker to raise issues or PRs. Thanks.\n\n\n# How to use\n\nhttps://www.useloom.com/share/325799006d6f4b64a6ce0662ca3f1d57\n\n```\n1. git clone https://github.com/atyenoria/janus-webrtc-gateway-docker.git \u0026\u0026 cd janus-webrtc-gateway-docker\n2. make build\n3. make run\n4. star this repository after succeeding. Create the issue if you failed. We will help you as much as possible\n```\n- open in Safari (http can't work in Chrome and Firefox)\n- use the host having global ip \n\n# Dockerfile Characteristics\n- libwebsocket v3.1.0, build with LWS_MAX_SMP=1, ipv6=true for single thread processing\n- libsrtp v2.2.0\n- ffmpeg 4.2.1 with vpx, libx264, alsa(for headless chrome screen caputreing)\n- gstreamer installation from gstreamer1.0-tools. (WIP for meson ninja build)\n- coturn v4.5.0.8 in order to test turn, use iceTransportPolicy=relay https://www.w3.org/TR/webrtc/#rtcicetransportpolicy-enum \n- openresty 1.13.6.2\n- nvm + node.js v12.18.3 (Latest LTS: Erbium)\n- certbot for let's encyrpt ssl setting\n- boringssl stable https://boringssl.googlesource.com/boringssl/+/chromium-stable \n- libnice v0.1.14 https://github.com/libnice/libnice/releases/tag/0.1.14 \n- golang 1.7.5 for building boringssl\n- janus v0.10.9, enable all janus plugins(like videoroom, streaming, audiobridge...etc\n- [optional] GDB, Address Sanitizer(optional, see Dockerfile) for getting more info when crashing\n- nginx-rtmp-module and ffmpeg compile for MCU functionalilty experiment. For example, WEBRTC-HLS, DASH, RTMP...etc\n- use --net=host for network performance. If you use docker network, some overhead might appear (ref. https://hub.docker.com/_/consul/)\n\n\n\n\n # Introduction\nThis 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.conf.meetecho.com/index.html carefully. \n\n\n# Janus WebRTC Gateway Performance \nWith the latest libnice, janus gateway seems to be great performance. This repo contains this patch(see https://gitlab.freedesktop.org/libnice/libnice/merge_requests/13 )\nhttps://webrtchacks.com/sfu-load-testing/ \n![load-test](https://github.com/atyenoria/janus-webrtc-gateway-docker/blob/master/load-test.png \"load-test\")\n(right side janus graph is available for this docker image )\n\n# [wip]Janus WebRTC Gateway vs Jitsi Video Bridge(Personal Opinion)\nI think that janus is better for webinar(web seminar), and jitsi is better for web conference system. \nThe 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.youtube.com/watch?v=OHHoqKCjJ0E \nJitsi last-n + VP8 simulcasting has the very good performance for web conference https://jitsi.org/wp-content/uploads/2016/12/nossdav2015lastn.pdf \nFor the video format, janus recording is per video streaming, jitsi is for mixed video conference by using chrome headlesss + ffmpeg(alsa, libxcb).\nFrom these points, janus is suitable for webinar, jitsi is for web conference.\nOf course, both WebRTC SFU are amazing work!! I'm using both.\n\n# [wip]Network benchmarking for preparing WebRTC SFU development\nuse iperf, netperf\n\n# Janus ./configure\n\n```\nlibsrtp version:           2.x\nSSL/crypto library:        BoringSSL\nDTLS set-timeout:          yes\nMutex implementation:      GMutex (native futex on Linux)\nDataChannels support:      yes\nRecordings post-processor: yes\nTURN REST API client:      yes\nDoxygen documentation:     no\nTransports:\n    REST (HTTP/HTTPS):     yes\n    WebSockets:            yes\n    RabbitMQ:              no\n    MQTT:                  no\n    Unix Sockets:          no\n    Nanomsg:               no\nPlugins:\n    Echo Test:             yes\n    Streaming:             yes\n    Video Call:            yes\n    SIP Gateway (Sofia):   yes\n    SIP Gateway (libre):   no\n    NoSIP (RTP Bridge):    yes\n    Audio Bridge:          yes\n    Video Room:            yes\n    Voice Mail:            yes\n    Record\u0026Play:           yes\n    Text Room:             yes\n    Lua Interpreter:       no\n    Duktape Interpreter:   no\nEvent handlers:\n    Sample event handler:  no\n    RabbitMQ event handler:no\n    MQTT event handler:    no\nJavaScript modules:        no\n```\n\n\n# RTMP -\u003e RTP -\u003e WEBRTC\n```\nIP=0.0.0.0\nPORT=8888\n/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\n```\nyou should use janus streaming plugin \u003cbr\u003e\nhttps://github.com/meetecho/janus-gateway/blob/8b388aebb0de3ccfad3b25f940f61e48e308e604/plugins/janus_streaming.c\n\n# WEBRTC -\u003e RTP -\u003e RTMP\n```\nIP=0.0.0.0\nPORT=8888\nSDP_FILE=sdp.file\n/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\n```\nIn order to get the keyframe much easier, it is useful to set  fir_freq=1 in janus conf\u003cbr\u003e\nyou should use janus video room or audiobridge plugin \u003cbr\u003e\nhttps://github.com/meetecho/janus-gateway/blob/8b388aebb0de3ccfad3b25f940f61e48e308e604/plugins/janus_videoroom.c \u003cbr\u003e\nhttps://github.com/meetecho/janus-gateway/blob/8b388aebb0de3ccfad3b25f940f61e48e308e604/plugins/janus_audiobridge.c \u003cbr\u003e\nAfter publishing your feed in your room, you should use rtp-forward. The sample javascript command is\n```\n# Input this in Google Chrome debug console. you must change publisher_id, room, video_port, host, secret for your conf.\nvar register = { \"request\" : \"rtp_forward\", \"publisher_id\": 3881836128186438, \"room\" : 1234, \"video_port\": 8050, \"host\" : \"your ip address\", \"secret\" : \"unko\" }\nsfutest.send({\"message\": register});\n```\n\n\n# [wip] Mixing for janus recording\n1. ffmpeg mixing from the janus recording outputs files\nI 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.\n```\n`#{ffmpeg_path} -y \\\n              -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} \\\n              -ss #{member[2].ss_at_time} -t #{member[2].t_at_time} -i #{member[2].file_path}  -f lavfi -i \"color=White\" \\\n                -filter_complex \\\"\n                nullsrc=size=640x480 [base];\n                [0:v] setpts=PTS-STARTPTS, scale=320x240 [upperleft];\n                [1:v] setpts=PTS-STARTPTS, scale=320x240 [upperright];\n                [2:v] setpts=PTS-STARTPTS, scale=320x240 [lowerleft];\n                [3:v] setpts=PTS-STARTPTS, scale=320x240 [lowerright];\n                [base][upperleft] overlay=shortest=1 [tmp1];\n                [tmp1][upperright] overlay=shortest=1:x=320 [tmp2];\n                [tmp2][lowerleft] overlay=shortest=1:y=240 [tmp3];\n                [tmp3][lowerright] overlay=shortest=1:y=240:x=320;\n                [0:a][1:a][2:a] amerge=inputs=3\n              \\\" \\\n                -preset ultrafast -r 30 -b:v 300k -c:v libx264 #{\"/tmp/\" + @conference[\"room_name\"] + \"/\" + index.to_s + \".mp4\"}`\n```\n2. jibri's solution \nheadless chrome  + grab the screen with ffmpeg is agressive approach. It is possible, but the scalabilitiy is poor. \nFor example, the jibri's ffmpeg + chrome process consumes about 300% in my vps server.\n\n# Example nginx.conf for rtp =\u003e rtmp =\u003e hls for scalablity \n```\nserver_names_hash_bucket_size 64;\n\nserver {\n    listen 443 ssl;\n    server_name temp;\n\n    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\n    ssl_prefer_server_ciphers on;\n    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\";\n\n    add_header Strict-Transport-Security \"max-age=31536000\";\n\n    ssl_certificate /usr/local/nginx/server.crt;\n    ssl_certificate_key /usr/local/nginx/server.key;\n\n    access_log  /app/log/nginx_access.log  ;\n    error_log  /app/log/nginx_error.log  debug;\n\n    location /janus {\n         proxy_set_header X-Real-IP $remote_addr;\n         proxy_set_header Host $host;\n         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n         proxy_set_header X-Forwarded-Proto $scheme;\n         proxy_http_version 1.1;\n         proxy_set_header Upgrade $http_upgrade;\n         proxy_set_header Connection \"upgrade\";\n         proxy_set_header Host $host;\n         proxy_redirect off;\n\n         proxy_pass http://127.0.0.1:8188;\n     }\n\n     location /janus_http {\n     proxy_pass http://127.0.0.1:8078;\n     }\n\n    location /janus_admin {\n         proxy_set_header X-Real-IP $remote_addr;\n         proxy_set_header Host $host;\n         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n         proxy_http_version 1.1;\n         proxy_set_header Upgrade $http_upgrade;\n         proxy_set_header Connection \"upgrade\";\n         proxy_set_header Host $host;\n         proxy_pass http://127.0.0.1:7188;\n    }\n\n    location /janus_admin_http {\n     proxy_pass http://127.0.0.1:7088;\n     }\n\n    location /hls {\n         types {\n             application/vnd.apple.mpegurl m3u8;\n             video/mp2t ts;\n         }\n         root /tmp;\n         add_header Cache-Control no-cache;\n     }\n\n}\n\n```\n\n\n\n# TODO\n- [x] janus docker image\n- [x] janus performance improvement patch\n- [ ] jitsi vide bridge image ( in other repo)\n- [ ] example app for transcording \n- [ ] demo site for RTMP -\u003e RTP -\u003e WEBRTC\n- [ ] demo site for WEBRTC -\u003e RTP -\u003e RTMP\n- [ ] client video mixing in janus gateway\n- [ ] rtp =\u003e HLS with ffmpeg using GPU transcording \n\n\n\n# Project Contributor  \nAkinori Nakajima\nhttps://twitter.com/atyenori \n\nAnyone welcomed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatyenoria%2Fjanus-webrtc-gateway-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatyenoria%2Fjanus-webrtc-gateway-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatyenoria%2Fjanus-webrtc-gateway-docker/lists"}