[FFmpeg-devel] [PATCH] SDP muxer

Stefano Sabatini stefano.sabatini-lala
Mon Nov 17 00:51:09 CET 2008


On date Thursday 2008-11-13 16:48:15 +0100, Luca Abeni encoded:
> Hi,
> 
> Luca Barbato wrote:
> > On 13-11-2008 9:05, Stefano Sabatini wrote:
> >> Forget about this last one, the syntax is wrong and I think it is
> >> better to use the filename string to express that anyway, something
> >> like -f sdp rtp://localhost:5004,localhost:5008/test.sdp but I need to
> >> think more about it.
> > 
> > I'd try an approach similar to map
> > 
> > -map_sdp output_stream_id:sdp_filename
> > 
> > -map_sdp 0:en.sdp -map_sdp 1:en.sdp -map_sdp 0:fr.sdp -map_sdp 2:fr.sdp
> > 
> > This way you get en.sdp and fr.sdp sharing the video stream 0 and using 
> > their language specific audio stream 1 and 2.
> 
> Yes, I like this solution.

I like it too, but I introduced a variant so that the syntax is:
-map_sdp output_stream_index:output_sdp_stream_index

So the previous example becomes:

 -map_sdp 0:0 -map_sdp 1:0 -map_sdp 0:1 -map_sdp -2:1 en.sdp fr.sdp

A complete example:

ffmpeg -i audio-en.mp3 -i audio-fr.ogg -i video.mpeg \
       test.flv \                                       # output stream 1
       -acodec pcm_mulaw rtp:/localhost:5004 \          # output stream 2, en
       -acodec libmp3lame rtp:/localhost:5008 \         # output stream 3, fr
       -vcodec h263 rtp:/localhost:5010 \               # output stream 4
       -title "A/V multistream en" -f sdp en.sdp -map_sdp 2:5 -map_sdp 4:5 # output stream 5  
       -title "A/V multistream fr" -f sdp fr.sdp -map_sdp 3:6 -map_sdp 4:6 # output stream 6

This is functionally equivalent, slightly less verbose in case of
long SDP files names and easier/cleaner to implement.

> Anyway, whatever solution is chosen the important thing is not to break
> the current libavformat API (avf_sdp_create(), and the way rtp:// URLs
> are specified).

Yes, this solution won't break neither URLs syntax neither old API
interface, while on the other hand I'm extending the interface, in
order to create a representation of an SDP from a list of RTP files.

(Still no patch ready, stay tuned...).

Regards.
-- 
FFmpeg = Fiendish Frenzy Merciless Purposeless Everlasting Gymnast




More information about the ffmpeg-devel mailing list