Code Monkey home page Code Monkey logo

kclyu / rpi-webrtc-streamer Goto Github PK

View Code? Open in Web Editor NEW
616.0 616.0 106.0 62.7 MB

This repo's objective is providing something like Web Cam server on the most popular Raspberry PI hardware. By integrating [WebRTC](https://webrtc.org/native-code/) and Raspberry PI, we can stream the Raspberry camera feed to browser or native client which talks WebRTC.

License: Other

Makefile 1.09% Shell 0.19% Python 4.41% C++ 62.01% C 23.25% HTML 0.74% JavaScript 7.73% CSS 0.58%
h264 raspberry-camera raspberry-pi raspberry-pi-camera raspberry-webrtc video-streaming webrtc webrtc-streamer webrtc-video

rpi-webrtc-streamer's People

Contributors

dandelany avatar kclyu 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

rpi-webrtc-streamer's Issues

Do you have any working configuration on Audio?

It is not easy to buy as many hardware as possible for the test, and there is not really much time to test it. If you have successfully set up your audio with your Raspberry PI and have verified audio transmission from RWS, please share it. I think it will help a lot of others.

Please add the comment to the issue as shown below.

  • Device Type: (USB dongle | USB microphone | Raspberry PI audio hat | etc)
  • Device Name: (Device Model)
  • Command Output:
    • lsusb
    • cat / proc / asound / cards

Running on Raspberry Pi Zero W

Hello,

I was giving the pi zero deb package a try on my pi zero w and cant seem to get it running properly.

Configuration:

  • Pi Zero W
  • Pi Camera v2
  • Pi running Stretch, no X Server
  • Testing from ubuntu PC on LAN

RWS service starts and I am able to navigate to the native-peerconnection test page. When I start the connection I hear the speaker on my Pi click, then the Pi becomes very slow and unresponsive, with no video being transmitted to the browser on PC.

I have tried various settings and using low resolution and lower frame rate in the config files to same result.

Any advice on what I should look into to diagnosis this issue further?

Thanks

How to make it work with USB Camera

I connected a USB cam but I was not able to access it from webrtc, although I can access it from fswebcam. Kindly advise.

pi@raspberrypi:/opt/rws $ sudo ./webrtc-streamer

Using config file base path:CWD
Using message logging log directory in CWD
Using CWD log is for only development support feature do not use deployment/packaging environment
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: mmal_port_parameter_set: no port

Building WebRTC for Raspberry Pi Zero

Hi;

In "Building RPi-WebRTC-Streamer in Ubuntu", what is the correct configuration in arm_build/args.gn for Raspberry Pi Zero? I guess the default configuration is for Raspberry Pi 3.

Thanks in advance.

Bests,
Vahid

issue about peer between linux and android

hi kclyu.

last time i meet a problem in my application that android failed set sdp from remote linux ,
and log prompt me that "failed to set video send codecs".
now i have solved this problem by remove codec number 97 98 from sdp created by linux pc.

i found that is very easy leads to sdp negotiation failure between cross-platform peer connection,
and i want to know that if you meet this problem and how does you solve it.

Best regards.

Why does PeerConnection add a fake video track.

Hi
I'm confused about peerconnection add a fake video track,this generated sdp does not include
video unit?
Or say that,i'm trying to create peerconnection in my demo and i add local video track just like webrtc offical demo do that.but when i send generated sdp to remote,remote set sdp failed and report error just like "failed to set video send codecs".So i try to find a answer.
Could tell me about it?
best regards.

Deb file are not working

I know it's a work in progress, and thank you for you work on this project.
I've got an issue with the deb's:

sudo dpkg -i rws_0.72.0_armhf.deb.1
dpkg-deb: error: 'rws_0.72.0_armhf.deb' is not a debian format archive
dpkg: error processing archive rws_0.72.0_armhf.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing: rws_0.72.0_armhf.deb

MMAL re-init sometimes fails

Hi, I am mostly opening this issue to tell that this is a super-genius project. It is exactly what I thought is needed when I played with WebRTC Janus server before. Not a huge thing cobbled together out of lots of components, but a slim native implementation of WebRTC, in a small 2.4 MB package. The protocol is the way to go, because of native support in browsers. No other solution gives really live video on smartphone browsers.

Now with my early tries sometimes the process was pegging CPU at 100% when the resolution was being scaled up, so the video started to lag behind. Not sure why.

So, I limited it to 640x480 and 1500000 bps max. But the the MMAL re-init would start to fail:

 (raspi_quality_config.cc:147): Bitrate changed from 814, to 818
 (raspi_quality_config.cc:147): Bitrate changed from 818, to 821
 (raspi_quality_config.cc:147): Bitrate changed from 821, to 826
 (raspi_quality_config.cc:147): Bitrate changed from 826, to 828
 (raspi_quality_config.cc:147): Bitrate changed from 828, to 829
 (raspi_quality_config.cc:147): Bitrate changed from 829, to 841
 (raspi_quality_config.cc:147): Bitrate changed from 841, to 873
 (raspi_quality_config.cc:147): Bitrate changed from 873, to 875
 (raspi_quality_config.cc:147): Bitrate changed from 875, to 877
 (raspi_quality_config.cc:147): Bitrate changed from 877, to 881
 (raspi_quality_config.cc:147): Bitrate changed from 881, to 884
 (raspi_quality_config.cc:147): Bitrate changed from 884, to 896
 (raspi_quality_config.cc:147): Bitrate changed from 896, to 909
 (raspi_quality_config.cc:147): Bitrate changed from 909, to 915
 (raspi_quality_config.cc:147): Bitrate changed from 915, to 969
 (raspi_quality_config.cc:147): Bitrate changed from 969, to 983
 (raspi_quality_config.cc:248): BestMatch Resolution (end of loop): 640x480
 (raspi_encoder.cc:234): Resolution Changing by Bitrate Changing To : 0x0
 (mmal_wrapper.cc:289): ReinitEncoder 0x0@30, 0 kbps
 (mmal_wrapper.cc:295): EncoderDelay Status changed from INIT_PASS to WAITING
 (mmal_wrapper.cc:503): Start reinitialize the MMAL encode wrapper.0x0@30, 0kbps
 (mmal_wrapper.cc:740): capture stopped.
 mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
 mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0xb4f227a0 (EINVAL)
 mmal: camera viewfinder format couldn't be set
 (mmal_wrapper.cc:542): Failed to create camera component
 (mmal_wrapper.cc:297): Failed to reinitialize MMAL encoder
 (raspi_encoder.cc:240): Failed to reinit MMAL encoder
 (raspi_quality_config.cc:147): Bitrate changed from 983, to 989
 (raspi_quality_config.cc:248): BestMatch Resolution (end of loop): 640x480
 (raspi_encoder.cc:234): Resolution Changing by Bitrate Changing To : 0x0
 (mmal_wrapper.cc:289): ReinitEncoder 0x0@30, 0 kbps
 (raspi_quality_config.cc:147): Bitrate changed from 989, to 1014
 (raspi_quality_config.cc:248): BestMatch Resolution (end of loop): 640x480
 (raspi_encoder.cc:234): Resolution Changing by Bitrate Changing To : 0x0
 (mmal_wrapper.cc:289): ReinitEncoder 0x0@30, 0 kbps
 (mmal_wrapper.cc:335): EncoderDelay Status changed from WAIT to PASS
 (video_send_stream.cc:960): SignalEncoderTimedOut, Encoder timed out.
 (bitrate_allocator.cc:191): UpdateAllocationLimits : total_requested_min_bitrate: 0bps, total_requested_padding_bitrate: 0bps
 (bitrate_allocator.cc:83): Current BWE 1014440
 (mmal_wrapper.cc:807): MMAL force key frame encoding
 (rtp_rtcp_impl.cc:175): Process: Timeout: No increase in RTCP RR extended highest sequence number.

So I disabled dynamic resolution for now, even though it is super-cool. It is more important to be reliable.

Bitrate switches happen really frequently. Is this necessary? I think every few seconds could be sufficient?

Are you going to put out newer deb builds? The building procedure seems to be relatively complicated.

add timestamp in video stream

Hi kclyu,

Thanks for this great work. I wonder whether an optional timestamp could be added into video stream? It is helpful to make me know whether the stream is live or not when under some static scene.

BR,

Problem with chrome under Windows OS

Thanks for the interesting piece of code. That's a great idea.

On the front end side, it's working like a charm under chrome / Debian.
For some reasons, I can't make it working on chrome / Windows. The h264 flag is enabled as required. Also, the chrome release on Win 10 is much recent than the one on Debian so I would not expect that.

The play event is triggered by JS, however nothing happens. The browser is communicating but there is no video. Do you have any clue of what could be the problem? Thanks a lot!

iOS 11 support

Hey this is an excellent work! I can finally watch my own room from work now ! So cool and I will probably control a remote car to move arround and follow my little baby.
Recently iOS 11 is released ,with WebRTC support , does any body know how to make it work on iphone? I'm working on it , still have no luck yet. Hope we can watch live video on iphone soon!

Program crash after connect rasbperry pi zero

Hi,
I have newest program with newest webrtc and after click conenct at site . Application crashes.
I'm using rasbperry pi zero W

there are logs :
logs.txt

application at sctoud prints :
terminating Aborted
and thats all. As You see at file logs webrtc cannot initialize microphone. I dont have and also didnt have microphone or speakers when using old verion of program (which works details below). I also at media_config.conf change to false all setitngs starts with audio but it ddint help.

with previous version of webrtc and your program (I had version from Jun 24.and this version was before they changed packages) application works perfectly

Thank You,

Only one connected browser

What is the reason You made possibility to connect only one browser at the same time ?
I'm just curious was it only one of your assumption or there was some problems to keep streaming to two sessions at the same time.
Regards,
Adrian

view stream from multiple browsers at the same time

Hi Lyu,

First of all, this is an awesome project, well done!
I tried mpeg-dash streaming with Shaka player but was not possible to get it realtime.
Your solution is really real time with around 100ms delay, which is awesome.

My question is how I can connect multiple browser clients at the same time to the rpi-webrtc-streamer.
Currently, I am only able to connect 1 browser at the same time to the rpi-webrtc-streamer.
Would be nice to view the stream from multiple clients.

I see the following in the log when I try to connect with another browser while one browser is already connected.

1976 [5450:720] [435] (websocket_server.cc:346): Found handler URI in config : /rws/ws
1977 [5450:720] [435] (websocket_server_callback.cc:551): URI Path exist /rws/ws
1978 [5450:720] [435] (websocket_server_callback.cc:453): LWS_CALLBACK_ESTABLISHED
1979 [5450:723] [435] (websocket_server_callback.cc:465): CallbackLibWebsocketsLWS_CALLBACK_CLOSED

My question:
Is this possible to view stream from multiple browsers at the same time? If yes, what should be changed to make that work? Or do I have to change some settings?

Anyways keep up the excellent work!

Thank you,
Luc

Saw it was already answered in closed issues. sorry for the duplicate.

RPI Audio Streaming?

First of all, great project! I was wondering if it is also possible to transfer audio streams using WebRtc on the Raspberry PI using your framework. I couldn't find anything related to audio streaming in your documentation.

Stream to multiple users at the same time

Hi. Thanks for the great Repo. I want to use this package to stream the pi camera frames to multiple users at the same time. As far I see, there is a limitation of only one client to access the stream. Is there any way to increase this number? Is it a hardware-related constraint?
Thanks in advance

Process abort running at FullHD resolution

Hello.
Every time when camera reaches FullHD resolution (1920x1080) with bitrate above 8 mbit/s i get segfault from vc.ril.video_encode thread (gdb). I turned on debug messages in mmal_wrapper.cc and get the following output:
(mmal_wrapper.cc:148): frame_buf_pos : 131120, buffer length: 5843

Fatal error in mmal_wrapper.cc, line 151
last system error: 0
Check failed: (int)(frame_buf_pos_ + buffer->length) < size_

Aborted

What can be a reason for such bahavior?
Thank you in advance....

speaker implementation

hi,

Does it possible to send the rtc client audio (with getUserMedia() ) to a pi speaker?
i meen if i send the web client media, may i get it from pi speaker if yes please give me a direction

thanks, looking for your support

Receive h.264 frames over ports supported by RWS

I was trying to obtain the stream through direct socket via port 8888. As soon as I visit port 8888, RWS shuts down.

It will run again after some time, but may I know the reason behind this?

● rws.service - Rpi WebRTC Streamer
   Loaded: loaded (/lib/systemd/system/rws.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2018-03-29 16:35:04 +08; 507ms ago
  Process: 20017 ExecStart=/opt/rws/webrtc-streamer --log /opt/rws/log (code=exited, status=255)
 Main PID: 20017 (code=exited, status=255)

Mar 29 16:35:04 raspberrypi systemd[1]: Unit rws.service entered failed state.

Sometimes, it shows this.

● rws.service - Rpi WebRTC Streamer
   Loaded: loaded (/lib/systemd/system/rws.service; enabled)
   Active: activating (auto-restart) (Result: signal) since Thu 2018-03-29 16:45:18 +08; 2s ago
  Process: 20297 ExecStart=/opt/rws/webrtc-streamer --log /opt/rws/log (code=killed, signal=SEGV)
 Main PID: 20297 (code=killed, signal=SEGV)

Mar 29 16:45:18 raspberrypi systemd[1]: Unit rws.service entered failed state.

Attempting to run on docker

Hello,
I've started playing with your project yesterday on my RPi 3.

My objective is to create an electric RC car built out of lego completely controlled via WebRTC.

With the aim of making things modular, I would like to contribute to the project adding 2 Dockerfiles:

  1. a docker image to build the deb package or the binaries
  2. a docker image to run rws in a container

I'm starting with a Docker image to run rws in a container.

This is my first attempt:

FROM resin/rpi-raspbian

RUN apt-get update -y 

ADD https://github.com/kclyu/rpi-webrtc-streamer-deb/raw/master/rws_0.73.1_armhf.deb /tmp/

RUN dpkg -i /tmp/rws_0.73.1_armhf.deb

RUN apt-get install libasound2

ENV LD_LIBRARY_PATH /opt/vc/lib

RUN sed -i 's/wss:/ws:/g' /opt/rws/web-root/native-peerconnection/js/main_rws.js

EXPOSE 8888
EXPOSE 8889

CMD /opt/rws/webrtc-streamer --verbose

You can try to build & run it using the following:

docker build -t rpi-webrtc-streamer:1.0 .
docker run --rm -p 8889:8889 -p 8888:8888 --device /dev/vchiq -v /opt/vc/lib:/opt/vc/lib rpi-webrtc-streamer:1.0

My current status:

  • The audio is not yet supported, and it will require to expose the audio device to the docker container plus add the configuration files for alsa
  • The configuration files for rws are the default ones, and I'll try to make them exposed via a volume (you can already do that using the docker run params)
  • I have to patch the secure web socket in the Javascript file as I get an error when connecting to WSS endpoint (I tried both from localhost, 127.0.0.1 or the local ip in my network)
  • When I try to connect from the RPi locally, I manage to see the video but the STUN pings seem to not work correctly:
(port.cc:1624): Jingle:Conn[0x74e182d0:audio:OzvntcD9:1:0:local:udp:172.17.0.x:53571->r35AAXMd:1:2113937151:local:udp:192.168.1.x:33842|C--I|0|0|9079290933588934143|-]: Sent STUN ping, id=694f797068617331625a744b, use_candidate=1, nomination=0
(network.cc:838): Connect failed with 99
(port.cc:1624): Jingle:Conn[0x74e182d0:audio:OzvntcD9:1:0:local:udp:172.17.0.x:53571->r35AAXMd:1:2113937151:local:udp:192.168.1.x:33842|C--I|0|0|9079290933588934143|-]: Sent STUN ping, id=4c322f6f4971413775653632, use_candidate=1, nomination=0
(port.cc:1624): Jingle:Conn[0x74e182d0:audio:OzvntcD9:1:0:local:udp:172.17.0.x:53571->r35AAXMd:1:2113937151:local:udp:192.168.1.x:33842|C--I|0|0|9079290933588934143|-]: Sent STUN ping, id=6734376233364e2b4e4b734c, use_candidate=1, nomination=0
(bitrate_allocator.cc:88): Current BWE 2042252
(port.cc:1624): Jingle:Conn[0x74e182d0:audio:OzvntcD9:1:0:local:udp:172.17.0.x:53571->r35AAXMd:1:2113937151:local:udp:192.168.1.x:33842|C--I|0|0|9079290933588934143|-]: Sent STUN ping, id=7032524451384a465541704b, use_candidate=1, nomination=0
(network.cc:838): Connect failed with 99
...
(port.cc:1369): Jingle:Conn[0x74e182d0:audio:OzvntcD9:1:0:local:udp:172.17.0.x:53571->r35AAXMd:1:2113937151:local:udp:192.168.1.x:33842|C--I|0|0|9079290933588934143|-]: Timed out after 15218 ms without a response, rtt=6000
(p2ptransportchannel.cc:1597): Jingle:Channel[audio|1|RW]: Transport channel state changed from 1 to 2
(transportcontroller.cc:1051): audio TransportChannel 1 state changed. Check if state is complete.
(port.cc:1671): Connection deleted with number of pings sent: 25
(p2ptransportchannel.cc:2015): Jingle:Channel[audio|1|RW]: Removed connection 0x74e182d0 (1 remaining)
(peerconnection.cc:4871): Changing to ICE completed state because all transports are complete.
(peerconnection.cc:3064): Changing IceConnectionState 2 => 3
(network.cc:838): Connect failed with 99
(bitrate_allocator.cc:88): Current BWE 2080665
(network.cc:838): Connect failed with 99
(network.cc:838): Connect failed with 99
(bitrate_allocator.cc:88): Current BWE 2565925
(network.cc:838): Connect failed with 99
(network.cc:838): Connect failed with 99
(bitrate_allocator.cc:88): Current BWE 2855812
(network.cc:838): Connect failed with 99
(network.cc:838): Connect failed with 99
(network.cc:838): Connect failed with 99
(bitrate_allocator.cc:88): Current BWE 3020180
(network.cc:838): Connect failed with 99
(network.cc:838): Connect failed with 99
  • When I try to access from another client (a Windows 10 machine running Chrome 64 or Firefox 58), I get no video, but no error on the console. The logs of the process can be checked at this link

The error is triggered at this line in the attempt to resolve the public address connecting to the Google DNS.

Let me know how I can proceed further, any direction/hint would be appreciated.

Best regards,
Luca

auto reconnect

Sometimes the video is freezed, "Connect" button is still disabled and "Disconnect" button is enabled.
I had to click "Disconnect" then "Connect" to recover the video.
Is there any chance it could recover the connection automatically?

Host Architecture arm is not supported

While running gclient sync, getting 'ERROR: Command '/usr/bin/python src/third_party/binutils/download.py' returned non-zero exit status 1 in /home/pi/Workspace/webrtc

Segfault while Chrome is connecting

When I push the connect button, the server crashes:

(basicportallocator.cc:1134): Jingle:Net[wlan0:192.168.1.0/24:Unknown]: Allocation Phase=Relay
(streamer.cc:297):  Received session description : "{"type":"answer","sdp":"v=0\r\no=- 6848690051349680870 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 9 0 8 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:YE6P\r\na=ice-pwd:V6QJbfO0JFFHXYsmPrDIURJN\r\na=fingerprint:sha-256 AE:DE:C6:92:D1:4C:AF:D0:B9:FC:8F:36:52:73:C8:F7:9C:0F:76:C9:4E:07:68:F7:F9:B1:DA:37:28:15:18:33\r\na=setup:active\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:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\nm=video 9 UDP/TLS/RTP/SAVPF 100 96 98 127 104 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:YE6P\r\na=ice-pwd:V6QJbfO0JFFHXYsmPrDIURJN\r\na=fingerprint:sha-256 AE:DE:C6:92:D1:4C:AF:D0:B9:FC:8F:36:52:73:C8:F7:9C:0F:76:C9:4E:07:68:F7:F9:B1:DA:37:28:15:18:33\r\na=setup:active\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:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\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: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:127 red/90000\r\na=rtpmap:104 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=127\r\n"}"
(stream_data_sockets.cc:111): GetSessionEntry
(stream_data_sockets.cc:116): Search Session 0xf9f110, id: 2, target: 2
(basicportallocator.cc:1134): Jingle:Net[wlan0:2a01:cb00:a1c:8c00::/64:Unknown]: Allocation Phase=Relay
(webrtcvideoengine2.cc:1325): Call stats: 1778819, {send_bw_bps: 300000, recv_bw_bps: 0, max_pad_bps: 0, pacer_delay_ms: 0, rtt_ms: -1}
(basicportallocator.cc:1134): Jingle:Net[wlan0:192.168.1.0/24:Unknown]: Allocation Phase=Relay
(webrtcsession.cc:1080): BUNDLE already enabled for audio on audio.


#
# Fatal error in ../webrtc/p2p/base/transportcontroller.cc, line 241
# last system error: 88
# Check failed: network_thread_->IsCurrent()
# 
#
(basicportallocator.cc:1134): Jingle:Net[wlan0:2a01:cb00:a1c:8c00::/64:Unknown]: Allocation Phase=Relay

==== C stack trace ===============================

./webrtc-streamer() [0x2825d4]
./webrtc-streamer() [0x59b738]
./webrtc-streamer() [0x24e5c4]
./webrtc-streamer() [0x24e87c]
./webrtc-streamer() [0x24d8fe]
./webrtc-streamer() [0x24cf58]
./webrtc-streamer() [0x1f31e2]
./webrtc-streamer() [0x1b9c6e]
./webrtc-streamer() [0x1b8706]
./webrtc-streamer() [0x1a55b6]
(basicportallocator.cc:1134): Jingle:Net[wlan0:192.168.1.0/24:Unknown]: Allocation Phase=Relay
./webrtc-streamer() [0x38b0f2]
./webrtc-streamer() [0x3ad35e]
./webrtc-streamer() [0x3acc9e]
./webrtc-streamer() [0x3acc7c]
Aborted

I am using the master branch here, since the branch56 is missing some header files.

Thanks!

Trouble compiling for pizero

I'm running into the following compile error when running make on rpi-web-streamer:

arm-linux-gnueabihf-g++: error: unrecognized argument in option ‘-march=x86-64’

Full output

justin@justin-VirtualBox:~/Workspace/rpi-webrtc-streamer/src$ make
arm-linux-gnueabihf-g++ --sysroot=/opt/rpi_rootfs    -I. -DINSTALL_DIR=\"/opt/rws\" -Wno-deprecated-declarations -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -B../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -m64 -march=x86-64 -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-ignored-pragma-optimize -O0 -fno-omit-frame-pointer -g2 -gsplit-dwarf -ggnu-pubnames -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wc++11-narrowing -Wimplicit-fallthrough -Wthread-safety -Winconsistent-missing-override -Wundef -Wunused-lambda-capture -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/gtk-3.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/at-spi2-atk/2.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/at-spi-2.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/dbus-1.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/dbus-1.0/include -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/gtk-3.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/gio-unix-2.0/ -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/cairo -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/pango-1.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/harfbuzz -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/pango-1.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/atk-1.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/cairo -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/pixman-1 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/freetype2 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/libpng16 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/gdk-pixbuf-2.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/libpng16 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem/home/justin/Workspace/webrtc/src/build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wno-multichar -Wno-unused-but-set-variable -fPIC -O3 -DDEBUG -DEGL_SERVER_DISPMANX -DHAVE_CMAKE_CONFIG -DHAVE_VMCS_CONFIG -DOMX_SKIP64BIT -DTV_SUPPORTED_MODE_NO_DEPRECATED -DUSE_VCHIQ_ARM -DVCHI_BULK_ALIGN=1 -DVCHI_BULK_GRANULARITY=1 -D_FILE_OFFSET_BITS=64 -D_HAVE_SBRK -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_REENTRANT -D__VIDEOCORE4__ -D__WEBRTC_DEFAULT__ -DINSTALL_DIR=\"/opt/rws\" -Wall -fvisibility=hidden -pthread -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++11 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../webrtc/src/buildtools/third_party/libc++/trunk/include -isystem../../webrtc/src/buildtools/third_party/libc++abi/trunk/include --sysroot=../build/linux/debian_sid_amd64-sysroot -fvisibility-inlines-hidden -Wnon-virtual-dtor -Woverloaded-virtual -Wno-multichar -Wno-unused-but-set-variable -fPIC -O3 -DDEBUG -DEGL_SERVER_DISPMANX -DHAVE_CMAKE_CONFIG -DHAVE_VMCS_CONFIG -DOMX_SKIP64BIT -DTV_SUPPORTED_MODE_NO_DEPRECATED -DUSE_VCHIQ_ARM -DVCHI_BULK_ALIGN=1 -DVCHI_BULK_GRANULARITY=1 -D_FILE_OFFSET_BITS=64 -D_HAVE_SBRK -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_REENTRANT -D__VIDEOCORE4__ -D__WEBRTC_DEFAULT__ -D__RWS_VERSION__=\"v0.73-11-g0a82b8cb13409a10bc24a8a22f8f3393\" -D__WEBRTC_VERSION__="\"23ffbe78f3b386769b2a2e3fc301df31,Cr-Commit-Position:refs/heads/master@{#22695}\"" -I/home/justin/Workspace/rpi-webrtc-streamer/lib/libwebsockets/arm_build -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"328575-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_GLIBCXX_DEBUG=1 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DHAVE_SCTP -DUSE_BUILTIN_SW_CODECS -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_LINUX -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE -I/home/justin/Workspace/webrtc/src  -I../../webrtc/src -I../../webrtc/src/arm_build/gen -I../../webrtc/src/third_party/libyuv/include -I../../webrtc/src/third_party/jsoncpp/overrides/include -I../../webrtc/src/third_party/jsoncpp/source/include  -I/opt/rpi_rootfs/opt/vc/include/interface/vcos/pthreads -I/opt/rpi_rootfs/opt/vc/include/interface/vmcs_host/linux -I/opt/rpi_rootfs/opt/vc/include/interface/vmcs_host -I/opt/rpi_rootfs/opt/vc/include/interface/vmcs_host/khronos -I/opt/rpi_rootfs/opt/vc/include/interface/khronos/include -I/opt/rpi_rootfs/opt/vc/include/interface/vchiq_arm -I/opt/rpi_rootfs/opt/vc/include -I/opt/rpi_rootfs/opt/vc/include/interface/mmal   -c websocket_server.cc -o websocket_server.o
arm-linux-gnueabihf-g++: error: unrecognized argument in option ‘-march=x86-64’
arm-linux-gnueabihf-g++: note: valid arguments to ‘-march=’ are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a armv8-a+crc iwmmxt iwmmxt2 native
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-fcolor-diagnostics’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Xclang’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-mllvm’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Xclang’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-instcombine-lower-dbg-declare=0’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-m64’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wimplicit-fallthrough’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wthread-safety’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wheader-hygiene’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wstring-conversion’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wtautological-overlap-compare’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wc++11-narrowing’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wimplicit-fallthrough’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wthread-safety’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Winconsistent-missing-override’
arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-Wunused-lambda-capture’
Makefile:74: recipe for target 'websocket_server.o' failed
make: *** [websocket_server.o] Error 1

Any ideas? Likely unrelated, but the only difference I did than your doc was needing to add the following directory link to get websockets to build:

sh ../mk/config_libwebsockets.sh
...
start building libwebsockets library
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:134 (project):
  The CMAKE_C_COMPILER:

    /home/justin/tools/rpi_tools/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.
cd ~/tools
ln -s ~/Workspace/rpi_rootfs/tools/ rpi_tools

Thanks!
Justin

Adjusting brightness

What would be the recommended way for one to adjust the brightness of the camera? I'm currently using the .deb package, and adjusting the brightness would be helpful to improve the image we're getting.

How can i extract the webrtc library used by rws?

Hi kclyu,
I want to extract the webrtc library used by rws to my arm-linux device.
For some reason,i can't compile webrtc linux library myself.
So i want to know whether the direct use of rws library,if not , could you tell me how to compile
arm-linux webrtc library? i only get x86-linux webrtc library.
best regards.

Direct video stream

I installed rws on a RPI 3, the native peer connection works like a charm!
I need to read the video stream with OpenCV in a Windows c# application and in a Linux c++ application, is it possible to have a direct stream (similar in example to a RSTP stream) that can be directly read from OpenCV?

Video resolution stuck at 640x480

Works great on my Rpi Zero W, but I can't get the resolution to be anything but 640x480. My config file is below media_config.conf is below. Running rws_0.72.0_RaspiZeroW_armhf.deb. Any ideas?

max_bitrate=3000000
use_4_3_video_resolution=false
video_rotation=0
video_hflip=true
video_vflip=true
use_dynamic_video_resolution=false
fixed_video_resolution=1280x720
video_resolution_list_4_3=320x240,400x300,512x384,640x480,1024x768,1152x864,1296x972,1640x1232
video_resolution_list_16_9=384x216,512x288,640x360,768x432,896x504,1024x576,1152x648,1280x720,1408x864,1920x1080
audio_processing_enable=false
audio_echo_cancellation=true
audio_gain_control=true
audio_high_passfilter=true
audio_noise_suppression=true
audio_level_control_enable=true

How to make it working with appr.tc

Hi Kclyu,

I like your project, it works perfectly.
I'm really glad, that there is WebRTC support on Raspberry Pi.

I'm wondering, if this your application can work directly with e.g. https://appr.tc/.
Is there some part, that needs to be changed, or it is configurable?
I guess the signaling should be somehow changed.

Can you give me some clues?

Thank you.

BR

gn gen arm_build <- problem

Hi,
I'm trying to build my own packages I tried to do everything as You wrote ,but I got error while running this command You wrote notes:

note: You need to replace the whole absolute path in args.gn before doing 'gn gen arm_build'
note: webrtc_build_args.gn was renamed to webrtc_arm_build_args.gn

unfortunetly I dont understand which paths You are talking about, alsoI dont understand note2.
ofcourse i've not changed paths as u suggested My system is Ubuntu 17

ThankYou for this awesome project :)

Regards,
Adrian

Notice for user using latest WebRTC master repo(SimulCast Runtime error)

Recently, SimulCast patch is applied to WebRTC master, and the following error occurs at runtime (RWS build is normal).

#
# Fatal error in ../webrtc/modules/video_coding/generic_encoder.cc, line 236
# last system error: 0
# Check failed: simulcast_svc_idx < timing_frames_info_.size() (0 vs. 0)
# 
#

==== C stack trace ===============================

./webrtc-streamer() [0x22a8b0]
./webrtc-streamer() [0x6c1eee]
./webrtc-streamer() [0x1516e6]
./webrtc-streamer() [0x2302b0]
./webrtc-streamer() [0x22fc0e]
Aborted

If you are using the latest master repo, please use the old WebRTC master repo before patching.
( f79dbadc09255c91b9163449dfa8898a8be29744, Cr-Commit-Position: refs/heads/master@{#18631})

gclient sync --force -r f79dbadc09255c91b9163449dfa8898a8be29744
gn clean arm_build
gn gen arm_build
ninja -C arm_build

Upside Down video

Hi,
is there an option to upside down the video streaming?

Can i set mjpeg as standard codec?

Thanks

build problem

HI,
I try to build your project using instruction:
https://github.com/kclyu/rpi-webrtc-streamer/blob/master/BUILD_ubuntu.md
I had to change the part Building WebRTC with GN build into :

cd ~/Workspace/
git clone https://github.com/kclyu/rpi-webrtc-streamer.git
cd ~/Workspace/webrtc/src
mkdir arm_build
cp ~/Workspace/rpi-webrtc-streamer/misc/webrtc_arm_build_args.gn arm_build/args.gn
cd arm_build
gn gen arm_build
mv -v ./arm_build/* .

without these (cd arm_build and mv -v ./arm_build/* .) I had errors.

and when I called make i got :
afterMake.txt
as i understand WEBRTC_CFLAGS are wrong becasue it has this unrecognize parameters.

Can You Please tell me what i'm doing wrong ?
I even change my ubuntu username to kclyu becasue in build there was references to /home/kclyu/Workspace/cross/.build/src/gcc-linaro-4.9-2015.06/configure from rpi_rootfs. I also download gcc-linaro-4.9-2015.06 into home/kclyu/Workspace/cross/.build/src/ so i have the same configuration as You had.

I'm using newest webrtc sources
Thank You

PS at your tutorial u mention file : cross_arm_gn.mk i think You meant cross_arm_build.mk

Safari / WKWebView support

Hi, is it possible to add support for Safari / WKWebView on iOS? Safari supports WebRTC since iOS 11 / macOS High Sierra, but this example (I tried /native-peerconnection) does not work. Support for Safari would be very nice, because there's no alternative on iOS and I'd like to use this piece of software because the low latency is very nice, especially for a Raspberry Pi.
I saw the fixed issue for iOS 11, but my problem is different. I get a Type error on line 108 of main_rws.js, this happens only on Safari.

Introduce the features of the application

sorry to bother you ,my English is poor, recently I'm working on RPI too, trying to make a Audio and video communication between two RPIs or RPI and PC, I want to know whether your application is samilar too? Can you explain it for me ? thank you very much.

decrease video latency

Hello,
with your program i was able to send vide ( local network ) with 200ms of video delay, Can You please tell me is it possibel to decrease this latency, where to look what to change. I'm using webrtc to control robot thats why its important for me to have as low latency as possible. ThankYou

stdio.h no such files

Hi,
i'm trying to build rpi-webrtc-streamer using cross compiling but i always get this error:

websocket_server.cc:30:19: fatal error: stdio.h: No such file or directory

could you help me?

Thanks

DirectRTC connection through NAT

Hello Lyu,
I successfully installed rws on a Rpi Zero W from your deb package. While the native peer connection works well on port 8889, I am trying to access rws via the android DirectRTCClient.
All works great if the android client is connected on the private LAN, however I can't connect if I try through the public IP (port 8888 being forwarded to the Pi by my router).
On the app I see the local media in fullscreen for a few seconds and then I get the message "ICE connection failed".
On the android logs I successfully see all the ICE candidates being published (host and srflx), but I can't see the logs on the rws. Is there any way to enable debug logs?

If I expose the Pi in DMZ mode the DirectRTCClient works well, so I think it is something related to ports access. Maybe stun is ineffective and I need a turn server?

Really appreciate your work and your help.
Francesco

RWS and Firefox

Did you have a chance to try on Firefox?
Even after applying the correct setup, I am not getting any video:

Firefox: Activate H.264 for WebRTC

In URL address bar, type about:config
In Search:, type h264
The last line of "Preference Name" is:
media.peerconnection.video.h264_enabled and it has the value false.
Double-click on media.peerconnection.video.h264_enabled to make its
value change to true. H.264 is now enabled to WebRTC.
Firefox: Set H.264 as default video codec in place of VP8

Open about:config page
Anywhere in the window, right-click to open contextual menu. Select
NEW --> INTEGER
A dialog window ask for preference name. Type:
media.navigator.video.preferred_codec
Next dialog window ask for the integer value that will be assigned to
the name. Type: 126
126 is the code for H.264 mode 1 in Firefox.
Start a new WebRTC communication. Your Firefox will now propose H.264
mode 1 codec as first option in its offer.

Thanks a lot!

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.