views:

12883

answers:

8

I am writing a RTSP client in Android. I am able to receive the Responses for all the requests i.e.,

  1. DESCRIBE it sends back the 200 OK
  2. SETUP with transport: RTP/AVP:unicast:client_port=4568:4569 got the 200 OK Message back
  3. Sent PLAY, and got the OK Message

After that how to get the audio and video frames?

I have searched on blogs, but all say to listen at client_port but I am not receiving any packets.

Please let me know am I doing correctly.

+1  A: 

You may or may not know this, but Android has built in support for RTSP using the VideoView.

http://developer.android.com/reference/android/widget/VideoView.html

This may cut down on your development time...or it may be totally useless if you're trying to roll your own RTSP stack.

haseman
It does not work with both device and emulator. It fails in PLAYER_INIT with PVMFFailure.
Vinay
I've found it not work with the emulator, but to work on all the devices I've gotten my hands on. Some of them require that you have the wake lock permission set in your manifest (figure that one out)
haseman
I have set wake lock permission in manifest file. It still fails with PVMFFailure.
Emre
+1  A: 

RTSP is only used to start the streaming. It gives you an SDP description of the real streams. You have to manage an RTCP connection and a RTP connection per channel (audio / video). The ports to use are the "client_port" ones.

It is pretty complex to code a RTSP/RTCP/RTP stack from scratch. You can have a look at the live555 library that implement such a stack in c++.

neuro
A: 

Put a sniffer on the network, you should see UDP packet with destination port 4568 targeted at your IP address.

With a decent sniffer, you will be able to see the rtsp dialog. Maybe you are missing something in the answers

You should also check the content of the SETUP response, to see if the port you requested were accepted.

Things to check :

  • Listening in UDP.
  • Firewall rules.
  • Range of the play request : Don't specify any to be sure the server will be playing something.

If you are behind a router or firewall, you probably won't receive anything, because your router / firewall don't know what to do with incoming UDP packets

shodanex
The SETUP response is proper i.e., it succeeds with 200 OK. How to use the sniffer? Is there any documentation to use it on Android platform?
Vinay
"If you are behind a router or firewall, you probably won't receive anything, because your router / firewall don't know what to do with incoming UDP packets" --- how to handle this case? presently I am behind a firewall
Vinay
+1  A: 

Try first with a local Darwin Streaming server installed within your LAN.that way Firewall wont matter.Streaming will work.

If you want to try from external server then:

1) Check the client_ports mentioned in the SERVER response,some servers suggest different ports from the one requested.you have to use the ports suggested by server.

2) If the ports are correct, then you can send 64byte empty packets from each of the UDP ports to the server(called "door openers").

3) If the above two don't fix it, check the server side logs.The server might be closing the UDP ports.

Shreesh
A: 

1) I need a streaming client that works on a PDA. (and possibly on a PC)

2) I need the streaming client that supports authentication because I need to login.

3) The streaming protocols I need must be one of HTTP, RTSP/RTP/RTCP, 3GPP. Image compression can be any of MPEG-4, JPEG, MJPEG, ASF, 3GPP.

I'm using an archaic PDA which runs Windows Mobile 6.1 but I saw this site, I thought I'd write because I've been pondering on getting an IPhone or Droid.

Windows Media Player is built into my phone and but I also tested WMP in Vista. To say the least, neither work worth a #@c%!, even with HTTP stream testing. In fact these newer versions of Windows Media players are even worse than the versions of yore. I couldn't tell you what flavour of meth the WM Player developers have been smoking over the past few years but even the pot-smoking auto engineers of the 70's, with their big square, gas guzzling boat cars could have come up with something better.

Your help appreciated brothers and sisters!

devaddy
A: 

I have similar issues where it does not play Video. Have RTSP with 3gpp compliant SDP and RTP payloads. None of the devices in the T-Mo store can play the content encapsulated in RTP. Do I have to wait for 2.0 or Nexus? Or a new Open Core release from Packet Video?

streamman
A: 

Hey vinay even i am working on RTP client on Android device. I am supposed to create n RTP client which can play real time videos, on android device. I am confused regarding how should i start about? what technology should i use? i am thinking of developing a web app, using HTML,CSS and Javascript, which can later be wrapped in Android.is this approach correct? does javascript support real time media player? please guide me, i am a fresher.

devang
I am not sure about web technologies. First you need develop an app which registers with server using RTSP protocols and gets the frames in specified UDP ports. Pass the frames to Multimedia library.
Vinay
A: 

I have the same error with Android 2.1 / Nexus One.

Any news about this RTSP problem and the built-in media player? It still fails in PLAYER_INIT with PVMFFailure.

I have no idea what this means. Can somebody explain it maybe? Is there a work around? Can I use another player for it in my program (by installing another one than using the standard mp)?

Thanks.

Nils