[FFmpeg-devel] SDP syntax

armand bendanan armand.bendanan
Thu Oct 8 15:26:42 CEST 2009


Hi,

 

In function sdp_write_header of the file libavformat/sdp.c:

 

static void sdp_write_header(char *buff, int size, struct sdp_session_level
*s)

{

    av_strlcatf(buff, size, "v=%d\r\n"

                            "o=- %d %d IN IP4 %s\r\n"

                            "t=%d %d\r\n"

                            "s=%s\r\n"

                            "a=tool:libavformat "
AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",

                            s->sdp_version,

                            s->id, s->version, s->src_addr,

                            s->start_time, s->end_time,

                            s->name);

    sdp_write_address(buff, size, s->dst_addr, s->ttl);

}

 

According to the RFC 4566 paragraph '5. SDP specification', the Session
description MUST be the first, following by the optional Media description.

In each section the order of the lines is fixed.

 

The order is :

     Session description

         v=  (protocol version)

         o=  (originator and session identifier)

         s=  (session name)

         i=* (session information)

         u=* (URI of description)

         e=* (email address)

         p=* (phone number)

         c=* (connection information -- not required if included in

              all media)

         b=* (zero or more bandwidth information lines)

         One or more time descriptions ("t=" and "r=" lines; see below)

         z=* (time zone adjustments)

         k=* (encryption key)

         a=* (zero or more session attribute lines)

         Zero or more media descriptions

 

So :

 

1/ the 's=' attribute should be before the 't='  (Time description).

 

2/ the sdp_write_address call will add a 'c=' Session attribute should  also
be before the 't=' attribute.

 

Armand Bendanan

 




More information about the ffmpeg-devel mailing list