Code Monkey home page Code Monkey logo

janus-webrtc-gateway-docker's Introduction

system Build Status CII Best Practices

Caustion!

This repo is not maintained anymore. Use this repository https://github.com/wangsrGit119/janus-webrtc-gateway-docker to raise issues or PRs. Thanks.

How to use

https://www.useloom.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.w3.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.googlesource.com/boringssl/+/chromium-stable
  • libnice v0.1.14 https://github.com/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.docker.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.conf.meetecho.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.freedesktop.org/libnice/libnice/merge_requests/13 ) https://webrtchacks.com/sfu-load-testing/ load-test (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.youtube.com/watch?v=OHHoqKCjJ0E Jitsi last-n + VP8 simulcasting has the very good performance for web conference https://jitsi.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://github.com/meetecho/janus-gateway/blob/8b388aebb0de3ccfad3b25f940f61e48e308e604/plugins/janus_videoroom.c
https://github.com/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://twitter.com/atyenori

Anyone welcomed.

janus-webrtc-gateway-docker's People

Contributors

armpdq avatar atyenoria avatar coderhymeslife avatar ixna avatar kuzm1ch avatar silverark avatar stayer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

janus-webrtc-gateway-docker's Issues

libcurl >= 7.45.0 needed for rtsp

If you can, could you upgrade libcurl to >=7.45 ?

for the janus_streaming.c plugin, I get the following error:
JANUS_LOG(LOG_WARN, "RTSP digest authentication unsupported (needs libcurl >= 7.45.0)\n");

Thank you for the best janus docker.

make build failed

When running make build, the following shows up:

W: Failed to fetch http://ftp.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages 404 Not Found

'Address already in use' issue

Hi there, I'm trying to understand how to use SDP generated by Janus to use by ffmpeg.

Should I just grab SDP as it is from Janus Admin panel or Chrome Dev Tools and put it into a standalone file? Whenever I do so and try to run the ffmpeg provided in the documentation:

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

I get the following error:

[udp @ 0x55ad1d9f6300] bind failed: Address already in use

Should the SDP be edited manually after it's copied from Janus?

Another thing is: I'm getting an error regarding flv - vp8 compatibility when I run the ffpeg command:

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

[flv @ 0x55e2a7cfcc00] Video codec vp8 not compatible with flv

Do you have any idea why I'm getting this? My Janus room is configured to use 'vp8', also my SDP expects VP8.

When I replace -c:v copy with -c:v h264 I'm able to forward the stream:

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

Please advise and thank you for your work!

How I can run his docker app ?

WARNING: Published ports are discarded when using host network mode
root@WebRtcMediaServer:/# exit
exit
alif@WebRtcMediaServer:~/janus-webrtc-gateway-docker$ sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
alif@WebRtcMediaServer:~/janus-webrtc-gateway-docker$ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
alif@WebRtcMediaServer:~/janus-webrtc-gateway-docker$ 

How to change the configs files: janus.plugin.streaming.jcfg?

Hello I trying to change the plugins configs files but I can't.

I do the following:
1- Add this lines in Docker file

COPY conf/janus.plugin.streaming.jcfg /opt/janus/etc/janus/
COPY conf/janus.plugin.streaming.jcfg.sample /opt/janus/etc/janus/

just before this:
CMD nginx && janus

2- Then I create a new image whit: `docker build -t tag-name .``

4- Run the image: @docker run --rm -p 80:80 -p 8088:8088 -p 8188:8188 --name="janus" -it -t tag-name

Into the janus.plugin.streaming.jcfg I uncommented this lines:

h264-sample: {
	type = "rtp"
	id = 10
	description = "H.264 live stream coming from gstreamer"
	audio = false
	video = true
	videoport = 8004
	videopt = 126
	videortpmap = "H264/90000"
	videofmtp = "profile-level-id=42e01f;packetization-mode=1"
}

Then, I expected to have a the https://janus.conf.meetecho.com/streamingtest.html into streams lis from the streamingtest.html. I am running my own instance of streamingtest locally, here the example from janus: https://janus.conf.meetecho.com/streamingtest.html

But the h264-sample isn't there. So, what is wrong? How I be able to change the confs?

Thanks!

Problem creating a Docker container using the provided Docker file

Sir

I tried to create the Janus container using Docker on a Ubuntu 18.0.4 virtual machine running on Virtual Box on a Windows 10 host.

The installation kept on failing at the following command

RUN apt-get remove -y libnice-dev libnice10 &&
echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list &&
apt-get update &&
apt-get install -y gtk-doc-tools libgnutls28-dev -t jessie-backports &&
apt-get install -y libglib2.0-0 -t jessie-backports &&
git clone https://gitlab.freedesktop.org/libnice/libnice.git &&
cd libnice &&
git checkout 67807a17ce983a860804d7732aaf7d2fb56150ba &&
bash autogen.sh &&
./configure --prefix=/usr &&
make &&
make install

The statement succeeded after using the command listed below. The changed portions are marked with bold text

RUN apt-get remove -y libnice-dev libnice10 &&
echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list &&
apt-get -o Acquire::Check-Valid-Until=false update &&
apt-get install -y gtk-doc-tools libgnutls28-dev -t jessie-backports &&
apt-get install -y libglib2.0-0 -t jessie-backports &&
git clone https://gitlab.freedesktop.org/libnice/libnice.git &&
cd libnice &&
git checkout 67807a17ce983a860804d7732aaf7d2fb56150ba &&
bash autogen.sh &&
./configure --prefix=/usr &&
make &&
make install

After that the execution failed at the line

COPY nginx.conf /usr/local/nginx/nginx.conf

I commented the line and the installation completed successfully
Please find attached the updated docker file
Thanks and regards
Mathew
Dockerfiles.zip

how do I reach the sample page?

Something is very broken with janus, every single docker installation on the web shows the following error message when I try to connect with localhost:8088/janus. Am I doing sth wrong?

[ERR] [transports/janus_http.c:janus_http_handler:1316] Invalid session (null)
[ERR] [transports/janus_http.c:janus_http_handler:1225] Invalid url /favicon.ico

Could someone please fix this issue and also add https support.

ERROR: libmp3lame >= 3.98.3 not found

I encountered this problem.
I can't fix this.... even if I tried

RUN cd ~/ffmpeg_sources && \
    wget http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz && \
    tar xzvf lame-3.100.tar.gz && \
    cd lame-3.100 && \
    ./configure --prefix="$HOME/ffmpeg_build" --enable-nasm --disable-shared && \
    make && \
    make install

How exactly COTURN is useful in the same container?

Hey, I hope issues here are OK to use for asking a question.
The matter of TURN-servers is not completely clear to me yet, but from what I already know it seems for me that TURN-servers make sense when they are placed in another network. If a client can connect to the TURN-server deployed in the same container as Janus, why it can't connect directly to Janus then?

wss doesn't work

I have a public server bought it from Digitalocean, I installed docker and running these commands :

  1. git clone https://github.com/atyenoria/janus-webrtc-gateway-docker.git && cd janus-webrtc-gateway-docker
  2. make build
  3. make run

but wss doesn't work, is there any something I missed? do I have to change something in the container? server name or something else? please let me know.

build failed

i tried docker build -t atyenoria/janus-gateway-docker .
and got
...
...
./configure: line 560: 0: Bad file descriptor
The command '/bin/sh -c cd ~/ffmpeg_sources && wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && tar xzvf yasm-1.3.0.tar.gz && cd yasm-1.3.0 && ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && make && make install && make distclean' returned a non-zero code: 1

i'm a beginner with docker so may be i did something wrong ... i tried your build because i had no success with all prebuilt docker images i found on dockerhub , coud not receive the vp8 gstreamer demo stream in web browser ...

Port 80 Conflict

Hi,

Have compiled successfully, but when I run "make run" I get

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
Makefile:13: recipe for target 'run' failed
make: *** [run] Error 1

What do I need to change?

Thanks.

Weird Build Issue

If you try to build with the following

`RUN sed -i 's/archive.ubuntu.com/mirror.aarnet.edu.au/pub/ubuntu/archive/g' /etc/apt/sources.list

RUN rm -rf /var/lib/apt/lists/*`

the http rest api is disabled as libmicrohttpd isn't available. It seems that something is going wrong with the mirror here, however eliminating those two lines still results in a working build.

Connection refused

make run in OSX, but service is unreachable.

like this

➜ ~ telnet localhost 8088
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused
telnet: Unable to connect to remote host

Projects using your solution

Greetings!

Our team is developing a streaming dating service. In the development of the stream, we want to use your solution. I would like to know if this solution is used now for any major projects. And how stable is it? Our load requirements:

  • 360p - 720p
  • no more than 2000 streams with no more than 1000 viewers
  • delay 3-5 sec

Docker Pull from Docker Hub available for this?

Hi,

Thanks for the detailed instructions and nice package.

Is this available to pull from docker?

My steps now:
Download -> Build -> Upload to registry -> Launch Azure Container Instance

If there was a docker pull package (from Docker Hub or another public registry), I could just:
Launch Azure Container Instance

Kind regards,

RTP Forwarding to Wowza

Hey Akinori,

Were you able to get Janus video room rtp forwarding to work directly to Wowza? I noticed you had a line in your diagram showing that.

Best Regards,
Chris

boringssl issue

hello, i have below error when doing make build as below
thanks.

Cloning into 'boringssl'...
HEAD is now at c7db323 Add “bssl::” prefix to |UpRef| and |PushToStack| in fuzzer code.
-- The C compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- The CXX compiler identification is GNU 4.9.2
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Perl: /usr/bin/perl (found version "5.20.2")
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Configuring done
-- Generating done
-- Build files have been written to: /boringssl/build
Scanning dependencies of target boringssl_gtest
[ 1%] Building CXX object CMakeFiles/boringssl_gtest.dir/third_party/googletest/src/gtest-all.cc.o
Linking CXX static library libboringssl_gtest.a
[ 1%] Built target boringssl_gtest
[ 1%] Generating crypto_test_data.cc
/usr/local/go/bin/go: 1: /usr/local/go/bin/go:ELF: not found
/usr/local/go/bin/go: 1: /usr/local/go/bin/go: Syntax error: Unterminated quoted string
CMakeFiles/crypto_test_data.dir/build.make:124: recipe for target 'crypto_test_data.cc' failed
make[2]: *** [crypto_test_data.cc] Error 2
CMakeFiles/Makefile2:128: recipe for target 'CMakeFiles/crypto_test_data.dir/all' failed
make[1]: *** [CMakeFiles/crypto_test_data.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c git clone https://boringssl.googlesource.com/boringssl && cd boringssl && git reset --hard c7db3232c397aa3feb1d474d63a1c4dd674b6349 && sed -i s/" -Werror"//g CMakeLists.txt && mkdir -p build && cd build && cmake -DCMAKE_CXX_FLAGS="-lrt" .. && make && cd .. && sudo mkdir -p /opt/boringssl && sudo cp -R include /opt/boringssl/ && sudo mkdir -p /opt/boringssl/lib && sudo cp build/ssl/libssl.a /opt/boringssl/lib/ && sudo cp build/crypto/libcrypto.a /opt/boringssl/lib/' returned a non-zero code: 2
make: *** [Makefile:4: build] Error 2

build failed - Failed to fetch

I tried docker build and got this:

Sending build context to Docker daemon 31.74kB
Step 1/34 : FROM buildpack-deps:jessie
---> e20c27d31347
Step 2/34 : RUN sed -i 's/archive.ubuntu.com/mirror.aarnet.edu.au/pub/ubuntu/archive/g' /etc/apt/sources.list
---> Using cache
---> d2c2fe6f3932
Step 3/34 : RUN rm -rf /var/lib/apt/lists/*
---> Using cache
---> 6f08c29d6029
Step 4/34 : RUN apt-get -y update && apt-get install -y libmicrohttpd-dev libjansson-dev libnice-dev libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev libopus-dev libogg-dev libini-config-dev libcollection-dev libconfig-dev pkg-config gengetopt libtool automake build-essential subversion git cmake unzip zip lsof wget vim sudo rsync cron mysql-client openssh-server supervisor locate
---> Running in 18c3dd4ebea8
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [7340 B]
Get:3 http://deb.debian.org jessie Release.gpg [2420 B]
Get:4 http://deb.debian.org jessie Release [148 kB]
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [841 kB]
Get:6 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.1 MB in 5s (1721 kB/s)
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.

Additional information
docker version:
Client:
Version: 18.09.5-ce
API version: 1.39
Go version: go1.12.3
Git commit: e8ff056dbc
Built: Fri Apr 12 08:22:13 2019
OS/Arch: linux/amd64
Experimental: false

Server:
Engine:
Version: 18.09.5-ce
API version: 1.39 (minimum version 1.12)
Go version: go1.12.3
Git commit: e8ff056dbc
Built: Fri Apr 12 08:21:24 2019
OS/Arch: linux/amd64
Experimental: false

What exactly is your_host_ip.global?

First of all, I'm running the docker in a Mac. And I've successfully ran it with these commands as suggested:

make build
make run

And the logs show:

Compiled on: Sat Apr 25 05:42:54 UTC 2020

Logger plugins folder: /usr/local/lib/janus/loggers
[WARN] Couldn't access logger plugins folder...

Starting Meetecho Janus (WebRTC Server) v0.9.2

Checking command line arguments...
Debug/log level is 4
Debug/log timestamps are disabled
Debug/log colors are enabled
Adding 'vmnet' to the ICE ignore list...
Using 10.0.2.15 as local IP...
[WARN] Token based authentication disabled
Initializing recorder code
Initializing ICE stuff (Full mode, ICE-TCP candidates disabled, half-trickle, IPv6 support disabled)
TURN REST API backend: (disabled)
[WARN] Janus is deployed on a private address (10.0.2.15) but you didn't specify any STUN server! Expect trouble if this is supposed to work over the internet and not just in a LAN...
Crypto: BoringSSL
[WARN] No cert/key specified, autogenerating some...
Fingerprint of our certificate: 73:2E:6B:F0:53:64:E8:88:FB:39:1E:E9:7E:3B:CD:18:7D:02:01:F5:C5:DA:06:17:A3:D9:5D:CE:56:74:CB:AC
[WARN] Event handlers support disabled
Plugins folder: /usr/local/lib/janus/plugins
Loading plugin 'libjanus_textroom.so'...
Sessions watchdog started
Joining Janus requests handler thread
JANUS TextRoom plugin initialized!
Loading plugin 'libjanus_audiobridge.so'...
JANUS AudioBridge plugin initialized!
Loading plugin 'libjanus_streaming.so'...
JANUS Streaming plugin initialized!
Loading plugin 'libjanus_recordplay.so'...
JANUS Record&Play plugin initialized!
Loading plugin 'libjanus_sip.so'...
JANUS SIP plugin initialized!
Loading plugin 'libjanus_voicemail.so'...
JANUS VoiceMail plugin initialized!
Loading plugin 'libjanus_videocall.so'...
JANUS VideoCall plugin initialized!
Loading plugin 'libjanus_echotest.so'...
JANUS EchoTest plugin initialized!
Loading plugin 'libjanus_nosip.so'...
JANUS NoSIP plugin initialized!
Loading plugin 'libjanus_videoroom.so'...
JANUS VideoRoom plugin initialized!
Transport plugins folder: /usr/local/lib/janus/transports
Loading transport plugin 'libjanus_websockets.so'...
libwebsockets logging: 0
WebSockets server started (port 8188)...
[WARN] Secure WebSockets server disabled
[WARN] Admin WebSockets server disabled
[WARN] Secure Admin WebSockets server disabled
JANUS WebSockets transport plugin initialized!
WebSockets thread started

So I believe everything ran perfectly, am I not right?

The only problem is, I don't know what to do next. I'm trying to visit the website of the samples hosted in the docker, but I'm lost.

What exactly is your_host_ip.global?

My virtual docker machine IP is the following (Got this from ifconfig)

vboxnet0: <UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255

How would I connect to this "your_host_ip.global" address from my main laptop?

How to run this?

Sorry if this is a stupid question, but how do I run this?

I have cloned the repo, and ran
docker build --no-cache -t atyenoria/janus-gateway-docker .
This worked. (It took a long time)

Next I try to follow the instructions and run these commands:

docker run --rm --net=host --name="janus" -it -t atyenoria/janus-gateway-docker /bin/bash
docker exec -it /bin/bash janus

But doesn't that 2nd command do the exact same thing as the first?

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

And here it does not find /bin/ffmpeg?
What should IP be? The ip address of the server this is running on?

Package requirements (glib-2.0 >= 2.48 gio-2.0 >= 2.48 gobject-2.0 >= 2.48 gthread-2.0) were not met configure error

I am running on Macosx Mojave with Docker.app 2.0.0.3 ( engine 18.09.2 ) I've got the following dependencies mismatch errors:

configure: error: Package requirements (glib-2.0 >= 2.48 gio-2.0 >= 2.48 gobject-2.0 >= 2.48 gthread-2.0) were not met:

Requested 'glib-2.0 >= 2.48' but version of GLib is 2.42.1
Requested 'gio-2.0 >= 2.48' but version of GIO is 2.42.1
Requested 'gobject-2.0 >= 2.48' but version of GObject is 2.42.1

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GLIB_CFLAGS
and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
The command '/bin/sh -c apt-get remove -y libnice-dev libnice10 &&     echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list &&     apt-get update &&     apt-get install -y gtk-doc-tools libgnutls28-dev -t jessie-backports  &&     apt-get install -y libglib2.0-0 -t jessie-backports &&     git clone https://gitlab.freedesktop.org/libnice/libnice.git &&     cd libnice &&     git checkout 67807a17ce983a860804d7732aaf7d2fb56150ba &&     bash autogen.sh &&     ./configure --prefix=/usr &&     make &&     make install' returned a non-zero code: 1
make: *** [build] Error 1

Any ideas?

Recorded files on AWS S3?

Hi,

Storing recorded videos on AWS S3 and streaming those recordings with nginx-rtmp-module?

Basically, in our videoroom, each user can record his WebRTC session and a recording file (mp4?) should get generated and should be stored on S3. Other users should able to see this recording and should be able to play it with (nginx-rtmp-module streaming support)

Is this functionality possible (maybe by little customization) with this docker container?

Please let me know.

Thanks,
Anil

Build fails postprocessing/janus_pp_rec-pp-h264.o

Makefile:2007: recipe for target 'postprocessing/janus_pp_rec-pp-h264.o' failed
make[2]: *** [postprocessing/janus_pp_rec-pp-h264.o] Error 1

This is on a new amazon linux running Docker version 17.03.2-ce

I also would love a pre-built docker file posted to hub.docker.com

Automatically inject nginx conf file

Thanks for this fantastic repo.
I am using it as my dev box for a project so I changed some configuration around for my purpose and I am automatically injecting the nginx.conf file you provided in the repo as:

RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/local/nginx/server.key -out /usr/local/nginx/server.crt \
    -subj "/C=IT/ST=Milan/L=Milan/O=Giorgio/OU=GiorgioDev/CN=example.com"

COPY nginx.conf /usr/local/nginx/host.conf

RUN sed -i.bak '/[[:space:]].#gzip/ a include host.conf;' /usr/local/nginx/nginx.conf

I am not familiar with boringssl so I used openssl, but I thought you might find this usefull as well.
I did not submit a PR from my fork because I changed the ./configure parameters and the nginx conf file to match my needs.

Janus Rest Api is disabled

The janus rest api requires libmicrohttpd at least version 0.9.59 to work but the base image stretch is using 0.9.51-1. Because of this the rest api is disabled and the janus.transport.http.jcfg is not copied to the /usr/local/etc/janus/ during installation.

Can not make build on Macosx Mojave and Docker 2.0.0.3

I tried ( both sudo and non sudo ) to build the on my mac I've got back this error:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I am using Docker desktop 2.0.0.3.
Any idea?

Scalable server on AWS

Thanks for this amazing repo,

I have a question that is this docker image will be able to use as a scalable server on AWS When I have got traffic?

Thank u :)

Plugin Demo: Recorder/Playout example error

Hi!
When you are starting "record" from camera, there is a error in Janus log:
Target recording path <PATH> is in protected folder

In this PR new properties to Janus was added: protected_folders . For now, directory /usr is blocked for recording streams.

Solutions:

  1. Remove this path from janus.jcfg
  2. Change folder for recordings

Make Build Connection Timeout

I ran make build and I get this error:

`
INSTALL libavutil/twofish.h
INSTALL libavutil/version.h
INSTALL libavutil/xtea.h
INSTALL libavutil/tea.h
INSTALL libavutil/lzo.h
INSTALL libavutil/avconfig.h
INSTALL libavutil/ffversion.h
INSTALL libavutil/libavutil.pc
Removing intermediate container 4f3d9034af2f
---> 15fe522a64e7
Step 15/33 : RUN ZLIB="zlib-1.2.11" && vNGRTMP="v1.1.11" && PCRE="8.41" && nginx_build=/root/nginx && mkdir $nginx_build && cd $nginx_build && wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$PCRE.tar.gz && tar -zxf pcre-$PCRE.tar.gz && cd pcre-$PCRE && ./configure && make && make install && cd $nginx_build && wget http://zlib.net/$ZLIB.tar.gz && tar -zxf $ZLIB.tar.gz && cd $ZLIB && ./configure && make && make install && cd $nginx_build && wget https://github.com/arut/nginx-rtmp-module/archive/$vNGRTMP.tar.gz && tar zxf $vNGRTMP.tar.gz && mv nginx-rtmp-module-* nginx-rtmp-module
---> Running in 7e08772a0de5
converted 'ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz' (ANSI_X3.4-1968) -> 'ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz' (UTF-8)
--2019-10-03 19:57:04-- ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
=> 'pcre-8.41.tar.gz'
Resolving ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)... 131.111.8.115
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... failed: Connection timed out.
Retrying.

--2019-10-03 19:59:15-- ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
(try: 2) => 'pcre-8.41.tar.gz'
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... failed: Connection timed out.
Retrying.

--2019-10-03 20:01:27-- ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
(try: 3) => 'pcre-8.41.tar.gz'
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... failed: Connection timed out.

`

nginx rtmp download issue

Hi there, just thought you might want to know about this.

When I run make build everything goes fine until nginx-rtmp is downloaded from ftp.csx.cam.ac.uk. For some reason this ftp server is down and stops the build process

The stack trace is below. Maybe you can implement a fallback system with different ftp servers for this. I can also do it if you don't mind having me contribute some code.

Removing intermediate container f44876e2d9c4

---> 054890fa49ec
Step 15/33 : RUN ZLIB="zlib-1.2.11" && vNGRTMP="v1.1.11" && PCRE="8.41" && nginx_build=/root/nginx && mkdir $nginx_build &&     cd $nginx_build &&     wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$PCRE.tar.gz &&     tar -zxf pcre-$PCRE.tar.gz &&     cd pcre-$PCRE &&     ./configure && make && make install &&     cd $nginx_build &&     wget http://zlib.net/$ZLIB.tar.gz &&     tar -zxf $ZLIB.tar.gz &&     cd $ZLIB &&     ./configure && make &&  make install &&     cd $nginx_build &&     wget https://github.com/arut/nginx-rtmp-module/archive/$vNGRTMP.tar.gz &&     tar zxf $vNGRTMP.tar.gz && mv nginx-rtmp-module-* nginx-rtmp-module
---> Running in 3716f661a76e
converted 'ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz' (ANSI_X3.4-1968) -> 'ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz' (UTF-8)
--2019-08-28 09:52:23--  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
          => 'pcre-8.41.tar.gz'
Resolving ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)... 131.111.8.115
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... failed: Connection timed out.
Retrying.

--2019-08-28 09:54:34--  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
 (try: 2) => 'pcre-8.41.tar.gz'
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... failed: Connection timed out.
Retrying.

--2019-08-28 09:56:46--  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
 (try: 3) => 'pcre-8.41.tar.gz'
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... failed: Connection timed out.
Retrying.

--2019-08-28 09:59:01--  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
 (try: 4) => 'pcre-8.41.tar.gz'
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... failed: Connection timed out.
Retrying.

--2019-08-28 10:01:15--  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz
 (try: 5) => 'pcre-8.41.tar.gz'
Connecting to ftp.csx.cam.ac.uk (ftp.csx.cam.ac.uk)|131.111.8.115|:21... `

How to play on web

I have a nginx-rtmp server for streaming local video files and I can view on my android by app supports rtmp protocol. Now, I want to view those video files on web (by chrome or firefox...), so I found janus-webrtc-gateway. I had configured nginx.conf as you recommend, but I dont how to select and view those video file on web. Please help me, thank you.

Please contact us after restart.

The server was restarted after running make run. If you run make run again after that, it will not work. How do I restart the web server?

One way broadcast webrtc to rtmp

Hello,

First of all, sorry about this noob question, but i'm very beginner in webrtc streaming..

I want to forward webrtc stream to rtmp (I've used nginx rtmp to stream before and know a little about how to configure it). I've tried the janus server and succeeded in running the video room test demo. What i don't understand is, how to do next from this? On readme you wrote about :

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

But i don't know what to do with that configuration... and where should I learn about making SDP file?

Hope you can help me,

Thank you..

webRTC client -> RTP_FORWARD -> Janus -> FFMPEG -> Facebook RTMP

Dear bro,

I tried build and use some code in your repository. My goal want to stream my mobile to facebook rtmp.

my rtp forward:
"request": "rtp_forward", publisher_id: myid, room: room_dynamic_id, "audio_port": 10033, "audiopt": 111, "video_port": 10038, "videopt": 100, "host": "xxx.xxx.xxx.xxx", "secret": "adminpwd"

everything is fine.

next step, i save my sdp file to janus.sdp like :
v=0 o=- 0 0 IN IP4 127.0.0.1 s=RTP Video c=IN IP4 127.0.0.1 t=0 0 a=tool:libavformat 56.15.102 m=audio 10033 RTP/AVP 111 a=rtpmap:111 OPUS/48000/2 m=video 10038 RTP/AVP 100 a=rtpmap:100 VP8/90000 a=fmtp:100 packetization-mode=1

but when i stream to facebook rtmp, i can not see anything:

/root/bin/ffmpeg -analyzeduration 300M -probesize 300M -i janus.sdp -c:v copy -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/1550595998293270?ds=1&s_l=1&a=ATjqEJKy6ocBD-IF"

pls help me my problem if you free.

thanks!

"No package 'libconfig' found" error on build

When running the "docker build" cmd as defined in the Setup section, the following error appears at step 31/31:

checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for JANUS... no
configure: error: Package requirements (
glib-2.0 >= 2.34
libconfig
nice
jansson >= 2.5
libssl >= 1.0.1
libcrypto
) were not met:

No package 'libconfig' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables JANUS_CFLAGS
and JANUS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
The command '/bin/sh -c cd /janus-gateway && sh autogen.sh && git checkout origin/master && git reset --hard 3ff54ec && PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --enable-post-processing --enable-boringssl --disable-data-channels --disable-rabbitmq --disable-mqtt --disable-plugin-echotest --disable-unix-sockets --enable-dtls-settimeout --disable-plugin-recordplay --disable-plugin-sip --disable-plugin-videocall --disable-plugin-voicemail --disable-plugin-textroom --disable-plugin-audiobridge --disable-plugin-nosip --disable-all-handlers && make && make install && make configs' returned a non-zero code: 1

Thank you!

is the sourceforge server is down ?

I use dockerfile well until 3 days ago
but I have connection error from yesterday to now.

converted 'http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz' (ANSI_X3.4-1968) -> 'http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz' (UTF-8)
--2019-05-02 08:51:22-- http://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.105.38.13
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.105.38.13|:80...

failed: Connection refused.

Unable to compile FFMPEG

With a new build ffmpeg build fails:

Found no assembler
Minimum version is nasm-2.13
If you really want to compile without asm, configure with --disable-asm.

Is it possible to build the image with cgroup2?

Hi, I am trying to build the image on Fedora 31, which now is using cgroup2 by default.
Docker apparently doesn't support cgroup2 yet, but Podman (rootless docker) does.
However, when I run the build process using podman, it fails on the step 42.
acer-fedora-20200427-014948-473359882

Is it possible to adjust the Dockerfile to be able to build with Podman and cgroup2?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.