[FFmpeg-devel] [PATCH] SAP muxer/demuxer

Martin Storsjö martin
Wed Oct 6 19:45:26 CEST 2010


Hi,

As mentioned in another thread, I've been working on a SAP (RFC 2974) 
muxer and demuxer. SAP is a very simple protocol for announcing the SDP 
info for a RTP broadcast, and is most often sent over multicast (but there 
are usecases where one could want to send it over normal unicast, too).

This requires the two SDP patch series that I posted yesterday, plus the 
patches attached here.

The SAP muxer creates one chained RTP muxer for each stream, just like the 
RTSP muxer does.

The content of this patch series is:
- Add a "connect" option to the udp protocol. In the SAP announcement, we 
need to send the local IP address we're sending the packets from, and 
that's not available on a normal UDP socket, only on a connected one. When 
connected, one has to use send() instead of sendto(), and if you receive 
"destination unreachable" ICMP packets, sends will return ECONNREFUSED.
Is this OK for Luca A/Ronald?
- Factorizing out a shared function from the RTSP muxer, that sets up a 
chained RTP muxer given an AVStream.
- One patch for adding the muxer, and one for adding the demuxer.

The demuxer awaits the first announcement, and then starts receiving the 
stream in that announcement using a chained SDP demuxer.

I'm excluding minor bump and a changelog entry from the patchset for now, 
since they're quite prone to be updated by others, I'll do them before 
applying.


To test all of this:

ffmpeg -re -i <input> -vcodec mpeg4 -acodec libfaac -f sap sap://244.1.2.3

ffplay sap://244.1.2.3

Or to test with VLC:

ffmpeg -re -i <input> -vcodec mpeg4 -acodec libfaac -f sap 
sap://244.0.0.255?same_port=1

(VLC/Live555 requires all RTP streams to be received on the same port in 
this scenario, for some reasons...)

Then in VLC, enable service discovery of Network streams (SAP).

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-udp-Add-an-option-for-connecting-the-udp-socket.patch
Type: text/x-diff
Size: 2254 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101006/aef60fc8/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-rtsp-Remove-the-start_time-field-from-RTSPState-use-.patch
Type: text/x-diff
Size: 2186 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101006/aef60fc8/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-rtsp-Make-rtsp_rtp_mux_open-reusable.patch
Type: text/x-diff
Size: 1828 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101006/aef60fc8/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-rtsp-Factorize-out-code-for-opening-a-chained-RTP-mu.patch
Type: text/x-diff
Size: 8742 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101006/aef60fc8/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-a-SAP-Session-Announcement-Protocol-muxer.patch
Type: text/x-diff
Size: 10012 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101006/aef60fc8/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Add-a-SAP-demuxer.patch
Type: text/x-diff
Size: 9128 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101006/aef60fc8/attachment-0005.patch>



More information about the ffmpeg-devel mailing list