[FFmpeg-devel] [PATCH] Add an RTSP muxer

Luca Abeni lucabe72
Tue Jan 5 11:52:55 CET 2010

Hi Martin,

On 05/01/10 00:30, Martin Storsj? wrote:
>> - Patch 03/24 looks ok. But maybe avf_sdp_create() should just fail if the
>> destination address is not "rtp://"
>> - I still have to think about patch 04/24.
> In the RTSP/RTP setup procedure, the destination port isn't known when
> creating the SDP, so port will inevitably be 0 here. And as far as I can
> see from the SDP specs in RFC, a c= line is mandatory - the current code
> in sdp.c leaves out this line if n_files == 1 and port<= 0.

Ok; so the failing case is RTSP with a single stream (audio only). Right?
Yes, I think your patch is ok, then. I'll double look at it and commit 
in the weekend.

>> - I need to better understand your rtpenc.c patches. Well, I understand what
>> the patches do, but I do not understand why all those changes are needed (for
>> example, patch 10/24 says "Use the AVStream st member from RTPMuxContext
>> instead of AVFormatContext->streams[0]", but it does not explain why. BTW, I
>> just noticed that the "st" field of RTPMuxContext seems to be unused...).
>> It seems that your goal is to use the rtpenc code without using an
>> output format context... Why? Cannot the RTSP muxer create one or more
>> proper RTP muxers, and use them, instead of exposing some of the RTP
>> muxer internals?
> Yes, that was my goal. I wasn't really sure how to chain the muxers, to
> connect the AVStream* that the user set in the RTSP AVFormatContext to the
> internal RTP AVFormatContexts (just simply copy the pointers?), and thus I
> thought using RTPMuxContext directly would be leaner.
>  From both your and Ronalds reactions, I see that you'd prefer me to use
> the full AVFormatContext interface inbetween.

Yes, I believe using the standard muxer interface is better. But, of 
course, we need to check how the code would look like...

> Are there any examples of chaining muxers this way?

I do not think there currently are examples, but I believe the "chained 
muxers" thing is something we want anyway. If you agree to go this way, 
I am willing to help in developing the code; I just need to find some 
time :).

> Ronald was ok with patch 0010 - would you be ok to apply this one,
> preceded by 0005?

Sorry, I do not understand what's the goal of such a patch. I am not 
saying "no", I just need to understand which are the advantages provided 
by the patch.
Until yesterday, I never realised we have that unused "st" field, so my 
first reaction was "let's remove it". But if it is needed for some 
reason, I am ok with it.

> Or on the other hand, if I get the chained muxers to
> work fine, this member could be removed completely, since it is currently
> unused.

That was my impression too.


More information about the ffmpeg-devel mailing list