[FFmpeg-devel] [PATCH] Add the frame size attribute to SDP descriptions

Martin Storsjö martin
Fri Jan 8 09:40:18 CET 2010

On Fri, 8 Jan 2010, Luca Abeni wrote:

> Ah, ok... Thanks for the search. So, it is a 3GPP thing...
> I am ok for supporting "a=framesize". However, the specified size
> should be "the largest picture size a specific H.263 payload type
> will carry within the session". So, using c->width and c->height
> is not entirely correct.
> I think we have 2 possibilities:
> 1) Applying your patch, with a comment saying where this attribute
>    comes from, and clarifying that this setting might be incorrect
>    if the video size changes
> 2) Not using c->{width,height}, but using the AVMetadata
>    infrastructure... This might be a little bit more complex, but
>    I believe it is more flexible, allowing the user to add more "a="
>    lines if needed (without needing to modify sdp.c every time).
>    My basic idea is that if the AVFormatContext contains a metadata
>    tag with key "key" and value "value", then the "a=key:value" line
>    is added to the SDP (the "title" metadata should be excluded
>    because it is already used for the "s=" line).

That would at least be the most general thing, leaving the choice to the 
libavformat user. That'd also be good for adding the other 3gpp SDP 
headers mentioned in the same document.

However, if e.g. transcoding a stream with ffmpeg, where the input file 
has some normal metadata, wouldn't these be copied into the SDP, resulting 
in completely bogus SDP entries? Should the AVMetadata entries to be added 
to the SDP be tagged in some way, e.g. key = sdp:keyname, adding a 
a=keyname:value in that case?

As for setting this particular attribute - it includes the payload type 
number, which is set internally within the rtp muxer and sdp writer and 
not available to the libavformat user setting the AVMetadata entries, so 
setting it externally isn't too easy, if we don't make assumptions about 
in which way libavformat assigns the payload type numbers.

Some other formats (such as AAC, H.264) add extradata to the SDP, so in 
those cases, you can't change parameters later on in the stream anyway.

// Martin

More information about the ffmpeg-devel mailing list