[FFmpeg-devel] Realmedia RTSP (RDT) support

Ronald S. Bultje rbultje
Wed Jun 13 03:40:14 CEST 2007


attached patch is an extremely rough draft for $subj. It's not meant for
going into svn just yet, but for 1) comments and 2) licensing concerns. I've
basically taken the RTSP header values (the GUID, application name, etc.)
and the calculate_response_and_checksum() function from librtsp, which is
gpl. I'd like help with getting that into an LGPL shape. Other than that,
I'm not happy with various parts of the patch, it also contains some stuff
that could probably go separately, etc. I'd like some architectural comments
on the patch as a start (though anything is welcome).

The way librtsp does it is as follows:
- set up rtsp, decide if it's real or not
- if real, go to realrtsp, set up (code completely separate from the generic
rtsp code) a connection
- prepare a file and frame header, then feed to rm demuxer

What I did:
- copy rtsp set-up strings and the checksum/challenge calculation code
- set up rtsp similarly to normal rtsp connections
- implement a special rtp_rm.c file to handle rdt-specific parts. Not
everything is done in here yet, because that will cause large architectural
changes, and I want to make sure I'm doing right before I go there. RTP
frame headers start with $<id:8><size:16>, and then data. The data, for
normal rtsp, is 12 bytes and contains the timestamp, ssrc and a sequence
number. For rtsp, it contains only the timestamp and sequence number, and is
only 10 bytes, although it is sometimes 19 (no idea why, but librtsp is
always helpful in finding out :-) ). I will make this runtime conditional,
but just to keep things easy it's a macro right now (yes yes, blegh &etc).
- From here on, we go into rtp_rm.c and do code-specific stuff. I basically
exported some code in rmdec.c to parse data appropriately and that sometimes
gets me actual sound. We set up all this stuff using OpaqueData from the SDP
RTSP header which contains the rtp codec-specific file header (mdpr).

- rtp_parse_packet() has real-specific code, should probably move to
rtp_rm.c, but how?
- the strings and checksum/challenge calculation are also real-specific,
move out of rtsp.c?
- AAC works, but plays too fast, I'm still debugging this...
- other codecs (I tested only cook, which doesn't) may (=will :-) ) not
work, I'm still debugging this...
- License (librtsp GPL, ffmpeg LGPL); how applicable for one function and
some strings?)
- I think people wanted to allow stream selection for mms in a special way,
I haven't implemented that at all yet (it takes stream 0 right now,
hardcoded). Doing that probably requires separating RTPStream from AVStream,
since one RTP stream can take shape of various AVStreams (exclusively,
similar to mms). Don't really know yet how I'll make that selectable.

Anyway, maybe useful for some people, maybe somehow even wants to help out
or so. Enjoy.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtsp-realmedia.patch
Type: application/octet-stream
Size: 39043 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070612/ac157b8e/attachment.obj>

More information about the ffmpeg-devel mailing list