Fwd: FFMPEG not supporting some Axis cameras models

Message ID alpine.DEB.2.00.1103211549030.3794@cone.home.martin.st
State Committed
Headers show

Commit Message

Martin Storsjö March 21, 2011, 1:51 p.m.
On Mon, 21 Mar 2011, Ronald S. Bultje wrote:

> Hi,
> 
> On Mon, Mar 21, 2011 at 8:32 AM, Martin Storsjö <martin@martin.st> wrote:
> > On Mon, 21 Mar 2011, Luca Barbato wrote:
> >
> >> On 03/21/2011 12:43 PM, Stas Oskin wrote:
> >> > From the look of things, the camera expects getting the "unicast" flag,
> >> > which VLC sends by default but FFMPEG enables only in case of WMS server
> >> > (rtsp.c):
> >> >             if (rt->server_type == RTSP_SERVER_WMS)
> >> >                 av_strlcat(transport, "unicast;", sizeof(transport));
> >> >
> >> > Commenting the conditional resolves the problem indeed, so I wonder if it
> >> > safe to have "unicast" always enabled and this conditional can be dropped in
> >> > tree, or you have another suggestion?
> >>
> >> are the axis camera using rtsp-rtp-interleaved now? nice =)
> >>
> >> the current code adds "unicast;" for UDP (it could be multicast), but
> >> does not for TCP/rtsp-interleaved since there are options.
> >
> > I guess you meant "since there are no other options"?
> >
> >> try the following patch please, real variant might not like unicast,
> >> standard rtsp would just ignore it.
> >
> > He already said that commenting out the if statement helps for him, so the
> > only remaining issue is not to break anything else.
> >
> > Skipping it for real (unless we later find out it would be required there,
> > too) might be a safe option. Most of the RealRTSP URLs on multimediawiki
> > seem not to support rtsp/tcp at all, but one of them does, and works just
> > fine with this patch.
> 
> ???
> 
> That's bad, what is the error? RTSP/TCP should _always_ work for real
> servers. Did it break?

Sorry for the false alarm - it was my patch breaking it, while the servers 
actually replied "Unsupported transport" for those requests.

The more precise statement is that RealRTSP/RDT can't have the unicast 
identifier, but RealRTSP/RTP is ok with it.

Updated patch attached.

// Martin

Comments

Luca Barbato March 21, 2011, 2:47 p.m. | #1
On 03/21/2011 02:51 PM, Martin Storsjö wrote:
> Updated patch attached.
> 

Queued up again =)

Patch

From 908a57b651f7aa708894b1e3fcc84bc76b9699f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Mon, 21 Mar 2011 14:19:09 +0200
Subject: [PATCH] rtsp: Specify unicast for TCP interleaved streams, too

According to the RFC, the default is multicast if nothing is
specified, which doesn't make sense for TCP.

According to a bug report, some Axis camera models give a
"400 Bad Request" error if this is omitted.
---
 libavformat/rtsp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 6d538cd..5b98a28 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1157,7 +1157,7 @@  int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
                 continue;
             snprintf(transport, sizeof(transport) - 1,
                      "%s/TCP;", trans_pref);
-            if (rt->server_type == RTSP_SERVER_WMS)
+            if (rt->transport != RTSP_TRANSPORT_RDT)
                 av_strlcat(transport, "unicast;", sizeof(transport));
             av_strlcatf(transport, sizeof(transport),
                         "interleaved=%d-%d",
-- 
1.7.3.1