Confusion regarding RTSP over HTTP tunneling - stream

I had an confusion of which I searched but didn't get any answer.
I am streaming a video file using RTSP over HTTP tunneling then when I see the wire-shark to see the packets source and destination and protocol I saw a UDP protocol although i am using RTSP over HTTP tunneling.
Can any one tell me why don't I see the TCP protocol instead of UDP protocol for packets being sent from source to destination?

RTSP sets up RTP streams for streaming the video and audio. They are probably being sent over UDP instead of tunneling over the existing TCP connection.
Just because RTSP is being tunneled over HTTP doesn't guarantee that the RTP streams will be configured to use the same socket. It's up to the client to request the transport, but you can change the server to only support the interleaved transport. See this answer https://stackoverflow.com/a/3536969/759140

RTSP is a network control protocol. According to Wikipedia,
The default port for the RTSP protocol is 554 for both UDP (deprecated
and very rarely used) and TCP transports.
Conclusion: UDP or TCP will be used, depends on which server you use and settings.

Very true but if you specify to use tcp-transport in ffmpeg it should use TCP if the server is configured for it.
If you don't specify any transport option, new versions of ffmpeg will try UDP, if that fails it will retry the connect or TCP.

Related

How to know from where the RTMP stream is starting and where it is ending using wireshark

I need to build a RTMP parser . For that I need to know from where the RTMP packet starts and where it ends in a bytestream. I analysed the RTMP stream using wireshark.What I observed is that RTMP packet is packaged(encapsulated) inside TCP packet which is in turn packaged(encapsulated) inside IPV4 packet. This was the behavior for all the RTMP packets except Video data RTMP packets and Aggregate RTMP packets.To build a parser I need to know from where the RTMP packet is starting and where it is ending.But with Video data RTMP packet and Aggregate RTMP packets its not getting possible because these packets are not packaged inside IPV4 packet.The data for RTMP packet is shown in a different window in wireshark(named Unchunked RTMP).Can anyone help me know how wireshark is getting to know where the TCP packet is ending and where the RTMP Video packet and RTMP Aggregate packet is starting ??? What is the logic of Wireshark for this or what I can do to achieve the same ???

RTSP streaming on VLC

We have implemented RTSP server on our MCU. For testing purpose we are using VLC media player as a client. We coded our MCU such a way that only after receiving PLAY command from client, MCU reads data from camera. And we are seeing MCU receives data from camera and streams thorugh RTSP. We could see data streaming from server through UDP on Wireshark. And Also Codec information getting dispalyed on VLC media player. But video doesn't get played in VLC.What could be the issue?
Below is our SDP file info
"v=0\r\ns=Unnamed\r\ni=N/A\r\nc=IN IP4 sumukha-PC\r\nt=0 0\r\na=tool:vlc 2.2.2\r\na=recvonly\r\na=type:broadcast\r\na=charset:UTF-8\r\na=control:rtsp://192.168.1.100:8555\r\nm=video 0 RTP/AVP 96\r\nb=RR:0\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1\r\na=control:rtsp://192.168.1.100:8555/trackID=0\r\n\r\n");
Thanks,
Ck
The error message tells you what is going wrong:
live555 error: no data received in 10s, aborting
The usual reasons for this are firewalls or NAT?
You can select the RTP over RTSP (TCP) option in the VLC preferences to verify this. If the stream works over TCP, UDP packets are being blocked somewhere.
I suggest using ffmpeg and ffplay to test your streaming from a RTSP source.
It is command line, but the information and logs are very helpful

UDP Packets IOS 9 LTE Network GCDASYNCUDP

I have a basestation (beaglebone running linux) at my home which is connected to multiple cameras. I connect my iPhone iOS9 to the basestation via TCP and the basestation will stream the video of each camera to a specific UDP port. All is well.
I want to be able to see the cameras when I am not connected to the local network. When my phone is connected to LTE, I have the iPhone connecting to the public address of my router via TCP and with port forwarding, all data is forwarded to the basestation. I am connecting and talking just like it was on the local network with the TCP client. All is well.
The problem is when the video is streamed via UDP on a specific port, no different than when on the local network, the basestation has no problem sending the packets, but the iPhone is not receiving anything. I am using GCDASYNCUDPSOCKET and my cellular carrier is Verizon.
I am wondering if this issue is due to Verizon blocking UDP packets? Or possibly there needs to be something else done other than just binding the iPhone UDP socket to a specific port and calling the beginreceiving function. I feel if it works on the local network, it should work on the cellular network.
I have also tried to ping the address of my cellphone from my computer which does not work. I am guessing the reason is because the iPhone has blocked this. It should be no different than pinging the address of google or anything else.
Please give me some insight on the possible issues or work arounds. I don't think I need to port forward the UDP since it is only outgoing and my Netgear router does not limit any outbound traffic (from the router to the iPhone). I was doing all this TCP before trying to send the video via UDP. It is much slower waiting to receive acks for 5 cameras streaming live video. And when it doesn't receive a packet it backs up the buffer and causes more issues. Also I had an issue with the TCP packets combining together so then I had to implement some kind of custom ack which made the delay worse, or add an end of message, but then it slows down on parsing and since I don't know exactly what data is coming it made things more difficult.
UDP is the way to go, just cannot receive the packets at this time. My understanding is a lot of games use UDP and they work on LTE network, so I'm not quite sure what the problem is. Is there special UDP ports that only work with Verizon?

How to receive UDP broadcast packets on a PARTICULAR interface?

On an iPhone I have created a UDP socket and bound it to the WLAN interface. I enabled SO_BROADCAST and I am able to send broadcast packets to the network (confirmed by a client running on my notebook.) But the UDP socket on the iPhone is unable to receive broadcast packets.
In my opinion this is a kernel bug, because not allowing a socket with SO_BROADCAST enabled to receive any broadcast packet, is a bad design decision.
The problem is further described here and here. The most popular solution to this problem is to bind to INADDR_ANY. However, it would be nice to be able to bind an UDP socket to only one interface while still receiving broadcast packets! Is there really no way to achieve this?
(When I bind a socket to 192.168.1.7 on a class C net (/24), it should accept packets sent to 192.168.1.7 and packets sent to 192.168.1.255!)
Thanks!
pls check below link may be it's helpful.
Receive udp broadcast packets ios
iPhone UDP broadcast and response
iOS UDP broadcast vs. PHP UDP broadcast
https://github.com/robbiehanson/CocoaAsyncSocket

How to Stream Udp multicast through live555 linux and then open up a rtsp network stream read by VLC

I am trying to setup a network where I am reading a broadcast with live555 and then trying to send out an RTSP server I was reading the tutorials on the website and couldnt find what I was doing wrong. My process was I opened up a streaming network through VLC to stream udp to the port that live555 was listening to then I opened testOnDemandRTSPServer for live555 and then opened a network stream from another VLC to listen to the rtsp stream but was getting no output does anyone know what I did wrong
I found out the problem was that I was using a virtual machine and had bad network setting and had to disable something, I also changed the code in testOnDemandRTSPServer.cpp to line 340 and changed inputStreamIsRawUDP to True

Resources