[FFmpeg-devel] RTMP: trailing slash in content-base

Martin Storsjö martin
Wed Feb 16 15:39:45 CET 2011

Hi Nicolas,

Luca/Ronald - this actually is about RTSP, contrary to what the subject 
line says. Please read, I want your opinion on this.

On Wed, 16 Feb 2011, Nicolas George wrote:

> Since 577ee94/r23325 (2010-05-25), ffserver sends a Content-Base header; its
> value is the URL with a trailing slash.
> Since dd22cfb/r25755 (2010-11-15), lavf uses the Content-Base header for
> subsequent requests.
> This seems to break ffserver-ffmpeg interaction: ffserver logs:

Hmm, the original reason for the latter patch was that if the original 
RTSP url contained request parameters, e.g. rtsp://server/path?auth=abcd, 
the SETUP and PLAY requests should have the query parameters removed, 
e.g. SETUP rtsp://server/path/stream=0 and PLAY rtsp://server/path.

We had two choices for solving this - explicitly strip out the query 
parameters, or use the Content-Base field which most servers provide. We 
only chose the latter.

For reference, I wiresharked and looked at what Live555 and QuickTime 
Player do. Live555 does quite exactly what our code does at the moment - 
it uses the value from Content-Base for both SETUP and PLAY, and will run 
into the same issue with ffserver.

QuickTime, however, uses the value from Content-Base with SETUP, but 
reverts to the original URL for the PLAY requests (and still includes the 
query parameters, making it fail with the particular server which led up 
to the commit on 2010-11-15.

Given this, I'm not inclined to change the behaviour in the playback code 
currently (although, one could make it skip trailing slashes, but that's 
even more hacky heuristics imo).

But ffserver sure should be fixed to handle PLAY requests with a trailing 
slash I think, at least for compatibility with VLC/Live555. Does the 
attached patch work for you?

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffserver-Try-matching-the-RTSP-url-without-a-trailin.patch
Type: text/x-diff
Size: 1242 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110216/b656f394/attachment.patch>

More information about the ffmpeg-devel mailing list