Coder Social home page Coder Social logo

mpromonet / webrtc-streamer Goto Github PK

View Code? Open in Web Editor NEW
2.7K 119.0 573.0 6.26 MB

WebRTC streamer for V4L2 capture devices, RTSP sources and Screen Capture

Home Page: https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/?layout=2x2

License: The Unlicense

C++ 91.31% JavaScript 1.11% Dockerfile 0.72% CMake 6.82% Procfile 0.04%
webrtc streamer rtsp c-plus-plus v4l2 webrtc-streamer whep rtmp

webrtc-streamer's Introduction

WebRTC-Streamer

A picture of a Nano PI NEO Air

CircleCI CirusCI Snap Status

GithubCI GithubCI GithubCI

Release Download Docker Pulls

Demo Gitpod ready-to-code

Experimentation to stream WebRTC media sources like capture devices, screen capture, mkv files and RMTP/RTSP sources using simple signaling mechanism (see api).

Artefacts

Usage

./webrtc-streamer [-H http port] [-S[embeded stun address]] -[v[v]]  [urls...]
./webrtc-streamer [-H http port] [-s[external stun address]] -[v[v]] [urls...]
./webrtc-streamer -V
	-v[v[v]]           : verbosity
	-V                 : print version
	-C config.json                     : load urls from JSON config file 
	-n name -u videourl -U audiourl    : register a name for a video url and an audio url
	[url]                              : url to register in the source list

	-H [hostname:]port : HTTP server binding (default 0.0.0.0:8000)
	-w webroot         : path to get files
	-c sslkeycert      : path to private key and certificate for HTTPS
	-N nbthreads       : number of threads for HTTP server
	-A passwd          : password file for HTTP server access
	-D authDomain      : authentication domain for HTTP server access (default:mydomain.com)

	-S[stun_address]                   : start embeded STUN server bind to address (default 0.0.0.0:3478)
	-s[stun_address]                   : use an external STUN server (default:stun.l.google.com:19302 , -:means no STUN)
	-T[username:password@]turn_address : start embeded TURN server (default:disabled)
	-t[username:password@]turn_address : use an external TURN relay server (default:disabled)
	-R [Udp port range min:max]        : Set the webrtc udp port range (default 0:65535)
	-W webrtc_trials_fields            : Set the webrtc trials fields (default:WebRTC-FrameDropper/Disabled/)		
	-a[audio layer]                    : spefify audio capture layer to use (default:0)		
	-q[filter]                         : spefify publish filter (default:.*)
	-o                                 : use null codec (keep frame encoded)

Arguments of '-H' are forwarded to option listening_ports of civetweb, allowing use of the civetweb syntax like -H8000,9000 or -H8080r,8443s.

Using -o allows storing compressed frame data from the backend stream using webrtc::VideoFrameBuffer::Type::kNative. This hacks the stucture webrtc::VideoFrameBuffer storing data in a override of the i420 buffer. This allows forwarding H264 frames from V4L2 device or RTSP stream to WebRTC stream. It uses less CPU, but has less features (resize, codec, and bandwidth are disabled).

Options for the WebRTC stream name:

  • an alias defined using -n argument then the corresponding -u argument will be used to create the capturer
  • an "rtsp://" url that will be opened using an RTSP capturer based on live555
  • an "file://" url that will be opened using an MKV capturer based on live555
  • an "rmtp://" url that will be opened using an RMTP capturer based on librmtp
  • an "screen://" url that will be opened by webrtc::DesktopCapturer::CreateScreenCapturer
  • an "window://" url that will be opened by webrtc::DesktopCapturer::CreateWindowCapturer
  • an "v4l2://" url that will capture H264 frames and store it using webrtc::VideoFrameBuffer::Type::kNative type (not supported on Windows)
  • an "videocap://" url video capture device name
  • an "audiocap://" url audio capture device name

Examples

./webrtc-streamer -C config.json

Screenshot

Live Demo

We can access to the WebRTC stream using webrtcstreamer.html. For instance:

An example displaying grid of WebRTC Streams is available using option layout=<lines>x<columns> Screenshot

Live Demo

Using docker image

You can start the application using the docker image:

docker run -p 8000:8000 -it mpromonet/webrtc-streamer

You can expose V4L2 devices from your host using:

docker run --device=/dev/video0 -p 8000:8000 -it mpromonet/webrtc-streamer

The container entry point is the webrtc-streamer application, then you can:

  • view all commands

    docker run -p 8000:8000 -it mpromonet/webrtc-streamer --help
  • run the container registering a RTSP url:

    docker run -p 8000:8000 -it mpromonet/webrtc-streamer -n raspicam -u rtsp://pi2.local:8554/unicast
  • run the container giving config.json file:

    docker run -p 8000:8000 -v $PWD/config.json:/app/config.json mpromonet/webrtc-streamer

Using embedded STUN/TURN server behind a NAT

It is possible to start an embeded STUN and TURN server and publish its URL:

./webrtc-streamer -S0.0.0.0:3478 -s$(curl -s ifconfig.me):3478
./webrtc-streamer -s- -T0.0.0.0:3478 -tturn:turn@$(curl -s ifconfig.me):3478
./webrtc-streamer -S0.0.0.0:3478 -s$(curl -s ifconfig.me):3478 -T0.0.0.0:3479 -tturn:turn@$(curl -s ifconfig.me):3479

The command curl -s ifconfig.me is getting the public IP, it could also given as a static parameter.

In order to configure the NAT rules using the upnp feature of the router, it is possible to use upnpc like this:

upnpc -r 8000 tcp 3478 tcp 3478 udp

Adapting with the HTTP port, STUN port, TURN port.

HTML Embedding

Instead of using the internal HTTP server, it is easy to display a WebRTC stream in a HTML page served by another HTTP server. The URL of the WebRTC-streamer to use should be given creating the WebRtcStreamer instance:

var webRtcServer = new WebRtcStreamer(<video tag>, <webrtc-streamer url>);

A short sample HTML page using webrtc-streamer running locally on port 8000:

<html>
<head>
<script src="libs/adapter.min.js" ></script>
<script src="webrtcstreamer.js" ></script>
<script>        
	var webRtcServer      = null;
	window.onload         = function() { 
		webRtcServer      = new WebRtcStreamer("video",location.protocol+"//"+location.hostname+":8000");
		webRtcServer.connect("rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov");
	}
	window.onbeforeunload = function() { webRtcServer.disconnect(); }
</script>
</head>
<body> 
	<video id="video" />
</body>
</html>

Using WebComponents

WebRTC-streamer provides its own Web Components as an alternative way to display a WebRTC stream in an HTML page. For example:

<html>
<head>
	<script type="module" src="webrtc-streamer-element.js"></script>
</head>
<body>
	<webrtc-streamer url="rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"></webrtc-streamer>
</body>
</html>

Live Demo

Using the webcomponent with a stream selector:

Screenshot

Live Demo

Using the webcomponent over google map:

Screenshot

Live Demo

Using WHEP

It allow to stream using draft standard WHEP

WebRTC player can display WebRTC stream from webrtc-streamer.

Live Demo

Object detection using tensorflow.js

Screenshot

Live Demo

Connect to Janus Gateway Video Room

A simple way to publish WebRTC stream to a Janus Gateway Video Room is to use the JanusVideoRoom interface

var janus = new JanusVideoRoom(<janus url>, <webrtc-streamer url>)

A short sample to publish WebRTC streams to Janus Video Room could be:

<html>
<head>
<script src="janusvideoroom.js" ></script>
<script>        
	var janus = new JanusVideoRoom("https://janus.conf.meetecho.com/janus", null);
	janus.join(1234, "rtsp://pi2.local:8554/unicast","pi2");
	janus.join(1234, "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov","media");	    
</script>
</head>
</html>

Screenshot

Live Demo

This way the communication between Janus API and WebRTC Streamer API is implemented in Javascript running in browser.

The same logic could be implemented in NodeJS using the same JS API:

global.request = require("then-request");
var JanusVideoRoom = require("./html/janusvideoroom.js");
var janus = new JanusVideoRoom(
  "http://192.168.0.15:8088/janus",
  "http://192.168.0.15:8000",
);
janus.join(1234, "videocap://0", "video");

Connect to Jitsi

A simple way to publish WebRTC stream to a Jitsi Video Room is to use the XMPPVideoRoom interface

var xmpp = new XMPPVideoRoom(<xmpp server url>, <webrtc-streamer url>)

A short sample to publish WebRTC streams to a Jitsi Video Room could be:

<html>
<head>
<script src="libs/strophe.min.js" ></script>
<script src="libs/strophe.muc.min.js" ></script>
<script src="libs/strophe.disco.min.js" ></script>
<script src="libs/strophe.jingle.sdp.js"></script>
<script src="libs/jquery-3.5.1.min.js"></script>
<script src="xmppvideoroom.js" ></script>
<script>        
	var xmpp = new XMPPVideoRoom("meet.jit.si", null);
	xmpp.join("testroom", "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov","Bunny");	    
</script>
</head>
</html>

Live Demo

Build

Dependencies

This package depends on the following packages:

The following steps are required to build the project, and will install the dependencies above:

  1. Install the Chromium depot tools

    pushd ..
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    export PATH=$PATH:`realpath depot_tools`
    popd
  2. Download WebRTC

    mkdir ../webrtc
    pushd ../webrtc
    fetch --no-history webrtc 
    popd
  3. Build WebRTC Streamer

    cmake . && make

It is possible to specify cmake parameters WEBRTCROOT & WEBRTCDESKTOPCAPTURE:

  • $WEBRTCROOT/src should contains source (default is $(pwd)/../webrtc)
  • WEBRTCDESKTOPCAPTURE enabling desktop capture if available (default is ON)

Pipelines

There is pipelines on CircleCI, CirrusCI, or GitHub CI, for the following architectures:

  • x86_64 on Ubuntu
  • armv7 crosscompiled (this build is running on Raspberry Pi2 and NanoPi NEO)
  • armv6+vfp crosscompiled (this build is running on Raspberry PiB and should run on a Raspberry Zero)
  • arm64 crosscompiled
  • Windows x64 build with clang
  • MacOS

webrtc-streamer's People

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  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

webrtc-streamer's Issues

Too many open files (sockets)

After a while when using webrtc streamer with a lot of rtsp different sources webrtc-streamer crash and prints to stderr:

Failed to DESCRIBE: unable to create stream socket: Too many open files
[err] evsignal_init: socketpair: Too many open files

for each camera switch
sudo lsof | grep | wc -l
it increase for about 2000+

Stream Dont Start

./webrtc-server__Release "rtsp://192.168.0.31/axis-media/media.amp"
Logger level:4
[000:000] [3833] (webrtcvoiceengine.cc:640): webrtc: failed to connect context, error=-1
[000:000] [3833] (audio_device_pulse_linux.cc:172): failed to initialize PulseAudio
[000:001] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:002] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_outputMixerHandle, ) error: No such file or directory
[000:002] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:002] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_inputMixerHandle, ) error: No such file or directory
[000:002] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:002] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_outputMixerHandle, ) error: No such file or directory
[000:003] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM
[000:003] [3833] (webrtcvoiceengine.cc:640): webrtc: unable to open playback device: No such file or directory (-2)
[000:003] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:003] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_inputMixerHandle, ) error: No such file or directory
[000:003] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM
[000:003] [3833] (webrtcvoiceengine.cc:640): webrtc: unable to open record device: No such file or directory
[000:004] [3833] (audio_device_generic.cc:51): BuiltInAECIsAvailable: Not supported on this platform
[000:004] [3833] (audio_device_generic.cc:61): BuiltInAGCIsAvailable: Not supported on this platform
[000:004] [3833] (audio_device_generic.cc:71): BuiltInNSIsAvailable: Not supported on this platform
[000:004] [3833] (adm_helpers.cc:47): Unable to set recording channel to kChannelBoth.
[000:004] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:004] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_inputMixerHandle, ) error: No such file or directory
[000:004] [3833] (adm_helpers.cc:56): Unable to access microphone.
[000:005] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:005] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_inputMixerHandle, ) error: No such file or directory
[000:005] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM
[000:005] [3833] (webrtcvoiceengine.cc:640): webrtc: unable to open record device: No such file or directory
[000:005] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:005] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_outputMixerHandle, ) error: No such file or directory
[000:005] [3833] (adm_helpers.cc:100): Unable to access speaker.
[000:005] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL
[000:006] [3833] (webrtcvoiceengine.cc:640): webrtc: snd_mixer_attach(_outputMixerHandle, ) error: No such file or directory
[000:006] [3833] (webrtcvoiceengine.cc:640): webrtc: GetDevicesInfo - Could not find device name or numbers
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM
[000:006] [3833] (webrtcvoiceengine.cc:640): webrtc: unable to open playback device: No such file or directory (-2)
HTTP Listen at 0.0.0.0:8000
STUN Listening at 127.0.0.1:3478
answer:false

answer:[ "rtsp://192.168.0.31/axis-media/media.amp" ]

answer:{
"iceServers" : [
{
"url" : "stun:stun.l.google.com:19302"
}
]
}

body:{"type":"offer","sdp":"v=0\r\no=- 6240597405130466022 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:JoeM\r\na=ice-pwd:dQyMcihMjpALfGr7TgMIlaNe\r\na=fingerprint:sha-256 D5:E7:A7:56:1B:19:52:2C:06:64:BD:9A:00:FC:99:8B:E8:91:CC:C6:E1:F2:F7:42:BC:71:8C:15:10:25:60:F3\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 isac/16000\r\na=rtpmap:104 isac/32000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 cn/32000\r\na=rtpmap:105 cn/16000\r\na=rtpmap:13 cn/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:112 telephone-event/32000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 98 100 102 127 97 99 101 125\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:JoeM\r\na=ice-pwd:dQyMcihMjpALfGr7TgMIlaNe\r\na=fingerprint:sha-256 D5:E7:A7:56:1B:19:52:2C:06:64:BD:9A:00:FC:99:8B:E8:91:CC:C6:E1:F2:F7:42:BC:71:8C:15:10:25:60:F3\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtpmap:100 H264/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\na=rtpmap:102 red/90000\r\na=rtpmap:127 ulpfec/90000\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:125 rtx/90000\r\na=fmtp:125 apt=102\r\n"}
body:{"candidate":"candidate:2370302700 1 udp 2113937151 192.168.0.169 56396 typ host generation 0 ufrag JoeM network-cost 50","sdpMid":"audio","sdpMLineIndex":0}
answer:1

body:{"candidate":"candidate:2370302700 1 udp 2113937151 192.168.0.169 56398 typ host generation 0 ufrag JoeM network-cost 50","sdpMid":"video","sdpMLineIndex":1}
answer:1

[008:083] [3840] (PeerConnectionManager.cpp:606): Cannot create capturer rtsp://192.168.0.31/axis-media/media.amp
[008:083] [3840] (PeerConnectionManager.cpp:655): Cannot find stream
body:{"candidate":"candidate:842163049 1 udp 1677729535 131.161.41.22 56398 typ srflx raddr 192.168.0.169 rport 56398 generation 0 ufrag JoeM network-cost 50","sdpMid":"video","sdpMLineIndex":1}
answer:1

body:{"candidate":"candidate:842163049 1 udp 1677729535 131.161.41.22 56396 typ srflx raddr 192.168.0.169 rport 56396 generation 0 ufrag JoeM network-cost 50","sdpMid":"audio","sdpMLineIndex":0}
answer:1

404

demo on herokuapp

Hi mpromonet,

demo page at https://webrtc-streamer.herokuapp.com/ doesn't work properly.
Firefox tells:
"ICE failed, add a STUN server and see about:webrtc for more details"
"ICE failed, add a TURN server and see about:webrtc for more details"

I tryed in my local machine and it works only with local streamer (VLC), what is the problem?
It is a STUN/TURN server issue?
Thankyou

Add daemon mode and log to file

Would be nice to have --daemon option so that it starts in background
Also would be nice to have --log so we can have log in /var/log/webrtc-streamer.log .. also we should have timestamp in from on each log line

Record Stream

Hello Everybody,

I Would like know , how the best way for to implement recording.
I are using im my project for to view but i really need recording.

Thank you.

No audio playback from rtsp url

This URL rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov contains both video and audio. Only the video stream is included in the PeerConnection. Would be nice to have the associated audio also.

Provide binary for RPi Zero and 1

The build provided by Travis CI currently does not work on a Raspberry Pi Zero W.
Would it be possible to add builds for the Pi Zero (armv6h) for future releases?

rtspvideocapturer

How do you use the rtspvideocapturer? I noticed you have an h264 codec in there, are you using a modified webrtc source to get the h264 codec to work? It does not appear to work with the latest webrtc source.

Thanks for the great work also, this is a great up to date example, very helpful.

Cannot build

Hello,

I cannot build with current version of WebRTC native code; folder structure is as follows :
~/Projects/webrtc-streamer/...
~/Projects/webrtc/src/out/Release/...

Build command is make WEBROOT=../webrtc WEBRTCBUILD=Release PREFIX=/usr/local
Build log is here https://pastebin.com/LS6jtFk3
System is up to date Debian 9

It seems to me that the linking process fails, though I did not succeed to understand why; WebRTC was proprely built beforehand.

Could you help me please ?

Thanks !

pathutils.h missing

During make came accross foloowing problem :

make WEBRTCROOT=/home/ubuntu/ WEBRTCBUILD=Debug

find: `/home/ubuntu//src//out/Debug': No such file or directory
g++  -o src/HttpServerRequestHandler.o -c src/HttpServerRequestHandler.cpp -W -pthread -g -std=c++11 -Iinc -DWEBRTC_POSIX -fno-rtti -D_GLIBCXX_USE_CXX11_ABI=0 -I /home/ubuntu//src -I /home/ubuntu//src/chromium/src/third_party/jsoncpp/source/include -D_GLIBCXX_DEBUG=1 
src/HttpServerRequestHandler.cpp:12:35: fatal error: webrtc/base/pathutils.h: No such file or directory
 #include "webrtc/base/pathutils.h"
                                   ^
compilation terminated.
make: *** [src/HttpServerRequestHandler.o] Error 1

Undefined references when linking

webrtc builds ok.
webrtc-streamer compiles ok but fails in link step.
Could be caused by some libraries in webrtc being generated as shared libraries with .so suffix.
ar -rcT libWebRTC__Default.a ../webrtc/src//out/Default/obj/webrtc/librtc_event_log_proto.a ../webrtc/src//out/Default/obj/webrtc/modules/audio_coding/libneteq_unittest_proto.a ../webrtc/src//out/Default/obj/webrtc/modules/audio_processing/libaudioproc_debug_proto.a ../webrtc/src//out/Default/obj/webrtc/modules/audio_processing/libaudioproc_unittest_proto.a ../webrtc/src//out/Default/obj/webrtc/tools/libgraph_proto.a ../webrtc/src//out/Default/obj/webrtc/base/librtc_base_approved.a ../webrtc/src//out/Default/obj/webrtc/base/librtc_task_queue.a ../webrtc/src//out/Default/obj/webrtc/base/librtc_base.a ../webrtc/src//out/Default/obj/testing/gmock/libgmock_main.a ../webrtc/src//out/Default/obj/testing/gmock/libgmock.a ../webrtc/src//out/Default/obj/testing/gtest/libgtest.a ../webrtc/src//out/Default/obj/third_party/openmax_dl/dl/libdl.a ../webrtc/src//out/Default/obj/third_party/usrsctp/libusrsctp.a ../webrtc/src//out/Default/obj/third_party/libsrtp/libsrtp.a ../webrtc/src//out/Default/obj/third_party/libyuv/libyuv.a ../webrtc/src//out/Default/obj/third_party/libjpeg_turbo/libjpeg.a ../webrtc/src//out/Default/obj/third_party/libjpeg_turbo/libsimd_asm.a ../webrtc/src//out/Default/obj/third_party/libjpeg_turbo/libsimd.a ../webrtc/src//out/Default/obj/third_party/libvpx/libvpx.a ../webrtc/src//out/Default/obj/third_party/libvpx/libvpx_yasm.a ../webrtc/src//out/Default/obj/third_party/protobuf/libprotobuf_full.a ../webrtc/src//out/Default/obj/third_party/protobuf/libprotoc_lib.a ../webrtc/src//out/Default/obj/third_party/opus/libopus.a ../webrtc/src//out/Default/obj/third_party/yasm/libyasm_utils.a ../webrtc/src//out/Default/obj/base/third_party/libevent/libevent.a ../webrtc/src//out/Default/obj/build/config/sanitizers/liboptions_sources.a
g++ -o webrtc-server__Default src/PeerConnectionManager.o src/HttpServerRequestHandler.o src/main.o libWebRTC__Default.a -pthread -lX11 -ldl -lrt
src/PeerConnectionManager.o: In function PeerConnectionManager::PeerConnectionManager(std::string const&)': /home/dave/webrtc-streamer/src/PeerConnectionManager.cpp:42: undefined reference toJson::Value::Value(Json::ValueType)'
src/PeerConnectionManager.o: In function PeerConnectionManager::~PeerConnectionManager()': /home/dave/webrtc-streamer/src/PeerConnectionManager.cpp:46: undefined reference toJson::Value::~Value()'

``

Unable to compile code.

Hey Michel! I'm trying to build this project and it fails at the make command, here is the output:

g++  -o webrtc-server__Release -W -pthread -g -std=gnu++0x -I mongoose -DWEBRTC_POSIX -fno-rtti -I ./src -I ./src/chromium/src/third_party/jsoncpp/source/include main.cpp PeerConnectionManager.cpp mongoose/mongoose.c libWebRTC__Release.a -lX11 -lXext -lexpat -ldl -lnss3 -lnssutil3 -lplc4 -lnspr4 -lrt
PeerConnectionManager.cpp: In member function ‘std::pair<rtc::scoped_refptr<webrtc::PeerConnectionInterface>, PeerConnectionManager::PeerConnectionObserver*> PeerConnectionManager::CreatePeerConnection(const string&)’:
PeerConnectionManager.cpp:93:15: error: no matching function for call to ‘webrtc::PeerConnectionFactoryInterface::CreatePeerConnection(webrtc::PeerConnectionInterface::IceServers&, NULL, NULL, NULL, PeerConnectionManager::PeerConnectionObserver*&)’
            obs);
               ^
In file included from PeerConnectionManager.h:16:0,
                 from PeerConnectionManager.cpp:20:
./src/talk/app/webrtc/peerconnectioninterface.h:545:55: note: candidate: virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface> webrtc::PeerConnectionFactoryInterface::CreatePeerConnection(const webrtc::PeerConnectionInterface::RTCConfiguration&, const webrtc::MediaConstraintsInterface*, rtc::scoped_ptr<cricket::PortAllocator>, rtc::scoped_ptr<webrtc::DtlsIdentityStoreInterface>, webrtc::PeerConnectionObserver*)
   virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
                                                       ^
./src/talk/app/webrtc/peerconnectioninterface.h:545:55: note:   no known conversion for argument 1 from ‘webrtc::PeerConnectionInterface::IceServers {aka std::vector<webrtc::PeerConnectionInterface::IceServer>}’ to ‘const webrtc::PeerConnectionInterface::RTCConfiguration&’
Makefile:36: recipe for target 'webrtc-server__Release' failed
make: *** [webrtc-server__Release] Error 1

Is this some kind of incompatibility between your code and the webrtc master? I'm on HEAD master of the webrtc repo as per the instructions and have a successful ninja run .

Thanks!

webrtc-streamer core dump

Is there a specific stable commended version/branch of webrtc libs that is recommended to compile webrtc-streamer? The latest git HEAD is dumping core. Any ideas or anyone else having this issue ?
Does webrtc-streamer have to have any other associated v4l2loopback/compress software dependency?

I was using git HEAD
commit 71b9b58a3a3ac651e5a5c5d095411620bb425659
Author: solenberg [email protected]
Date: Fri Nov 25 11:45:05 2016 -0800

Successfully compiled webrtc for linux using instructions available here
https://github.com/ipop-project/ipop-project.github.io/wiki/Building-the-WebRTC-lib-for-Linux

gn gen out/Release
ninja -C out/Release

~/rtsp-stuff/webrtc-streamer$ ./webrtc-server__Release -vvv
Logger level:1
[000:000] [1522] (webrtcvoiceengine.cc:554): WebRtcVoiceEngine::WebRtcVoiceEngine
[000:001] [1522] (webrtcvoiceengine.cc:561): Supported send codecs in order of preference:
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: opus/48000/2 (111)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: ISAC/16000/1 (103)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: ISAC/32000/1 (104)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: G722/8000/1 (9)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: ILBC/8000/1 (102)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: PCMU/8000/1 (0)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: PCMA/8000/1 (8)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: CN/32000/1 (106)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: CN/16000/1 (105)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: CN/8000/1 (13)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: telephone-event/48000/1 (110)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: telephone-event/32000/1 (112)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: telephone-event/16000/1 (113)
[000:001] [1522] (webrtcvoiceengine.cc:314): Adding supported codec: telephone-event/8000/1 (126)
[000:001] [1522] (webrtcvoiceengine.cc:564): opus/48000/2 (111)
[000:001] [1522] (webrtcvoiceengine.cc:564): ISAC/16000/1 (103)
[000:001] [1522] (webrtcvoiceengine.cc:564): ISAC/32000/1 (104)
[000:001] [1522] (webrtcvoiceengine.cc:564): G722/8000/1 (9)
[000:001] [1522] (webrtcvoiceengine.cc:564): ILBC/8000/1 (102)
[000:001] [1522] (webrtcvoiceengine.cc:564): PCMU/8000/1 (0)
[000:001] [1522] (webrtcvoiceengine.cc:564): PCMA/8000/1 (8)
[000:001] [1522] (webrtcvoiceengine.cc:564): CN/32000/1 (106)
[000:001] [1522] (webrtcvoiceengine.cc:564): CN/16000/1 (105)
[000:001] [1522] (webrtcvoiceengine.cc:564): CN/8000/1 (13)
[000:001] [1522] (webrtcvoiceengine.cc:564): telephone-event/48000/1 (110)
[000:001] [1522] (webrtcvoiceengine.cc:564): telephone-event/32000/1 (112)
[000:001] [1522] (webrtcvoiceengine.cc:564): telephone-event/16000/1 (113)
[000:001] [1522] (webrtcvoiceengine.cc:564): telephone-event/8000/1 (126)
[000:001] [1522] (webrtcvoiceengine.cc:567): Supported recv codecs in order of preference:
[000:001] [1522] (webrtcvoiceengine.cc:570): opus/48000/2 (111)
[000:001] [1522] (webrtcvoiceengine.cc:570): isac/16000/1 (103)
[000:002] [1522] (webrtcvoiceengine.cc:570): isac/32000/1 (104)
[000:002] [1522] (webrtcvoiceengine.cc:570): G722/8000/1 (9)
[000:002] [1522] (webrtcvoiceengine.cc:570): iLBC/8000/1 (102)
[000:002] [1522] (webrtcvoiceengine.cc:570): PCMU/8000/1 (0)
[000:002] [1522] (webrtcvoiceengine.cc:570): PCMA/8000/1 (8)
[000:002] [1522] (webrtcvoiceengine.cc:570): cn/32000/1 (106)
[000:002] [1522] (webrtcvoiceengine.cc:570): cn/16000/1 (105)
[000:002] [1522] (webrtcvoiceengine.cc:570): cn/8000/1 (13)
[000:002] [1522] (webrtcvoiceengine.cc:570): telephone-event/48000/1 (110)
[000:002] [1522] (webrtcvoiceengine.cc:570): telephone-event/32000/1 (112)
[000:002] [1522] (webrtcvoiceengine.cc:570): telephone-event/16000/1 (113)
[000:002] [1522] (webrtcvoiceengine.cc:570): telephone-event/8000/1 (126)
[000:002] [1522] (webrtcvoiceengine.cc:578): VoiceEngine 4.1.0
[000:002] [1522] (audio_device_impl.cc:86): Create
[000:002] [1522] (audio_device_buffer.cc:73): AudioDeviceBuffer::ctor
[000:002] [1522] (audio_device_impl.cc:133): AudioDeviceModuleImpl
[000:002] [1522] (audio_device_impl.cc:141): CheckPlatform
[000:002] [1522] (audio_device_impl.cc:155): current platform is Linux
[000:002] [1522] (audio_device_impl.cc:182): CreatePlatformSpecificObjects
[000:002] [1522] (audio_device_impl.cc:1876): PlatformAudioLayer
[000:002] [1522] (audio_device_impl.cc:285): attempting to use the Linux PulseAudio APIs...
[000:007] [1522] (webrtcvoiceengine.cc:1024): webrtc: SetPulseAudioObjects
[000:007] [1522] (webrtcvoiceengine.cc:1024): webrtc: the PulseAudio objects for the mixer has been set
[000:007] [1522] (webrtcvoiceengine.cc:1024): webrtc: checking PulseAudio version: 8.0
[000:008] [1522] (audio_device_impl.cc:291): Linux PulseAudio APIs will be utilized
[000:008] [1522] (audio_device_impl.cc:371): AttachAudioBuffer
[000:008] [1522] (audio_device_buffer.cc:189): SetRecordingSampleRate(0)
[000:008] [1522] (audio_device_buffer.cc:196): SetPlayoutSampleRate(0)
[000:008] [1522] (audio_device_buffer.cc:213): SetRecordingChannels(0)
[000:008] [1522] (audio_device_buffer.cc:220): SetPlayoutChannels(0)
[000:008] [1522] (audio_device_impl.cc:1484): RegisterEventObserver
[000:008] [1522] (audio_device_impl.cc:1497): RegisterAudioCallback
[000:008] [1522] (audio_device_buffer.cc:88): RegisterAudioCallback
[000:008] [1522] (audio_device_impl.cc:499): Init
[000:008] [1522] (audio_device_impl.cc:1228): SetPlayoutDevice(0)
[000:008] [1522] (webrtcvoiceengine.cc:1024): webrtc: number of availiable output devices is 2
[000:008] [1522] (audio_device_impl.cc:548): InitSpeaker
[000:009] [1522] (webrtcvoiceengine.cc:1024): webrtc: AudioMixerManagerLinuxPulse::OpenSpeaker(deviceIndex=0)
[000:009] [1522] (webrtcvoiceengine.cc:1024): webrtc: the output mixer device is now open
[000:009] [1522] (audio_device_impl.cc:1323): SetRecordingDevice(0)
[000:010] [1522] (webrtcvoiceengine.cc:1024): webrtc: number of availiable input devices is 2
[000:010] [1522] (audio_device_impl.cc:558): InitMicrophone
[000:010] [1522] (webrtcvoiceengine.cc:1024): webrtc: AudioMixerManagerLinuxPulse::OpenMicrophone(deviceIndex=1)
[000:010] [1522] (webrtcvoiceengine.cc:1024): webrtc: the input mixer device is now open
[000:010] [1522] (audio_device_impl.cc:1037): StereoPlayoutIsAvailable
[000:010] [1522] (audio_device_impl.cc:1047): output: 1
[000:010] [1522] (audio_device_impl.cc:1056): SetStereoPlayout(1)
[000:010] [1522] (audio_device_buffer.cc:220): SetPlayoutChannels(2)
[000:010] [1522] (audio_device_impl.cc:923): StereoRecordingIsAvailable
[000:010] [1522] (webrtcvoiceengine.cc:1024): webrtc: AudioMixerManagerLinuxPulse::StereoRecordingIsAvailable() => available=2, available
[000:010] [1522] (audio_device_impl.cc:933): output: 1
[000:010] [1522] (audio_device_impl.cc:942): SetStereoRecording(1)
[000:010] [1522] (audio_device_buffer.cc:213): SetRecordingChannels(2)
[000:012] [1522] (webrtcvoiceengine.cc:1024): webrtc: TransmitMixer::SetAudioProcessingModule(audioProcessingModule=0x400c1f80)
[000:012] [1522] (webrtcvoiceengine.cc:1024): webrtc: OutputMixer::SetAudioProcessingModule(audioProcessingModule=0x400c1f80)
[000:012] [1522] (webrtcvoiceengine.cc:1024): webrtc: (audio_processing_impl.cc:622): Level controller activated: 0
[000:012] [1522] (webrtcvoiceengine.cc:1024): webrtc: (audio_processing_impl.cc:629): Highpass filter activated: 1
[000:012] [1522] (audio_device_impl.cc:1103): SetAGC(1)
[000:012] [1522] (webrtcvoiceengine.cc:653): WebRtcVoiceEngine::ApplyOptions: AudioOptions {aec: true, agc: true, ns: true, hf: true, swap: false, audio_jitter_buffer_max_packets: 50, audio_jitter_buffer_fast_accelerate: false, typing: true, agc_delta: 0, experimental_agc: false, extended_filter_aec: false, delay_agnostic_aec: false, experimental_ns: false, intelligibility_enhancer: false, level_control: false, residual_echo_detector: true, }
[000:012] [1522] (audio_device_impl.cc:1792): BuiltInAECIsAvailable
[000:012] [1522] (audio_device_generic.cc:51): virtual bool webrtc::AudioDeviceGeneric::BuiltInAECIsAvailable() const: Not supported on this platform
[000:012] [1522] (audio_device_impl.cc:1795): output: 0
[000:013] [1522] (webrtcvoiceengine.cc:734): Echo control set to 1 with mode 2
[000:013] [1522] (audio_device_impl.cc:1808): BuiltInAGCIsAvailable
[000:013] [1522] (audio_device_generic.cc:61): virtual bool webrtc::AudioDeviceGeneric::BuiltInAGCIsAvailable() const: Not supported on this platform
[000:013] [1522] (audio_device_impl.cc:1811): output: 0
[000:013] [1522] (audio_device_impl.cc:1103): SetAGC(1)
[000:013] [1522] (webrtcvoiceengine.cc:768): Auto gain set to 1 with mode 2
[000:013] [1522] (audio_device_impl.cc:1824): BuiltInNSIsAvailable
[000:013] [1522] (audio_device_generic.cc:71): virtual bool webrtc::AudioDeviceGeneric::BuiltInNSIsAvailable() const: Not supported on this platform
[000:013] [1522] (audio_device_impl.cc:1827): output: 0
[000:013] [1522] (webrtcvoiceengine.cc:823): Noise suppression set to 1 with mode 5
[000:013] [1522] (webrtcvoiceengine.cc:829): Stereo swapping enabled? 0
[000:013] [1522] (webrtcvoiceengine.cc:838): NetEq capacity is 50
[000:013] [1522] (webrtcvoiceengine.cc:844): NetEq fast mode? 0
[000:013] [1522] (webrtcvoiceengine.cc:851): Typing detection is enabled? 1
[000:013] [1522] (webrtcvoiceengine.cc:860): Adjust agc delta is 0
[000:013] [1522] (webrtcvoiceengine.cc:1049): Adjusting AGC level from default -2dB to -2dB
[000:013] [1522] (webrtcvoiceengine.cc:871): Delay agnostic aec is enabled? 0
[000:013] [1522] (webrtcvoiceengine.cc:880): Extended filter aec is enabled? 0
[000:013] [1522] (webrtcvoiceengine.cc:889): Experimental ns is enabled? 0
[000:013] [1522] (webrtcvoiceengine.cc:895): Intelligibility Enhancer is enabled? 0
[000:013] [1522] (webrtcvoiceengine.cc:905): Level control: 0
[000:013] [1522] (webrtcvoiceengine.cc:1024): webrtc: (audio_processing_impl.cc:622): Level controller activated: 0
[000:013] [1522] (webrtcvoiceengine.cc:1024): webrtc: (audio_processing_impl.cc:629): Highpass filter activated: 1
[000:013] [1522] (webrtcvoiceengine.cc:944): Setting microphone to (id=0) and speaker to (id=0)
[000:013] [1522] (audio_device_impl.cc:1473): Recording
[000:013] [1522] (audio_device_impl.cc:989): SetRecordingChannel(both)
[000:013] [1522] (audio_device_buffer.cc:227): SetRecordingChannel(2)
[000:013] [1522] (audio_device_buffer.cc:228): Not implemented
[000:013] [1522] (webrtcvoiceengine.cc:1024): webrtc: SetRecordingChannel() unable to set the recording channel (error=10028)
[000:013] [1522] (audio_device_impl.cc:1323): SetRecordingDevice(0)
[000:014] [1522] (audio_device_impl.cc:558): InitMicrophone
[000:014] [1522] (audio_device_impl.cc:923): StereoRecordingIsAvailable
[000:014] [1522] (audio_device_impl.cc:933): output: 1
[000:014] [1522] (audio_device_impl.cc:942): SetStereoRecording(1)
[000:014] [1522] (audio_device_buffer.cc:213): SetRecordingChannels(2)
[000:015] [1522] (audio_device_impl.cc:1431): Playing
[000:015] [1522] (audio_device_impl.cc:1228): SetPlayoutDevice(0)
[000:015] [1522] (audio_device_impl.cc:548): InitSpeaker
[000:015] [1522] (audio_device_impl.cc:1037): StereoPlayoutIsAvailable
[000:016] [1522] (audio_device_impl.cc:1047): output: 1
[000:016] [1522] (audio_device_impl.cc:1056): SetStereoPlayout(1)
[000:016] [1522] (audio_device_buffer.cc:220): SetPlayoutChannels(2)
[000:016] [1522] (webrtcvoiceengine.cc:961): Set microphone to (id=0) and speaker to (id=0)
[000:017] [1522] (audio_device_impl.cc:1497): RegisterAudioCallback
[000:017] [1522] (audio_device_buffer.cc:88): RegisterAudioCallback
[000:017] [1522] (audio_device_impl.cc:1497): RegisterAudioCallback
[000:017] [1522] (audio_device_buffer.cc:88): RegisterAudioCallback
[000:017] [1522] (webrtcvideoengine2.cc:499): WebRtcVideoEngine2::WebRtcVideoEngine2()
[000:017] [1522] (webrtcvideoengine2.cc:641): Internally supported codecs: {VideoCodec[0:VP8], VideoCodec[0:VP9], VideoCodec[0:red], VideoCodec[0:ulpfec]}
[000:018] [1522] (webrtcvideoengine2.cc:508): WebRtcVideoEngine2::Init
Segmentation fault (core dumped)

[305412.035096] webrtc-server__[1462]: segfault at ff00000001 ip 00007f4a9623958f sp 00007ffd221e44c8 error 6 in libstdc++.so.6.0.21[7f4a9619b000+172000]

RTSP source can get worked

We use a Axis IP Camera for the testing, input the URL to input box in the webui, it seems that the rtsp work well, but the web can get any video, both firefox and chrome

Sending request: PLAY rtsp://159.99.251.76/onvif-media/media.amp?profile=quality_h264&sessiontimeout=60&streamtype=unicast RTSP/1.0
CSeq: 5
Authorization: Digest username="admin", realm="AXIS_WS_00408CA21FFF", nonce="00006227Y732189e0a47aeea6dc1e057ada6997c111101", uri="rtsp://159.99.251.76/onvif-media/media.amp/", response="08f0a0b54cd1294b057f60cb553a9c26"
User-Agent: LIVE555 Streaming Media v2016.08.07
Session: B3926245
Range: npt=0.000-

1804289383:{
"sdp" : "v=0\r\no=- 2665439333175596351 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE video\r\na=msid-semantic: WMS stream_label\r\nm=video 9 UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:TiCG/rgYvBn4YaNH\r\na=ice-pwd:qaxHNknBu6JXN5/Q16kIa/1e\r\na=fingerprint:sha-256 BD:01:A9:C7:8A:B2:24:43:F8:5B:FA:17:0C:57:95:32:48:DC:46:CD:B6:3F:77:D3:BB:3E:B9:9D:D6:66:9B:E1\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtpmap:101 VP9/90000\r\na=rtcp-fb:101 ccm fir\r\na=rtcp-fb:101 nack\r\na=rtcp-fb:101 nack pli\r\na=rtcp-fb:101 goog-remb\r\na=rtcp-fb:101 transport-cc\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=rtpmap:96 rtx/90000\r\na=fmtp:96 apt=100\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=101\r\na=rtpmap:98 rtx/90000\r\na=fmtp:98 apt=116\r\na=ssrc-group:FID 1931720387 2078885298\r\na=ssrc:1931720387 cname:cg6pjT6riTx0Qk81\r\na=ssrc:1931720387 msid:stream_label video_label\r\na=ssrc:1931720387 mslabel:stream_label\r\na=ssrc:1931720387 label:video_label\r\na=ssrc:2078885298 cname:cg6pjT6riTx0Qk81\r\na=ssrc:2078885298 msid:stream_label video_label\r\na=ssrc:2078885298 mslabel:stream_label\r\na=ssrc:2078885298 label:video_label\r\n",
"type" : "offer"
}

[015:879] 1854: virtual void PeerConnectionManager::SetSessionDescriptionObserver::OnSuccess() type:offer v=0
o=- 2665439333175596351 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS stream_label
m=video 9 UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:TiCG/rgYvBn4YaNH
a=ice-pwd:qaxHNknBu6JXN5/Q16kIa/1e
a=fingerprint:sha-256 BD:01:A9:C7:8A:B2:24:43:F8:5B:FA:17:0C:57:95:32:48:DC:46:CD:B6:3F:77:D3:BB:3E:B9:9D:D6:66:9B:E1
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtpmap:101 VP9/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 goog-remb
a=rtcp-fb:101 transport-cc
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=101
a=rtpmap:98 rtx/90000
a=fmtp:98 apt=116
a=ssrc-group:FID 1931720387 2078885298
a=ssrc:1931720387 cname:cg6pjT6riTx0Qk81
a=ssrc:1931720387 msid:stream_label video_label
a=ssrc:1931720387 mslabel:stream_label
a=ssrc:1931720387 label:video_label
a=ssrc:2078885298 cname:cg6pjT6riTx0Qk81
a=ssrc:2078885298 msid:stream_label video_label
a=ssrc:2078885298 mslabel:stream_label
a=ssrc:2078885298 label:video_label

Received 254 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 5
Session: B3926245
Range: npt=0-
RTP-Info: url=rtsp://159.99.251.76/onvif-media/media.amp/trackID=1?profile=quality_h264&sessiontimeout=60&streamtype=unicast;seq=14334;rtptime=2856969365
Date: Wed, 17 Aug 2016 16:21:43 GMT

PLAY OK
===> HTTP request /getIceCandidate
res:1
body:
===> HTTP request /answer
res:1
body:{"type":"answer","sdp":"v=0\r\no=mozilla...THIS_IS_SDPARTA-48.0 5570441187170516131 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=fingerprint:sha-256 94:6F:90:49:AF:A9:64:9F:EA:0E:42:EA:D6:C1:E8:02:DE:63:CF:77:08:57:75:A5:0A:EC:DF:09:2E:78:8F:26\r\na=group:BUNDLE video\r\na=ice-options:trickle\r\na=msid-semantic:WMS *\r\nm=video 9 UDP/TLS/RTP/SAVPF 100\r\nc=IN IP4 0.0.0.0\r\na=recvonly\r\na=fmtp:100 max-fs=12288;max-fr=60\r\na=ice-pwd:a3e34811420eb8ce74dc79c7ee0fda92\r\na=ice-ufrag:b0865c1b\r\na=mid:video\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-mux\r\na=rtpmap:100 VP8/90000\r\na=setup:active\r\na=ssrc:2174317038 cname:{19b200c1-3f71-4641-a5e8-0a84d5c9fcc8}\r\n"}
[017:757] 1854: From peerid:1804289383 received session description :answer
[018:194] 1854: virtual void PeerConnectionManager::SetSessionDescriptionObserver::OnSuccess() type:answer v=0
o=- 2665439333175596351 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS stream_label
m=video 40505 UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98
c=IN IP4 192.168.56.101
a=rtcp:58120 IN IP4 192.168.56.101
a=candidate:1749055319 1 udp 2122260223 192.168.56.101 40505 typ host generation 0 network-id 2 network-cost 50
a=candidate:3530337216 1 udp 2122194687 159.99.251.183 54696 typ host generation 0 network-id 1 network-cost 50
a=candidate:1749055319 2 udp 2122260222 192.168.56.101 58120 typ host generation 0 network-id 2 network-cost 50
a=candidate:3530337216 2 udp 2122194686 159.99.251.183 36920 typ host generation 0 network-id 1 network-cost 50
a=candidate:650349479 1 tcp 1518280447 192.168.56.101 43174 typ host tcptype passive generation 0 network-id 2 network-cost 50
a=candidate:2632931120 1 tcp 1518214911 159.99.251.183 60014 typ host tcptype passive generation 0 network-id 1 network-cost 50
a=candidate:650349479 2 tcp 1518280446 192.168.56.101 36604 typ host tcptype passive generation 0 network-id 2 network-cost 50
a=candidate:2632931120 2 tcp 1518214910 159.99.251.183 35967 typ host tcptype passive generation 0 network-id 1 network-cost 50
a=ice-ufrag:TiCG/rgYvBn4YaNH
a=ice-pwd:qaxHNknBu6JXN5/Q16kIa/1e
a=fingerprint:sha-256 BD:01:A9:C7:8A:B2:24:43:F8:5B:FA:17:0C:57:95:32:48:DC:46:CD:B6:3F:77:D3:BB:3E:B9:9D:D6:66:9B:E1
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtpmap:101 VP9/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 goog-remb
a=rtcp-fb:101 transport-cc
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=101
a=rtpmap:98 rtx/90000
a=fmtp:98 apt=116
a=ssrc-group:FID 1931720387 2078885298
a=ssrc:1931720387 cname:cg6pjT6riTx0Qk81
a=ssrc:1931720387 msid:stream_label video_label
a=ssrc:1931720387 mslabel:stream_label
a=ssrc:1931720387 label:video_label
a=ssrc:2078885298 cname:cg6pjT6riTx0Qk81
a=ssrc:2078885298 msid:stream_label video_label
a=ssrc:2078885298 mslabel:stream_label
a=ssrc:2078885298 label:video_label

===> HTTP request /addicecandidate
res:1
body:{"candidate":"candidate:1 1 UDP 2122252543 192.168.56.1 64890 typ host","sdpMid":"video","sdpMLineIndex":0}
===> HTTP request /addicecandidate
res:1
body:{"candidate":"candidate:0 1 UDP 2122187007 159.99.251.130 64889 typ host","sdpMid":"video","sdpMLineIndex":0}

[025:519] 1855: Binding request timed out from 192.168.56.101:40505 (eth1)
[025:528] 1855: Binding request timed out from 159.99.251.183:54696 (eth0)

Question: Support RTSP Stream over WebRTC

Hi, we have a question about our streamer.

We are developing on a IOT GW where we has connected some ONVIF webscams which streams over RTSP using H.264 G.711 codec.
Until now there is really no good solution to support such devices in browser over mobile devices. On desktop browser we can use flashplayer which is working well, but as you know flash will be blocked in feature on modern browsers like chrome and others.

For now we are using this lib https://github.com/Streamedian/html5_rtsp_player/wiki/HTML5-RTSP-Player which is working good but we had to do a lot of workaround to get it work and also it does not support G.711 codec.

Also we tested in past WebRTC with JsSIP, which should work but in real it doesn't work very good. CODEC support is very very poor. So the result is awful.

On our GW we are packaging the RTSP stream in an WebSocket for HTML5_RTSP player and on other WebSocket for WebRTC JsSip support.

Now, I'm really not an expert of WebRTC and streaming. So my question is what does the webrtc-streamer? Is there a client which we can use with our GW, without installing some server? And if yes, using your client does it work better instead of using only native WebRTC support?

Thx for your time
Michael

example of joining janus videoroom using NodeJS

Hi, you wrote in your readme that it should be possible to do this.

The main usecase for this is that imagine you have say a raspberry pi with a remote rtsp camera, and you want it to collect the video and publish it to a janus hosted video room.

Have you actually gotten this to work using NodeJS? If so, would you be so kind as to post an example of how to do it?

Need for HTTP API /getAudioDeviceList and /getVideoDeviceList

Michel,
HTTP API /getDeviceList needs to be extended from only enumerating Video Devices to enumerating both Audio and Video devices

I am having an issue in that the webrtc-streamer associates the wrong audio device with the video device for a Magewell v4l2(with audio). It picks the PC microphone as the input instead of the Magewell audio

Should the deviceId passed in as a constraint when CreateVideoSource and CreateAudioSources?

This sample in javascript works well https://webrtc.github.io/samples/src/content/devices/input-output/ . We need a similar C++ sample I guess

Can't compile webrtc-streamer

Hi Mr Promonet,

I may request your help because i have a very hard time compiling your project.
Few weeks ago i managed to do so, i modified the : VideoCapturer, PeerConnection and Html server to fit my needs and everything worked perfectly.
It happend that i had a problem with my Ubuntu installation and i had to wipe it and start on a fresh new one.
Since i'am trying to re compile your project but unfortunately i can't manage to do it.
I mainly have a problem with the webrtc installation linkage.
From what i understood, the Streamer Makefile go fetch for json, loggin, and some few other headers in the /src/webrtc/base or /src/webrtc/*, but the folder seems to lack most of the headers there.
I copied them from /src/base, but it get stuck on the logging headers.

I did everything according to your Readme and even on the webrtc web site. But it allways fails.

I can give the logs if they can be of any help. I'am compiling under Ubuntu 16.04 LTS

Best Regards.

Hakeem

Disconnect not working

After successful connect doing disconnect seems not to release on the server. Then when trying to connect again the server receives the /offer but just hangs after ice exchange.
Using Chrome Version 50.0.2661.94 (64-bit)

Ignore SPS that contains scaling lists

Hi,

I have a source that delivers SPS with scaling list and I get a problem in

line 85 - rtspvideocapturer.cpp

rtc::Optional<webrtc::SpsParser::SpsState> sps = webrtc::SpsParser::ParseSps(buffer+sizeof(marker)+webrtc::H264::kNaluTypeSize, size-sizeof(marker)-webrtc::H264::kNaluTypeSize);

I get:

SPS contains scaling lists, which are unsupported.
cannot parse sps

My sprop-parameter-sets is

sprop-parameter-sets=Z2QAKK2ECSZuIzSQgSTNxGaSECSZuIzSQgSTNxGaSECSZuIzSQgSTNxGaSEFTS69fX5P6/J9eutVCCppdevr8n9fk+vXWqtAUBf8uAqkAAADAAQAAAMCWYEAD6AABGUb3vheEQjU,aO48sA==

The problem is in the file webrtc/common_video/h264/sps_parser.cc

      // We don't support reading the sequence scaling list, and we don't really
      // see/use them in practice, so we'll just reject the full sps if we see
      // any provided.
      if (seq_scaling_list_present_flags > 0) {
        LOG(LS_WARNING) << "SPS contains scaling lists, which are unsupported.";
        return OptionalSps();
      }

I want to skip sps with scaling list but I don't a master in H.264. Maybe you could help me.

Before going to the stackoverflow I want to ask you :)

Thank you so much.

WEBRTCROOT and WEBRTCBUILD can not be used by makefile

fix diff

diff --git a/Makefile b/Makefile
index 4319a18..a8be83f 100644
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,8 @@ ifneq ($(wildcard $(SYSROOT)/usr/include/liveMedia/liveMedia.hh),)
endif

webrtc

-WEBRTCROOT=../webrtc
-WEBRTCBUILD=Release
+WEBRTCROOT ?=../webrtc
+WEBRTCBUILD ?=Release
WEBRTCLIBPATH=$(WEBRTCROOT)/src/$(GYP_GENERATOR_OUTPUT)/out/$(WEBRTCBUILD)

CFLAGS += -DWEBRTC_POSIX -fno-rtti

Build Error

When I compile the latest one with latest webrtc build, I got the following error.
What's problem?

g++ -o src/PeerConnectionManager.o -c src/PeerConnectionManager.cpp -W -pthread -g -std=c++11 -Iinc -DWEBRTC_POSIX -fno-rtti -D_GLIBCXX_USE_CXX11_ABI=0 -I ../webrtc_linux/src -I ../webrtc_linux/src/chromium/src/third_party/jsoncpp/source/include -D_GLIBCXX_DEBUG=1
g++ -o src/HttpServerRequestHandler.o -c src/HttpServerRequestHandler.cpp -W -pthread -g -std=c++11 -Iinc -DWEBRTC_POSIX -fno-rtti -D_GLIBCXX_USE_CXX11_ABI=0 -I ../webrtc_linux/src -I ../webrtc_linux/src/chromium/src/third_party/jsoncpp/source/include -D_GLIBCXX_DEBUG=1
g++ -o src/main.o -c src/main.cpp -W -pthread -g -std=c++11 -Iinc -DWEBRTC_POSIX -fno-rtti -D_GLIBCXX_USE_CXX11_ABI=0 -I ../webrtc_linux/src -I ../webrtc_linux/src/chromium/src/third_party/jsoncpp/source/include -D_GLIBCXX_DEBUG=1
g++ -o webrtc-server__Default src/PeerConnectionManager.o src/HttpServerRequestHandler.o src/main.o libWebRTC__Default.a -pthread -lX11 -ldl -lrt
../webrtc_linux/src/out/Default/obj/testing/libfuzzer/libfuzzer_main/unittest_main.o: In function main': ./out/Default/../../testing/libfuzzer/unittest_main.cc:36: multiple definition ofmain'
src/main.o:/home/astre/work/webrtc/webrtc-streamer/src/main.cpp:23: first defined here
../webrtc_linux/src/out/Default/obj/third_party/expat/expat_xml_parse_fuzzer/expat_xml_parse_fuzzer.o: In function LLVMFuzzerTestOneInput': ./out/Default/../../third_party/expat/fuzz/expat_xml_parse_fuzzer.cc:23: undefined reference toXML_ParserCreateNS'
./out/Default/../../third_party/expat/fuzz/expat_xml_parse_fuzzer.cc:23: undefined reference to XML_ParserCreate' ./out/Default/../../third_party/expat/fuzz/expat_xml_parse_fuzzer.cc:24: undefined reference toXML_Parse'
./out/Default/../../third_party/expat/fuzz/expat_xml_parse_fuzzer.cc:25: undefined reference to `XML_ParserFree'
collect2: error: ld returned 1 exit status
Makefile:44: recipe for target 'webrtc-server__Default' failed
make: *** [webrtc-server__Default] Error 1

RTSP http tunnel

It is not possible to set http tunnel option specifying a port number for rtsp sources.
Live555 lib provides http tunnel feature.
openRTSP (the live555 client) provides a -T option in order to enable http tunnel.

[(http://www.live555.com/openRTSP/]
[http://mirror.informatimago.com/next/developer.apple.com/quicktime/icefloe/dispatch028.html]

Support for RTSP over TCP

I have few cameras and some of them do not work with vlc or genius vision without switching to TCP transport. Exactly those cameras do not work webrtc-streamer. Can I somehow force it to use TCP for RTSP ? Support for that would be very useful.

BR,
Tihomir

Web CAM is not working.

In my previous Ubuntu, there is no issue for running webrtc-streamer.
However, there is no WebCAM selection in new Ubuntu installation.
I used the same webrtc and webrtc-streamer source and successful compilation.
Also, two log files were exactly same.
Do you have any comment or suggestion?

stream /dev/video to hangouts or similar services

Hi
First of all thank you for your effort,
this is a very beautiful project in order to simplify webrtc communications.
I'm looking for a simple way to stream a video device to google hangouts or janus or jangouts video rooms .
Is there a way to use your tool to do that.
I think at something like that:
./webrtc-streamer /dev/video1 https://hangouts.google.com/call/ktir5k7shbduhfubougepbx3euy

or to use piping with gstreamer or cvlc or ffmpeg.

Thank you
Paolo Marcheschi

Webrtc -> Rtsp Streaming

Hi Mr Mpromonet,

I'am Hakeem, i posted a question on Stackoverflow two days earlier about your Live555 application on WebRTC.

My question was : is it possible to modify your application to stream directly from FFMPEG / live555 to a web browser ?
I have a live555 + FFMPEG streamer which sends in the Rtsp media flux to a vlc program. But what i want to do is to stream that flux directly to a web browser, using WebRtc. But unfortunately i can't figure it out right now.
I asked if (you understand my question, i can go further in details) you think it is possible, and if you can give me hints on where to operate to make the transformation ?

Any help would be much appreciated.

Possible CPU optimization -- reference counter for rtsp url

Currently, if more than one browser accesses a specific rtsp URL, the CPU usage doubles. Is it possible to reuse the transcoded video by maintaining a reference counter and not wastefully transcode the same rtsp stream more than once?

Segmentation fault on arm

On intel i7 ubuntu 16 everything fine, but when running on arm (orange pi zero with armbian) I get crash:

Stacktrace:

#0  0xb6b01728 in free () from /lib/arm-linux-gnueabihf/libc.so.6
#1  0x0002c97c in std::default_delete<cricket::VideoFormat>::operator() (this=0xb1b1f128, __ptr=0xd312e00) at /usr/include/c++/5/bits/unique_ptr.h:76
#2  0x0002c35e in std::unique_ptr<cricket::VideoFormat, std::default_delete<cricket::VideoFormat> >::reset (this=0xb1b1f128, __p=0xd312e00) at /usr/include/c++/5/bits/unique_ptr.h:344
#3  0x0002be50 in cricket::VideoCapturer::SetCaptureFormat (this=0xb1b1f0c0, format=0xbec16f88) at /usr/local/src/webrtc/src/webrtc/media/base/videocapturer.h:241
#4  0x0002b7a4 in RTSPVideoCapturer::Start (this=0xb1b1f0c0, format=...) at src/rtspvideocapturer.cpp:144
#5  0x000c7ba6 in cricket::VideoCapturer::StartCapturing(cricket::VideoFormat const&) ()
#6  0x0006c0f0 in rtc::FunctorMessageHandler<bool, rtc::MethodFunctor<cricket::VideoCapturer, bool (cricket::VideoCapturer::*)(cricket::VideoFormat const&), bool, cricket::VideoFormat const&> >::OnMessage(rtc::Message*) ()
#7  0x00059b6e in rtc::Thread::ReceiveSendsFromThread(rtc::Thread const*) ()
#8  0x00056380 in rtc::MessageQueue::Get(rtc::Message*, int, bool) ()
#9  0x00059872 in rtc::Thread::Run() ()
#10 0x000595dc in rtc::Thread::PreRun(void*) ()
#11 0xb6ba05b4 in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
#12 0xb6b41aac in ?? () from /lib/arm-linux-gnueabihf/libc.so.6

Last thing on stdout (running with -vvv):

[032:355] [12486] (webrtcsession.cc:1156): ProcessIceMessage: Not ready to use candidate.
answer:1
[032:355] [12486] (webrtcsessiondescriptionfactory.cc:492): Setting new certificate.

*** 1490226120.096057524      1723814 2920281152 process_new_connection:14132: handle_request done
*** 1490226120.096158981       101457 2920281152 worker_thread_run:14442: Done processing connection from 10.130.133.12 (0.000000 sec)
*** 1490226120.096417395       258414 2920281152 worker_thread_run:14446: Connection closed
*** 1490226120.096498644        81249 2920281152 consume_socket:14248: going idle
[032:363] [12486] (PeerConnectionManager.h:39): virtual void PeerConnectionManager::SetSessionDescriptionObserver::OnSuccess() Remote SDP:v=0
o=- 1705043383676279282 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 0.0.0.0
a=rtcp:54023 IN IP4 44.170.1.2
a=candidate:842163049 2 udp 1677729534 44.170.1.2 54023 typ srflx raddr 10.130.133.12 rport 54023 generation 0 network-cost 50
a=ice-ufrag:fJ8C
a=ice-pwd:+LbXikJkqtiGTv/m2ELk1JgH
a=fingerprint:sha-256 7D:79:96:3A:66:29:30:9C:81:CC:B5:95:F0:45:AD:6F:B5:F7:52:89:5B:F0:8F:0C:F2:09:A3:B0:E9:CA:7F:0D
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=recvonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 isac/16000
a=rtpmap:104 isac/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 cn/32000
a=rtpmap:105 cn/16000
a=rtpmap:13 cn/8000
a=rtpmap:126 telephone-event/8000
m=video 49412 UDP/TLS/RTP/SAVPF 100 101 107 116 117 96 97 99 98
c=IN IP4 44.170.1.2
a=rtcp:60602 IN IP4 44.170.1.2
a=candidate:842163049 1 udp 1677729535 44.170.1.2 49412 typ srflx raddr 10.130.133.12 rport 49412 generation 0 network-cost 50
a=candidate:842163049 2 udp 1677729534 44.170.1.2 60602 typ srflx raddr 10.130.133.12 rport 60602 generation 0 network-cost 50
a=ice-ufrag:fJ8C
a=ice-pwd:+LbXikJkqtiGTv/m2ELk1JgH
a=fingerprint:sha-256 7D:79:96:3A:66:29:30:9C:81:CC:B5:95:F0:45:AD:6F:B5:F7:52:89:5B:F0:8F:0C:F2:09:A3:B0:E9:CA:7F:0D
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtpmap:101 VP9/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 goog-remb
a=rtcp-fb:101 transport-cc
a=rtpmap:107 H264/90000
a=rtcp-fb:107 ccm fir
a=rtcp-fb:107 nack
a=rtcp-fb:107 nack pli
a=rtcp-fb:107 goog-remb
a=rtcp-fb:107 transport-cc
a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=101
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=107
a=rtpmap:98 rtx/90000
a=fmtp:98 apt=116

I didn't use raspberry pi crosscompile instructions on wiki, but I crosscompiled with:
gn gen out/Release --args='target_cpu="arm" is_debug=false rtc_use_h264=true ffmpeg_branding="Chrome"'

and then webrtc-streamer was build on arm cpu with crosscompiled webrtc used from cifs share.

any idea ?

BR,
Tihomir 9a4gl

liveMedia.hh

Properly posting an earlier issue:

I get an error on make

rtspvideocapturer.h:24:24: fatal error: liveMedia.hh: No such file or directory #include "liveMedia.hh"

mpromonet responded

"... The code actually need live555 installed, I will manage differently this dependency (or remove it)"

I'll download and install live555 and give that a try.

Is this based on transcoding?

Hey, quick question.
Is the H264 frame from RTSP stream decoded first and then reencoded to VP8 by WebRTC?
Would it be possible to pass the H264 frame directly to WebRTC without reencoding?

video lags

Hello Michel!

I have a problem with a video streaming: it lags - it's like it plays for two seconds then stops and after a little while play another two and so on... I read your sources and can't understand where there can be a problem or how can i tweak this. Can you point it out, please?

There is a snippet of console logs when video is played:

[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(81) is large
[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(84) is large
[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(87) is large
[h264 @ 0x7fe2acaec8a0] no frame!
[201:193] [601] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529
NOTIFY failed
[h264 @ 0x7fe2acaec8a0] no frame!
[203:189] [601] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529
NOTIFY failed
[h264 @ 0x7fe2acaec8a0] no frame!
[205:198] [601] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529
NOTIFY failed
[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(3) is large
[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(3) is large
[h264 @ 0x7fe2acaec8a0] no frame!
[207:198] [601] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529
NOTIFY failed
[h264 @ 0x7fe2acaec8a0] no frame!
[209:199] [601] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529
NOTIFY failed
[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(3) is large
[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(6) is large
[h264 @ 0x7fe2acaec8a0] Increasing reorder buffer to 1
[OpenH264] this = 0x0x7fe28c019820, Warning:Actual input framerate 15.000000 is different from framerate in setting 22.000000, suggest to use other rate control modes
[h264 @ 0x7fe2acaec8a0] no frame!
[211:188] [601] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529
NOTIFY failed
[h264 @ 0x7fe2acaec8a0] no frame!
[213:199] [601] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529
NOTIFY failed
[OpenH264] this = 0x0x7fe28c019820, Warning:[Rc] iDid = 0,iContinualSkipFrames(3) is large

Thanks, Ilya

RTSP stream not closed

After I close browser, webrtc-streamer trace connection closed:

[006:150] [26080] (PeerConnectionManager.cpp:345): Close PeerConnection
[006:151] [26080] (PeerConnectionManager.cpp:358): Close PeerConnection no more used rtsp://user:[email protected]:554/2
answer:true

But it keeps tracing:

[h264 @ 0x7fcfa8007b60] no frame!
[010:202] [26128] (h264_decoder_impl.cc:330): avcodec_decode_video2 error: -1094995529

Which indiacte h264 stream is not closed. Same error is traced also when browser is opened and stream is shown in browser, so the error itself is not a problem.

BR,
Tihomir 9a4gl

RTSP stream not stopped if browser do not hang up call

With Chrome browser, if you have your webpage with webrtc-streamer already in history and you start typing it, before you press enter to go to webpage, Chrome will fetch the page and and execute onLoad javascript method which will trigger webrtc stream and also RTSP stream.

If you do not go to you page or after you exit page, webrtc streamer will think there is still user of RTSP stream and will continue to receive video data from RTSP source.

We should detect dead webrtc streams and remove them from stream users in PeerConnectionManager so that RTSP stream also get closed when not used anymore.

rtmp support?

Michel,
Any plans to support rtmp URLs in webrtc-streamer? DJI drones and others have a provision to stream live video to a custiom nginx-rtmp server and having a flash player for playback is not a long term option and webrtc-streamer would be the perfect solution to transform the rtmp to a browser-friendly format with all the video bitrate adaptation etc as a bonus.
Thanks

Add ability to specify max_bitrate and codec in URL query parameters

Enhancement request. Similar to the ability to specify new rtsp URLs as part of the query parameters string, it would be nice to specify max bitrate and codec used . These query parameters can then be used to perform the appropriate sdp munging to instruct webrtc to control/override the defaults which is as high as 2Mbit VP8

Error parsing SPS when using TCP

This is maybe not related to TCP, but when I tried new feature to use rtsp over tcp.
So, my old camera works only over TCP, so I tried it today and got "cannot parse sps" message, then I did following change and then it works correctly, I checked and it still works with other cameras using udp.
Unfortunately I do not know much about sps and it's format, so leaving to you to decide if fix is ok.

diff --git a/src/rtspvideocapturer.cpp b/src/rtspvideocapturer.cpp
index 18757eb..740420f 100644
--- a/src/rtspvideocapturer.cpp
+++ b/src/rtspvideocapturer.cpp
@@ -80,7 +80,7 @@ bool RTSPVideoCapturer::onData(const char* id, unsigned char* buffer, ssize_t si
                m_cfg.clear();
                m_cfg.insert(m_cfg.end(), buffer, buffer+size);
                
-               rtc::Optional<webrtc::SpsParser::SpsState> sps = webrtc::SpsParser::ParseSps(buffer+sizeof(marker)+webrtc::H264::kNaluTypeSize, size-sizeof(marker)-webrtc::H264::kNaluTypeSize);       
                
+               rtc::Optional<webrtc::SpsParser::SpsState> sps = webrtc::SpsParser::ParseSps(buffer, size);
                if (!sps)
                {       
                        LOG(LS_ERROR) << "cannot parse sps" << std::endl;

If you need access to this camera, let me know I can put it on public.

BR,
Tihomir

Build failed oo few arguments to function ‘webrtc::SessionDescriptionInterface* webrtc::CreateSessionDescription(const string&, const string&, webrtc::SdpParseError*)’

Build reports :

PeerConnectionManager.cpp: In member function ‘void PeerConnectionManager::setAnswer(const string&, const string&)’:
PeerConnectionManager.cpp:96:101: error: too few arguments to function ‘webrtc::SessionDescriptionInterface* webrtc::CreateSessionDescription(const string&, const string&, webrtc::SdpParseError*)’
  webrtc::SessionDescriptionInterface* session_description(webrtc::CreateSessionDescription(type, sdp));
                                                                                                 ^
In file included from ../src/talk/app/webrtc/peerconnectioninterface.h:78:0,
             from PeerConnectionManager.h:16,
             from PeerConnectionManager.cpp:20:
../src/talk/app/webrtc/jsep.h:127:30: note: declared here
 SessionDescriptionInterface* CreateSessionDescription(const std::string& type,
                          ^
PeerConnectionManager.cpp: In member function ‘void PeerConnectionManager::addIceCandidate(const string&, const string&)’:
PeerConnectionManager.cpp:130:114: error: too few arguments to function ‘webrtc::IceCandidateInterface* webrtc::CreateIceCandidate(const string&, int, const string&, webrtc::SdpParseError*)’
  rtc::scoped_ptr<webrtc::IceCandidateInterface> candidate(webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp));
                                                                                                              ^
In file included from ../src/talk/app/webrtc/peerconnectioninterface.h:78:0,
             from PeerConnectionManager.h:16,
             from PeerConnectionManager.cpp:20:
../src/talk/app/webrtc/jsep.h:75:24: note: declared here
 IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid,
                    ^
Makefile:35: recipe for target 'webrtc-server' failed

Docker build

Hi there,

For those of us having troubles compiling and linking webrtc, would you consider providing a Docker image with the a webrtc revision you know to be compatible ?

An alternative could be to pin the webrtc revision to a guaranteed compatible version.

What do you think?

Local video -To-> WebRTC-To->RTSP [question]

Hi Mr Promonet,
I would like to ask a question about the rtsp streaming part.
I read well your code but still i have some interrogations.
My question is : If i want to implement my own video capture system : Local FFMPEG Capture on a local video source and stream via Live555.
Where do i need to cut ? Is the parsing of the candidate and registration of the IP is enough ? Is it possible to have any clues please ?

Thank you for your work and time.

[Question] - What Commit of webrtc?

Hi,

Thank you for your time and code.

I tried with last webrtc, but commit a1991c517598fda9c9c0cf8876886e3968436ff9
removes http code

webrtc commit

Removing HTTPS and SOCKS proxy server code.

And not found webrtc/base/httpcommon-inl.h

And then I get

conversion Error cricket::VideoCapturer*’ to std::unique_ptr<cricket::VideoCapturer>

Thank you!!

add a new mode to simply relay rtp stream instead of transcode ?

Michel,
Would it be possible to have a mode in webrtc-streamer to simply retrieve the rtsp using live555helper and then proxy the rtp media to the browser and not transcode at all. I understand transcoding gives us all the goodness of webrtc bandwidth adaptation but in some cases we want something very lightweight

I know you initially contributed to the janus streaming plugin but it does not play rtsp streams as well as this project does. This is an enhancemnet request.

Thanks for your consideration

Blank page with none of the local capture devices enumerated

I just built HEAD of webrtc-server and when I run it without any rtsp URLs, it does not enumerate any of the local capture devices to select from. I just get a blank page. Has the usage changed?

./webrtc-server__Release
Logger level:4
[000:000] [26594] (audio_device_generic.cc:51): BuiltInAECIsAvailable: Not supported on this platform
[000:000] [26594] (audio_device_generic.cc:61): BuiltInAGCIsAvailable: Not supported on this platform
[000:000] [26594] (audio_device_generic.cc:71): BuiltInNSIsAvailable: Not supported on this platform
[000:000] [26594] (adm_helpers.cc:47): Unable to set recording channel to kChannelBoth.
HTTP Listen at 0.0.0.0:8000
STUN Listening at 127.0.0.1:3478

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.