RTSP: cannot get session identifier
<p>I am trying to control an ip cam using a python script (I can see the stream with VLC or mplayer).</p>

<p>After received OPTIONS and DESCRIBE informations, every SETUP I try give me an error:</p>

<pre><code>SETUP rtsp://192.168.0.41:554/xxxxxx RTSP/1.0 
CSeq: 3
Transport: RTP/AVP/UDP;unicast;client_port=3056-3057

RTSP/1.0 400 Bad Request
Allow: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER,  SET_PARAMETER,USER_CMD_SET
</code></pre>

<p>so I never receive the session identification.</p>

<p>Maybe the problem is in the Transport line, but I think it's because I do not know what to put in place of the xxxxxxx (I tried and googled a lot but with non results)</p>

<p>Here are the output of OPTIONS and DESCRIBE:</p>

<pre><code>    OPTIONS rtsp://192.168.0.41:554 RTSP/1.0 
 CSeq: 1

RTSP/1.0 200 OK
CSeq: 1
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER,USER_CMD_SET


---------------------------------
DESCRIBE rtsp://192.168.0.41:554/onvif2 RTSP/1.0 
 CSeq: 2

RTSP/1.0 200 OK
CSeq: 2
Content-Type: application/sdp
Content-Length: 360

v=0
o=- 1421069297525233 1 IN IP4 192.168.0.41
s=H.264 Video, RtspServer_0.0.0.2
t=0 0
a=tool:RtspServer_0.0.0.2
a=type:broadcast
a=control:*
a=range:npt=0-
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA==
a=control:track1
</code></pre>

<p>What that * stands for?</p>

<p>And what is "track1"? </p>

<p>(note: if I check for onvif1, that is the other streaming sent by the cam, the result is the same, but with track2, that means that the server answer should be appropriate)</p>

<p>Example from RTSP rfc <a href="https://www.ietf.org/rfc/rfc2326.txt" rel="nofollow">https://www.ietf.org/rfc/rfc2326.txt</a>:</p>

<pre><code>S-&gt;C  RTSP/1.0 200 OK
      CSeq: 1
      Content-base: rtsp://foo.com/test.wav/
      Content-type: application/sdp
      Content-length: 48

      v=0
      o=- 872653257 872653257 IN IP4 172.16.2.187
      s=mu-law wave file
      i=audio test
      t=0 0
      m=audio 0 RTP/AVP 0
      a=control:streamid=0

C-&gt;S  SETUP rtsp://foo.com/test.wav/streamid=0 RTSP/1.0
      Transport: RTP/AVP/UDP;unicast;
                 client_port=6970-6971;mode=play
      CSeq: 2
</code></pre>

<p>You just append it to the URL for your SETUP request.</p>

<p>I'm not really sure what the a=control:* means</p>

python streaming rtsp onvif