Wednesday, 5 April 2017

Connect a remote Ip camera as a Webrtc client

I have 2 cameras:

  • An internal webcam embedded in my laptop.
  • A remote IP camera that is connected to my laptop through Wifi (transmits TCP, raw H264 data - no container). I'm getting the stream using node.js.

My goal is to create a Webrtc network and connect the remote camera as another client.

I'm trying to figure out possible solutions:

  • My naive thinking was that I would stream the remote camera payload to the browser. But as I came to understand the browser can't handle the stream without a container. Fair enough. But I don't understand why it does handle the video stream that arrives from my internal camera (from the navigator.getUserMedia() function). what's the difference between the two streams? why can't I mimic the stream from the remote camera as the input?
  • To bypass this problem I thought about creating a virtual camera using Manycam (or Manycam like app). To accomplish that I need to convert my TCP stream into an RTP stream (in order to feed Manycam). Though I did saw some info in ffmpeg command line, I couldn't find info in their node.js api package "fluent-ffmpeg". Is it possible to do it using fluent-ffmpeg? Or only using the command line tool? Would it require another rtp server in the middle such as this one?.
  • Third option I read about is using node.js as a client in Webrtc. I saw it was implemented in "simple-peer". I tried it out using their co-work with socket.io (socket.io-p2p). unfortunately I couldn't get it to work /: When i'm trying to create a socket/peer in the server - it throws errors, as it expect options that are only available on the client-side (like window, location, etc.). Am I doing something wrong? maybe there is more suitable framework for this matter?
  • Forth option is to use a streaming server in the middle such as Kurnto. From my understanding it receives rtp as an input and transmits it as a webrtc client. I feel it's the most excessive option, but maybe it's not so bad (I have to admit that I haven't investigate this option yet).

any thoughts?

thanks!



via idosh

No comments:

Post a Comment