WebRTC no video with some networks - ruby-on-rails

I create web app with Ruby on Rails using WebRTC for video connections (with SimpleWebRTC: https://simplewebrtc.com/). It works on remote server, and use signalmaster (https://github.com/andyet/signalmaster). Everything works good on most networks, but sometimes there is no remote video. I have callback from videoAdded, but there is completely no video from other peers. I think it might be something with that network configuration, but have no idea what. Does anyone have idea what's wrong?

Related

Jitsi multiple streams handling

I have a Jitsi instance that I would like to share with 50 people for an event. I will mute everyone to make sure that only one or two people are talking at the same time but I wonder if I need to ask people to cut the video too (which would be sad because seeing other people face would be fun).
I know that Jitsi works in peer to peer when only two people are connected but what about a larger room?
Does the server centralise all the video stream?
With more than two participants Jitsi Videobridge will take over (no peer to peer nor H264) and control video streams from clients to server to clients.
As far as I understand it works very much like a turn server.
It strongly depends on your hardware setup. If Jitsi is running on a dedicated machine it should be able to handle this.
On a virtual server on the other hand...

Checking for WebRTC connectivity - reliable methods

I have a live video chat application and I use a TURN server which supports STUN/TURN and both UPD/TCP transmission.
Sometimes users can be connected to the network which blocks that much ports and protocols that WebRTC connection just cannot happen (usually those are corporate networks). I would like to check if a WebRTC connection is possible before users try to connect to each other (actually, perform a technical check).
How can I do it? Ideas I have in my head:
Try to download a hosted chunk of data (audio file, for example) via WebRTC - is it possible and would this be enough to make sure both inbound and outbound connections are open?
Use a TURN server as a host to make a connection to and see if it fails (have no idea if I can do it or not)
Use Flash to try to download/upload a chunk of data over specific ports and protocols. May be even using Cirrus. However, I am not sure this test will be accurate from WebRTC prospective.
Any other ideas?
Additional requirement: the checking technique must support Chrome, Opera and Firefox. Preferably also IE/Safari via Temasys plugin.
Edition 1 - gathering ICE candidates is a good idea, however, it is not 100% reliable. Once I checked logs in my application and it actually gathered relay ICE candidates, but video/audio transmission failed. Tested on Apprtc as well and got same results.
The best way to check is to connect with just a data channel first. Your users won't notice. If that works then audio and video are almost guaranteed to work. As a bonus, you can use the data channel for signaling for super-fast connecting when your users are ready.
the typical WebRTC approach to this is to create a peerconnection with STUN and TURN servers, call createOffer and setLocalDescription and watch the candidates gathered. See e.g. http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
If you get srflx candidates, your stun server works (i.e. UDP is not blocked). More interesting is whether you get relay candidates. If you do, using TURN as a fallback will work. Quality might suffer if TURN/TCP is used. If you don't get relay candidates... calls are very unlikely to work.

VOD streaming is too slow

I am trying out VOD streaming with latest VLC as described in this wiki:
https://wiki.videolan.org/Documentation:Streaming_HowTo/VLM/ and trying to stream an HD movie file with extension mp4.
i am able to open the stream in VLC running on the same machine, but it takes lot of time to even start playing back. (minutes). The test is run in Fedora 20.
My machine is capable enough to play HD video.
I have tried with and with trans-coding and results are same.
Help is appreciated.
Found the issue and it is strange.
I had the streaming server and client in the same machine. The streaming was always extremely slow. However, disconnecting from the network made it work fast.. It did not matter whether the network connection was wifi or ethernet.
However, if you were to run the client in a different machine, it work properly.

Streaming live desktop video to a web application

I'm looking to find a way to stream a user's desktop LIVE (through some piece of software, such as Open Broadcaster Software) to a web application.
I'm assuming I should use a CDN to get the live streamed video to my web application, but how (and what software should I use) to get the user's desktop to a streaming service? Should I use a service such as Red5 or an AWS service? Or if only a few viewers are using it, should I host the service myself?
Although I have built my share of web applications, I have never dealt with live media streaming before, and I would appreciate any assistance anyone could lend.
By far the best resource for video on Rails is OpenTok
Our own demo here: http://bvc-video.herokuapp.com/broadcasts/1
--
Streaming
Video streaming is a tough one
The problem is really dependent on what you're trying to stream. If it's "live" video - I.E captured & sent directly to the viewers, you'll have to use some sort of server to process the video.
Although I don't have huge experience with this, the main issue we've found is the compression / distribution of the feed. It's actually very simple to acheive video streaming on iOS - all the software / hardware is the same (just use the same API / drivers)
This often negates the requirement for a central server, although it's highly recommended (almost required) for many cases. Problems arise when you try and beam to multiple clients on multiple systems; as you'll run into compatibility issues
--
Solutions
The solutions we've found are thus:
The most stable part of the app is to take the stream & send to a server
The wizardry will then be to beam that stream to multiple clients
The way to do this is typically to use a flash widget & pull the stream from the server
WebRTC is becoming the standard (OpenTok is built on this)
I'm not sure about video compression / distribution. Akami is an industry heavyweight, but I've never used it. Brightcove too

firewall-related problems when using YouTube iframe API

I built an educational web-based game that relies heavily on YouTube-hosted videos played back through the YouTube iframe API which accesses this script file on YouTube's server:
https://www.youtube.com/iframe_api
I am running into two problems when running the game from within a higher-security environment such as is often found within school buildings:
1) In some school systems YouTube is blocked so the game fails at the point when the first movie tries to play. (Other than moving the movies totally off of YouTube and finding another playback mechanism, I don't know any way to resolve this except to try to convince the administrators to loosen the YouTube restrictions on the network.)
2) Even when the global YouTube block is removed from the firewall, in some cases the game is behaving as if the above script file is totally missing. My theory is that some of the firewalls are also configured to block cross-site scripting.
Has anyone experienced one or both of these problems, and if so, how were you able to resolve? In dealing with #2, would it be possible (or even advisable) to pull the JS code from the youtube location and make a local server copy to avoid the presumed cross-site script blocking?
Any help or advice would be much appreciated!
It is fine to host the code for the api locally but that wouldn't solve the problem of the videos being blocked since they too reside on youtube.com.
If loading videos from YouTube is part of the game then you need to communicate that having access to YouTube is a requirement to play it. I don't think there is another option.

Resources