Onvif RTSP over HTTP - streaming

I`m trying to make an IP Camera to work with the onvif specification. (I try to develop the services on the camera, the server)
The Camera does only support rtsp over http and I have no idea how to get this working with e.g. the Onvif test tool.
I have the rtsp stream uri but when I send it to the client it gives me a describe error. what do I have to send to the Client so it knows that it is rtsp over http?

You could act as a proxy between the RTSP client and the camera - direct all the RTSP requests to the POST channel of the RTSP over HTTP connection and write everything you receive in the GET connection back to the client.

Related

Can Kurento run as a WebSocket client?

I understand that Kurento Server is called this way for a reason, but can it be configured (or hacked) to run as a client in terms of the Kurento Protocol?
According to the Kurento 6.6.1 documentation:
Previous to issuing commands, the Kurento Client requires establishing
a WebSocket connection with Kurento Media Server to the URL:
ws://hostname:port/kurento
But since we would like to run our Kurento Server behind NAT that doesn't have a dedicated IP address and doesn't allow DDNS and port forwarding, it would be really nice if Kurento could connect to our signaling server (WebSocket-based) and permanently sustain that connection. When web-based client connects to that signaling server, a connection would be negotiated between the WebRTC server (Kurento) and the client (browser) via signaling. – Well, that's our hope, at least, since RTSP connection to our camera also cannot be established from the Internet.
See the diagram of what we are trying to achieve:
Thanks.

Is it possible to use UDP with socket.io?

I have a game I am working on and I heard that UDP is superior for real-time games. I know that socket.io uses TCP and was wondering if there is some way to switch it to UDP. I tried looking it up but only found posts from around 2012 which said UDP is only experimental in browsers.
From a standard browser, it is not possible.
From a browser client, socket.io uses either the http or the webSocket transport. Both http and webSocket are TCP connections, not UDP connections. So the browser client socket.io does not use UDP - it uses TCP.
As best I know, there is no standard UDP support in browsers accessible from regular HTML page Javascript so you can't even really try to build your own layer that uses UDP.
Other references on the topic:
Why Can't I Send UDP Packets From a Browser
Reading from udp port in browser
Chrome Supports TCP and UDP Sockets
Write a chrome extension to support UDP in browser
How to send a UDP Packet with Web RTC - Javascript?
How to talk to UDP sockets with HTML5?
Reading from udp port in browser
UDP can be a desirable transport for some circumstances when you want the packet to be delivered as soon as possible, but if it can't be delivered immediately, then just drop it. This is sometimes useful in gaming or even video streaming where the next packet will just contain the next update so if the previous one didn't come through, then no big deal and you'd rather not have TCP try to retransmit the lost packet. But, browsers don't support using the UDP protocol from web page Javascript.
If you want to connect to a UDP device or server from a browser, you will have to use some sort of proxy so your browser code can talk to the proxy over TCP (either http or webSocket) and then the proxy can handle the actual UDP communication with the device.
It would be possible to use the socket.io library from node.js or some other non-browser platform and write your own UDP transport add-in for socket.io that is built on the native UDP support in your platform. I believe socket.io has a somewhat pluggable transport so you could try to make your own transport and then configure both client and server to use that transport. This is not possible from the browser (without a native code plug-in installed in the browser) because there's no underlying UDP support in the browser that you could build your transport on, but in non-browser environments like node.js, you could do that.
It might be a good idea to use webRTC in this case which is UDP in nature.
Although the question is already answered, I want to point out that there are ways to implement socket.io with UDP. For example dgram does exactly what you are looking for.
This is a tutorial for socket.io + UDP with dgram.
UPDATE:
Alexandre Lacheze developed a node.js package that brings UDP to browser. It also supports socket.io. So the answer is somehow obsolete now.
UPDATE 2:
It turn out it is just a simulated UDP. Not an actual UDP protocol running on browser.

How do to initiate a connection-less socket (datagram) to a UDP server in browser?

I need to connect and send data packets to a UDP server (connection less/datagram socket) from within a browser.
What are my options?
Does HTML5 allow connection-less sockets?
Would I be able to connect to a UDP server (connection-less socket) using a WebSocket?
Your options are very limited. Browsers which support WebSockets expect the server to speak WebSocket to them (which involves participating in a 2-way handshake). Communicating in raw UDP is an entirely different kettle of fish.
Chrome has experimental support for raw UDP, but only for Chrome extensions.
I don't know of any other browser with this in the works, or for Chrome to make it available for websites.
Your best best would be to change your endpoint to talk WebSocket, or to use a middleman server (NodeJS would be great for this) to handle the Websocket <-> raw UDP conversion.

Scala/Akka websocket server library

I need a websocket server in order to be able to deliver server side events to my web application. Is there any library to build a websocket server using scala, preferably akka?
The Play Framework (http://www.playframework.com/) has strong support for web sockets (http://www.playframework.com/documentation/2.2.2/ScalaWebSockets). Play also plays well with Akka (http://www.playframework.com/documentation/2.2.2/ScalaAkka).
Note: SSEs are not WebSockets. WebSockets are for duplex communication between server and client while SSEs are only server to client. Both can be done in Play. See http://matthiasnehlsen.com/blog/2013/05/01/server-sent-events-vs-websockets/ for an illustrative example.

HTTP Live Streaming using Apple mediastreamsegmenter

I would like to implement HTTP live streaming for iPhone/iPad. I am following the apple standards and tools for same.
As of now my video source is one giving me live video from rtsp://123.123.123.123:554/mpeg4 (sample IP). but as HTTP live streaming and mediastreamsegmenter required to pass source over UDP network so i have twisted way bit.
So that i have used VLC player and first stream RTSP to UDP.
For example, i have stream video source from rtsp://123.123.123.554/mpeg4 and redirected it to
udp://#123.123.123.17:1234 (sample ip). i have tested this with two instance of VLC on same machine to check whether live streaming is played or not. it is working fine on VLC.
now I am user MAC OS 10.6.x (Snow leopard). and use latest tools (downloaded from Apple) fro HTTP Live Streaming
I am executing the following command from terminal
mediastreamsegmenter -b http://demo.dummy.com/stream -s 3 -D -f /Desktop/StreamParts 123.123.123.17:1234
here
http://demo.dummy.com/stream - server
/Desktop/StreamParts - Local Folder for saving .ts files
123.123.123.17:1234 - UDP url (from where live streaming is done)
But the problem is when i execute this command. it is giving me error like
no start access unit
error in pid 44(video) -- cc value should be 9 is 10, 1 is 2, 5 is 6, etc.
any idea? what is going wrong here? and what this error message is showing?
My hunch would be that the transport is incompatible. Apple's tools (i.e. mediastreamsegmenter) are expecting an MPEG2 transport stream over UDP, not just RTSP sent over UDP. The problem I have, which I'm afraid will be your next question, is how to correctly generate a MPEG2 transport stream.