title: Multiple Libstreaming streams only recognized as session of First RTSP client
body: <p>I am using <strong>Live555</strong> as <strong>RTSP client</strong> to get the RTSP H264 video stream from android <strong>LibStreaming</strong> MajorKernelPanic server. I am facing the problem to display more than one video streams from the mentioned type android RTSP server which is handled by different RTSP client. The problem is obviously if using VLC which get the RTSP H264 frame via Live555 also. </p>
  
  <ol>
  <li><p>The first VLC (RTSP client) displays video correctly.</p></li>
  <li><p>The other VLCs (RTSP client also) display nothing but its frame is
  displayed in the first VLC video window.</p></li>
  </ol>
  
  <p>This problem is happened on the specified RTSP server but not other IP camera.</p>
  
  <h2>I wonder how live555 can determine the RTSP data frame is belongs to which session.</h2>
  
  <p>I found the problem might be revealed in following code of <a href="https://github.com/fyhertz/spydroid-ipcamera/blob/master/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java" rel="nofollow">Libstreaming</a>.</p>
  
  <pre><code>        response.attributes = "Transport: RTP/AVP/UDP;"
                  +(InetAddress.getByName(destination).isMulticastAddress()?"multicast":"unicast")
                  +";destination="+mSession.getDestination()+
                  ";client_port="+p1+"-"+p2+
                  ";server_port="+src[0]+"-"+src[1]+
                  ";ssrc="+Integer.toHexString(ssrc)+
                  ";mode=play\r\n" +
                  "Session: "+ "1185d20035702ca" + "\r\n" +
                  "Cache-Control: no-cache\r\n";
  </code></pre>
  
  <p>in SETUP response of RTSP server and </p>
  
  <pre><code>    else if (request.method.equalsIgnoreCase("PLAY")) {
          String requestAttributes = "RTP-Info: ";
          if (mSession.trackExists(0)) requestAttributes += "url=rtsp://"+mClient.getLocalAddress().getHostAddress()+":"+mClient.getLocalPort()+"/trackID="+0+";seq=0,";
          if (mSession.trackExists(1)) requestAttributes += "url=rtsp://"+mClient.getLocalAddress().getHostAddress()+":"+mClient.getLocalPort()+"/trackID="+1+";seq=0,";
          requestAttributes = requestAttributes.substring(0, requestAttributes.length()-1) 
                              + "\r\nSession: 1185d20035702ca\r\n";
  </code></pre>
  
  <p>in PLAY request.</p>
  
  <p>At first, I thought I can make the hardcoded <strong>session ID</strong> (<em>1185d20035702ca</em>) after the "Session: " to <strong>dynamic</strong> one then the problem solved, but after I changed it, <strong>the problem still remains there</strong>.</p>
  
  <p>The success change of the session id is verified by Wireshark.</p>
  
  <p>Any related suggestion is welcomed. Thanks.</p>