Node.js WebRTC Embedded Server

817 views
Skip to first unread message

Jim Carroll

unread,
Mar 21, 2014, 8:42:51 PM3/21/14
to discuss...@googlegroups.com
Hi, all.

I am working on a project that could really benefit from WebRTC. Currently, we are using a basic webcam streaming app to get a video feed from our Linux server, and we're communicating with the system from a browser via WebSockets.

My question is, is there a way we can easily transition our system to use purely WebRTC for streaming and data exchange, and can we do this with Node.js?

With kind regards,

Jim

Jesús Leganés Combarro

unread,
Mar 22, 2014, 6:12:13 AM3/22/14
to discuss...@googlegroups.com
The only available WebRTC library for Node.js is node-webrtc, and it's on alpha status. Version 0.1.0 will be focused on have DataChannels support, I don't believe media streams will be available before 0.2.0. You can help to move it forward, though :-)

Jim Carroll

unread,
Mar 22, 2014, 9:03:58 AM3/22/14
to discuss...@googlegroups.com
Thanks, Jesús.

I may do that, but I have a deadline coming up, so it probably will not be for the purpose of this project.

I see that you are one of the authors. When I tried to "npm install wrtc" I got the following error message.

***
Going to run commnad: /home/jim/node_modules/wrtc/node_modules/node-gyp/bin/node-gyp.js clean in folder /home/jim/node_modules/wrtc/src
.
wrtc module clean complete
npm ERR! wr...@0.0.12 install: `node bin/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the wr...@0.0.12 install script.
npm ERR! This is most likely a problem with the wrtc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node bin/build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls wrtc
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.6-1-ARCH
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "wrtc"
npm ERR! cwd /home/jim
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/jim/npm-debug.log
npm ERR! not ok code 0
***

I have a feeling this is because the Chromium build tools (depot tools) do not work on my system (Arch Linux for ARM). This is unfortunate because I cannot use the tools to build the native WebRTC API either!

Any tips would be appreciated.

Best,

Jim

Jim Carroll

unread,
Mar 22, 2014, 1:01:47 PM3/22/14
to discuss...@googlegroups.com
... the Chromium build tools (depot tools) do not work on my system (Arch Linux for ARM). This is unfortunate because I cannot use the tools to build the native WebRTC API either!

Scratch that. Turns out my environment was using python3 by default, which doesn't support the print command used by the depot tools. A simple fix was to create symbolic links to python2 and python2-config in /usr/local/bin. My PATH variable lists /usr/local/bin before /usr/bin, so the python symlink is hit first.

Note, this only works for scripts that use

#!/usr/bin/env python

Scripts that call python direct with #!/usr/bin/python will use the latest version of python.

Not sure yet if I can build the Native WebRTC project, yet. I'll report back later with an update.

Regards,

Jim

pir...@gmail.com

unread,
Mar 22, 2014, 3:25:34 PM3/22/14
to discuss...@googlegroups.com

I see that you are one of the authors. When I tried to "npm install wrtc" I got the following error message.

I'm a contributor, not an author :-) I only helped to improve the build system and NPM directives, and to clean the classes and make them more compliant with the WebRTC specification.


I have a feeling this is because the Chromium build tools (depot tools) do not work on my system (Arch Linux for ARM). This is unfortunate because I cannot use the tools to build the native WebRTC API either!

Chrome build toolchains fails frequently, we are waiting to SCTP DataChannels to get in the stable branch so we can attach to some particular commits instead of using HEAD, so we don't suffer more build unstabilities.


--
"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton de sitios diferentes, simplemente escribe un sistema operativo Unix."
– Linus Tordvals, creador del sistema operativo Linux

Lorenzo Miniero

unread,
Mar 22, 2014, 4:26:26 PM3/22/14
to discuss...@googlegroups.com
Hi Jim,

I recently released an open source gateway called Janus:

and NICTA started working on a node.js frontend to it:
https://github.com/rtc-io/rtc-janus

I'm not sure this is what you're looking for, but it may be worth a try.

Lorenzo

Jim Carroll

unread,
Mar 22, 2014, 6:32:57 PM3/22/14
to discuss...@googlegroups.com
Ah, sorry for the mix-up. Sounds like you've done your fair share, though.

Chrome build toolchains fail frequently

Yes, I have experienced that. I am now getting this error (after calling gclient sync --force):

***
________ running '/usr/local/bin/python trunk/webrtc/build/gyp_webrtc -Dextra_gyp_flag=0' in '/home/jim/wrk'
Generating gyp files from GN...
Traceback (most recent call last):
  File "trunk/webrtc/build/gyp_webrtc", line 77, in <module>
    if not gyp_chromium.RunGN(gn_vars_dict):
  File "/home/jim/wrk/trunk/build/gyp_chromium", line 338, in RunGN
    return subprocess.call(args) == 0
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
Error: Command /usr/local/bin/python trunk/webrtc/build/gyp_webrtc -Dextra_gyp_flag=0 returned non-zero exit status 1 in /home/jim/wrk
***

Either way, I don't really think we have time to write native code for this project. And it's probably more trouble than it's worth. We'll just have to stick to WebSockets.

Regards,

Jim

pir...@gmail.com

unread,
Mar 22, 2014, 6:38:08 PM3/22/14
to discuss...@googlegroups.com
> Ah, sorry for the mix-up. Sounds like you've done your fair share, though.
>
Well, I'm highly interested on that project both for work and my
personal projects, so if I can help to move it forward... :-)


--
"Si quieres viajar alrededor del mundo y ser invitado a hablar en un
monton de sitios diferentes, simplemente escribe un sistema operativo
Unix."
- Linus Tordvals, creador del sistema operativo Linux

Jim Carroll

unread,
Mar 23, 2014, 12:22:17 PM3/23/14
to discuss...@googlegroups.com
Thanks, Lorenzo.

Looks great. Our project needs to be completely platform independent, so this may not be a viable option. I am going to look into it, though.

Kind regards,

Jim

Jim Carroll

unread,
Mar 23, 2014, 12:24:27 PM3/23/14
to discuss...@googlegroups.com
Great! We are planning on open-sourcing the whole project once we have solidified the concept and design. I'll let you know when we create the repo. We will probably start a mailing list, too. But we have a lot of preliminary work to get out of the way first.

Jim

Jesús Leganés Combarro

unread,
Mar 25, 2014, 9:04:36 AM3/25/14
to discuss...@googlegroups.com

Looks great. Our project needs to be completely platform independent, so this may not be a viable option. I am going to look into it, though.

At my work (kurento.org) we are developing our own MCU and we have experimental Node.js support (in fact, I'm the one that's developing it :-) ), and we are working on port it from Linux to Windows & Mac. If you can, take a look on it and give me your impressions :-)

Eric Davies

unread,
Mar 25, 2014, 11:40:13 AM3/25/14
to discuss...@googlegroups.com
Do you have a chrome or firefox browser running on your linux system that supports WebRTC? If so, you could run a standard nodejs based signalling server and a webrtc based browser client that connected to it, saving yourself a lot of effort though it would have a larger footprint of course.
Reply all
Reply to author
Forward
0 new messages