On 11/28/11 10:07 AM, Mark Kenna wrote:
On 25/11/2011 18:02, Luca Barbato wrote:
On 25/11/11 14:08, Mark Kenna wrote:

On 23/11/2011 14:57, Luca Barbato wrote:
On 23/11/11 15:00, Mark Kenna wrote:
Hi Guys

Does LibAv current support RTSP authentication (digest/basic)?

Yes it does, see

http://git.libav.org/?p=libav.git;a=blob;f=libavformat/rtsp.c;h=d0e9bbf6af6534b0e2f8c841b6cb763f0a41f4dd;hb=HEAD#l1370



I am connecting to a url of the form
"rtsp://user:[email protected]/rtspl?h264&channel=1" which works
fine
in VLC but not through LibAv/FFMpeg. I just get the line "[rtsp @
003EB7E0] method OPTIONS failed: 401 Unauthorized" when I try this
through the command line.

Should work there as well, could you please provide an url we could
test?

lu


Hi Luca

I have traced the issue and it looks like LibAv is not creating the auth
response correctly. The details are as follows for the first call
(OPTIONS)

user="live"
password="sureview"
realm="Use 'live' as User Name"
nonce="1f63550066114283365d7d9a346e5dff"
uri="rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1" (note that
this is behind a VPN so you wont be able to see it)

LibAv is generating the response as "ea214b7c7f218d0053ad9467003e14aa"

I have calculated the response should be
"5d7ee8885c6ae3c64055bdb9e21f88ca" using the information on
http://en.wikipedia.org/wiki/Digest_access_authentication. I have also
tried this against the OPTIONS request and it succeeds!

Does this help at all? If you need more information I will post whatever
you need.

I'll have a look and ask Martin to check as well. He is using the
feature so is strange to have it wrong.

Could you please provide a whole wireshark dump so we can see the
whole exchange between the two parties?

lu


Hi Luca

Attached are a successful and unsuccessful RTSP connections. The
successful one is from VLC which seems to work perfectly.

To make them smaller.

Fail:

OPTIONS rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1 RTSP/1.0
CSeq: 1

RTSP/1.0 401 Unauthorized
CSeq: 1
WWW-Authenticate: Digest realm="Use 'live' as User Name", nonce="367c582842321ae122182ec952a82238", algorithm=MD5, qop="auth"

OPTIONS rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1 RTSP/1.0
CSeq: 2
Authorization: Digest username="live",realm="Use 'live' as User Name",nonce="367c582842321ae122182ec952a82238",uri="rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1",response="507955b7c86933a935f44ab01396da58",algorithm=MD5,qop="auth",cnonce="f0a70b73a8763870",nc=00000001

RTSP/1.0 401 Unauthorized
CSeq: 2
WWW-Authenticate: Digest realm="Use 'live' as User Name", nonce="61b46c52044e07e8067f6a18439516a1", algorithm=MD5, qop="auth"


Success:

OPTIONS rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp RTSP/1.0
CSeq: 1
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)

RTSP/1.0 401 Unauthorized
CSeq: 1
WWW-Authenticate: Digest realm="Use 'live' as User Name", nonce="7bed32271e14195c69c678b851d460b9", algorithm=MD5, qop="auth"

DESCRIBE rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp RTSP/1.0
CSeq: 2
Accept: application/sdp
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)

RTSP/1.0 401 Unauthorized
CSeq: 2
WWW-Authenticate: Digest realm="Use 'live' as User Name", nonce="537c018656bb13e22a866c3a0f633762", algorithm=MD5, qop="auth"

DESCRIBE rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp RTSP/1.0
CSeq: 3
Accept: application/sdp
Authorization: Digest username="live", realm="Use 'live' as User Name", nonce="537c018656bb13e22a866c3a0f633762", uri="rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp", response="a29ea98bdc6861c48bd8bddaebaf30a0"
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)

RTSP/1.0 200 OK
CSeq: 3
Cache-control: no-cache
Content-Type: application/sdp
Content-Length: 155

v=0
o=- 0 0 IN IP4 10.0.110.61
s=LIVE VIEW
t=0 0
c=IN IP4 0.0.0.0
m=video 0 RTP/AVP 35
a=rtpmap:35 H264/90000
a=control:rtsp://10.0.110.61/video

SETUP rtsp://10.0.110.61/video RTSP/1.0
CSeq: 4
Transport: RTP/AVP;unicast;client_port=1846-1847
Authorization: Digest username="live", realm="Use 'live' as User Name", nonce="537c018656bb13e22a866c3a0f633762", uri="rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp", response="5ade0d7197fe7f1cbac4d8de5b4ee4f3"
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)

RTSP/1.0 200 OK
Transport: RTP/AVP/UDP;unicast;client_port=1846-1847;server_port=15346-15347;ssrc=FFFFFFFF;mode=PLAY
CSeq: 4
Session: 2658592a04276bc; timeout=60

PLAY rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp RTSP/1.0
CSeq: 5
Session: 2658592a04276bc
Range: npt=0.000-
Authorization: Digest username="live", realm="Use 'live' as User Name", nonce="537c018656bb13e22a866c3a0f633762", uri="rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp", response="67fc1c450dd845af9521b14d928c9e93"
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)

RTSP/1.0 200 OK
CSeq: 5
Session: 2658592a04276bc

TEARDOWN rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp RTSP/1.0
CSeq: 6
Session: 2658592a04276bc
Authorization: Digest username="live", realm="Use 'live' as User Name", nonce="537c018656bb13e22a866c3a0f633762", uri="rtsp://10.128.3.7:554/rtsp_tunnel?h26x=4&line=1&inst=1&tcp", response="4bd5910e8b240f8aeb524b9f9f163f50"
User-Agent: VLC media player (LIVE555 Streaming Media v2009.03.22)

RTSP/1.0 200 OK
CSeq: 6
Session: 2658592a04276bc



_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to