Dear Sir I am trying to build RTSP protocol with SDP & RTP, (TV channels over mobiles), using Java as the application server & Realplayer as the client. I arrived to the playing step. In which, I send RTP packets (for 3gpp video file) to the client, but the client cannot play the video file. I designed the packet header as described in the related specifications, rfc2326, rfc3550 (12 bytes header + 5 bytes of data). The code of the packet design is shown below. could you please help me in any way? The negotiations between client & server (app. output) is shown below. Thank you --------------------- RTP header ---------------------------- DataInputStream input = new DataInputStream(fis); byte VPXCC []= {(byte) 0x80}; byte MPT [] = {(byte)
0xE3}; int s, len = 5; // 16 bits long timestamp; // 32 bits byte payloadType = 4; Random rnd = new Random(); // Use time as default seed short RandomOffset = (short) Math.abs ( (new Random()).nextInt() & 0x000000FF); long SSRC; s = 0; SSRC = (long) Math.abs( rnd.nextInt() ) ; timestamp = (new Date()).getTime()/* + RandomOffset*/; byte ts[] = new byte[4]; ts = convertLongToBytes(timestamp, 4); byte sq[] = new
byte[2]; sq = convertLongToBytes(s, 2); byte ss[] = new byte[4]; ss = convertLongToBytes(SSRC, 4); byte data[] = new byte[len]; try{ if (input.available() < len ) input.read(data, 0, input.available()); else input.read(data, 0, len); } catch (java.io.IOException ioe){ ioe.printStackTrace();
} byte p[] = new byte[0]; // RTP packet p = app(p, VPXCC); // first byte p = app(p, MPT); // second byte p = app(p, sq); //sequence number p = app(p, ts); // timestamp p = app(p, ss); //SSRC p = app(p, data); s++; SSRC++; return (p); --------------------- application output ---------------------------- Video Server Started on Port:554 Received from Client: OPTIONS rtsp://10.10.79.53:554 RTSP/1.0 Sequence Number- CSeq:
1 Client --->> CSeq: 1 Client --->> User-Agent: RealMedia Player HelixDNAClient/10.0.0.11281 (win32) Client --->> Supported: ABD-1.0 Client --->> ClientChallenge: def9c7c1c3f4732f9e336b15d777ed9d Client --->> ClientID: WinNT_5.1_6.0.14.550_RealPlayer_R40UKR_en-GB_UNK Client --->> CompanyID: QK+mLiQwBSItWfY2nqNlVA== Client --->> GUID: 00000000-0000-0000-0000-000000000000 Client --->> PlayerStarttime: [18/10/2007:13:29:44 03:00] Client --->> Pragma: initiate-session Client --->> RegionData: 0 >> Reponse >> RTSP/1.0 200 OK CSeq: 1 Date: Thu, 18 Oct 2007 13:29:44 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer compatible) Supported: play.basic,
con.persistent Public: OPTIONS, DESCRIBE, ANNOUNCE, SETUP,PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER, TEARDOWN Received from Client: DESCRIBE rtsp://10.10.79.53:554/e.3gp RTSP/1.0 Sequence Number- CSeq: 2 Client --->> CSeq: 2 Client --->> Accept: application/sdp Client --->> User-Agent: RealMedia Player HelixDNAClient/10.0.0.11281 (win32) Client --->> Bandwidth: 10485800 Client --->> ClientID: WinNT_5.1_6.0.14.550_RealPlayer_R40UKR_en-GB_UNK Client --->> GUID: 00000000-0000-0000-0000-000000000000 Client --->> Language: en-GB, en, * Client --->> RegionData: 0 Client --->> Require: com.real.retain-entity-for-setup Client --->> SupportsMaximumASMBandwidth: 1 >> Reponse >> RTSP/1.0 200
OK CSeq: 2 Date: Thu, 18 Oct 2007 13:29:44 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer compatible) Supported: play.basic, con.persistent Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Content-Type: application/sdp Content-Base: rtsp://172.100.100.200/e.3gp/ Content-Language: en-US Content-Length: 525 v=0 o=- 1187775998 1187775998 IN IP4 172.100.100.200 s=Test u=<none> e=<none> c=IN IP4 0.0.0.0 t=0 0 a=control:rtsp://172.100.100.200/e.3gp a=range:npt=0.000000-121.0 m=video 0 RTP/AVP 99 b=AS:24 b=RS:480 b=RR:604 a=range:npt=0.000000-121.0 a=rtpmap:99 H263-2000/90000 a=control:trackID=201 a=fmtp:99 profile=0;level=10 a=framesize:99 176-144 m=audio 0 RTP/AVP 98 b=AS:8 b=RS:480 b=RR:210 a=range:npt=0.000000-121.0 a=rtpmap:98 AMR/8000 a=control:trackID=101 a=fmtp:98
octet-align=1 a=maxptime:500 Received from Client: SETUP rtsp://172.100.100.200/e.3gp/trackID=201 RTSP/1.0 Sequence Number- CSeq: 3 Client --->> CSeq: 3 Client --->> Transport: RTP/AVP;unicast;client_port=6970- 6971;mode=play,RTP/AVP/TCP;unicast;mode=play Client --->> User-Agent: RealMedia Player HelixDNAClient/10.0.0.11281 (win32) >> Reponse >> RTSP/1.0 200 OK CSeq: 3 Date: Thu, 18 Oct 2007 13:29:44 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer compatible) Supported: play.basic, con.persistent Cache-Control: must-revalidate Session:1187775999;timeout=80 Transport:RTP/AVP/TCP;unicast;interleaved=144-145 Now State is [READY] Received from Client: SETUP
rtsp://172.100.100.200/e.3gp/trackID=101 RTSP/1.0 Sequence Number- CSeq: 4 Client --->> CSeq: 4 Client --->> Transport: RTP/AVP/TCP;unicast;mode=play Client --->> User-Agent: RealMedia Player HelixDNAClient/10.0.0.11281 (win32) Client --->> Session: 1187775999 >> Reponse >> RTSP/1.0 200 OK CSeq: 4 Date: Thu, 18 Oct 2007 13:29:44 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer compatible) Supported: play.basic, con.persistent Cache-Control: must-revalidate Session:1187775999;timeout=80 Transport:RTP/AVP/TCP;unicast;interleaved=146-147 Now State is [READY] Received from Client: SET_PARAMETER rtsp://172.100.100.200/e.3gp RTSP/1.0 Sequence Number- CSeq: 5 Client --->> CSeq: 5 Client
--->> Subscribe: stream=0;rule=0,stream=0;rule=1,stream=1;rule=0,stream=1;rule=1 Client --->> Session: 1187775999 >> Reponse >> RTSP/1.0 200 OK CSeq: 5 Date: Thu, 18 Oct 2007 13:29:45 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer compatible) Supported: play.basic, con.persistent Received from Client: SET_PARAMETER rtsp://172.100.100.200/e.3gp RTSP/1.0 Sequence Number- CSeq: 6 Client --->> CSeq: 6 Client --->> SetDeliveryBandwidth: Bandwidth=128000;BackOff=0 Client --->> Session: 1187775999 >> Reponse >> RTSP/1.0 200 OK CSeq: 6 Date: Thu, 18 Oct 2007 13:29:45 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer
compatible) Supported: play.basic, con.persistent Received from Client: PLAY rtsp://172.100.100.200/e.3gp RTSP/1.0 Sequence Number- CSeq: 7 Client --->> CSeq: 7 Client --->> User-Agent: RealMedia Player HelixDNAClient/10.0.0.11281 (win32) Client --->> Session: 1187775999 Client --->> Range: npt=0-121 Client --->> Bandwidth: 10485800 >> Reponse >> RTSP/1.0 200 OK CSeq: 7 Date: Thu, 18 Oct 2007 13:29:45 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer compatible) Session:1187775999;timeout=80 Range: npt=0.0000-121.0 RTP-Info: url=Rtsp://172.100.100.200/e.3gp/trackID=201;seq=0;rtptime=0 Now State is [PLAYING] **** now real player shows loading.. *** but no data
All 144173 Packets Have Been Sent .... Received from Client: TEARDOWN rtsp://172.100.100.200/e.3gp RTSP/1.0 Sequence Number- CSeq: 8 Client --->> CSeq: 8 Client --->> User-Agent: RealMedia Player HelixDNAClient/10.0.0.11281 (win32) Client --->> Session: 1187775999 >> Reponse >> RTSP/1.0 200 OK CSeq: 8 Date: Thu, 18 Oct 2007 13:29:54 GMT+03:00 Last-Modified: Tue, 10 Jul 2007 12:51:28 GMT Server: Helix Server Version 10.0.0.11272 (win32) (RealServer compatible) Supported: play.basic, con.persistent java.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:116) at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:405) at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:445) at
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:179) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) at RTSP.Server.getRequest(Server.java:240) at RTSP.Server.main(Server.java:171)
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
|