IP CAM in Combination with UV4L and Janus-Gateway (WebRTC)

怎甘沉沦 提交于 2019-12-12 04:09:14

问题


I am employing the use of UV4L with my IP CAM to create a virtual video driver /dev/video1. I am able to get into the API of the UV4L streaming server which has Multiple applications like JITSI, WEBRTC, JANUS etc. I noticed when I try to stream to Janus Video room on a local area connection (LAN) i.e. on my local server I get this message in the terminal

"[6889886769210913] Creating ICE agent (ICE Full mode, controlled)
[6889886769210913] The DTLS handshake has been completed
WebRTC media is now available"

But no media/video stream shows up. I enabled Data channels while compiling Janus, and I also did a webrtc test with my UV4L streaming server which worked fine. But the message with Janus and why the stream doesn't show up in either Chrome or Firefox is what I need help with.

Edit Update to answer a comment:

The link between both is that the uv4l renders my IP cam as virtual device driver, I am using mjpeg driver module. I can then pass different options to the uv4l driver while loading it, for example I use an h264 profile stream from the IP Cam, and I also change it to mjpeg stream as well too. The funny thing is that with the h264 stream, I can run webrtc stream tests on the virtual driver created, even on Janus looking at the debug files, everything seems to work the way its supposed to, after a hangup I get the correct logs e.g

{
   "janus": "hangup",
   "session_id": 8829409609870864,
   "sender": 5037748733677649,
   "reason": "RTCP BYE"
}

My feeds goes over the wire properly tracing with Wireshark just as the successful Webrtc stream tests are displayed over the wire, my packet headers and feeds come out fine as such :

[5037748733677649]  Got an RTCP packet (bundled stream)!
[Tue Sep 26 14:28:25 2017] [5037748733677649] Incoming RTCP, bundling: this is video (remote SSRC: video=2524945001, audio=65486109, got 2524945001)
[Tue Sep 26 14:28:25 2017]    Parsing compound packet (total of 56 bytes)
[Tue Sep 26 14:28:25 2017]      #1 SR (200)
[Tue Sep 26 14:28:25 2017]        RTCP PT 200, length: 28 bytes
[Tue Sep 26 14:28:25 2017]      #2 SDES (202)
[Tue Sep 26 14:28:25 2017]        RTCP PT 202, length: 28 bytes
[Tue Sep 26 14:28:25 2017]   End of compound packet
[Tue Sep 26 14:28:25 2017] [5037748733677649]  Got an RTCP packet (bundled stream)!
[Tue Sep 26 14:28:25 2017] [5037748733677649] Incoming RTCP, bundling: this is audio (remote SSRC: video=2524945001, audio=65486109, got 65486109)
[Tue Sep 26 14:28:25 2017]    Parsing compound packet (total of 56 bytes)
[Tue Sep 26 14:28:25 2017]      #1 SR (200)
[Tue Sep 26 14:28:25 2017]        RTCP PT 200, length: 28 bytes
[Tue Sep 26 14:28:25 2017]      #2 SDES (202)
[Tue Sep 26 14:28:25 2017]        RTCP PT 202, length: 28 bytes
[Tue Sep 26 14:28:25 2017]   End of compound packet

I am thinking the reason why I get no stream is because I am not testing it on an encrypted layer over the browser, i.e am not using HTTPS instead HTTP, or my host windows machine is blocking my guest Linux webrtc stream. These are the areas I tend to investigate upon, I also tried with local host, same result no stream shown, its kind of a complex policy issue for me to create a self signed cert on my VM because of privacy restrictions. I would look further and if I find no alternative I'd create a self signed license on a stanadlone machine to test it. Do you think the ssl issue might be the cause? Update: Same thing with ssl.


回答1:


Just in case anyone might want to try this implementation there are are few things to take into account when configuring the described setup on a Local server, the most important being able to set up a proxy for Janus for the front end web-server (Apache or nginx) and configure the HTML scripts if you choose to use the demos for Janus(i.e streaming.html, text-room, Video-room etc), its also important to note that if you didn't install a renderer for UV4L, the web page demo for UV4L only publishes the stream but you would have to create a canvas to view the stream or use one of the available demo rooms on a web browser(google-chrome or chromium in my instance) as described above.



来源:https://stackoverflow.com/questions/46412464/ip-cam-in-combination-with-uv4l-and-janus-gateway-webrtc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!