[Live-devel] Using openRTSP to receive and decode h264 stream
Jens Binder
jens.binder at hhi.fraunhofer.de
Fri Aug 20 05:04:09 PDT 2010
Hi,
> Hi,
>
> Regarding your FAQ entry, "Can I stream H.264 video via RTP? None of the
> test programs illustrate this." I have a couple of questions.
>
This FAQ-entry is only for *streaming* - which means sending out H.264
frames via RTP/RTSP
> I'm using your live555 library to receive RTSP. I have been using
> mplayer as a guide as suggested on the openRTSP page.
From your question I suppose you want to *receive* data!
> I am also using
> the libavcodec decoder, but it doesn't work. I noticed in your FAQ you
> said that h264 could be used with your live555 library if you implement
> currentNALUnitEndsAccessUnit(). But I cannot find this function used
> anywhere in the mplayer source tree. At what point in initialization of
> live555 would you create H264VideoStreamFramer class that implements it?
> And to what do you give it?
The H264VideoStreamFramer is only used for streaming (sending) H264 data
- not for receiving data. You don't need it at all.
>
> I've been working on this problem for 2 months now and I just keep
> hitting walls. I know it's been done. Do you have any insight that could
> help?
use the doxygen together with the test-programs for understanding the
code - it's not straight-forward but works perfectly once you understand
what is happening!!
The basic steps in receiving RTSP-data are:
1. use RTSPClient for getting a SDP from the server
2. use SDP-description for creating a MediaSession
3. initiate the MediaSubsessions of the MediaSession
4. call RTSPClient::setupMediaSubsession for every Subsession
5. build and add a MediaSink to the Subsessions (mostly a subclass of
MediaSink where you define what to do with the received data)
6. start the stream by calling MediaSink::startPlaying,
RTSP::playMediaSession and finally starting the eventLoop.
this is roughly what is done by openRTSP. Have a close look on both
openRTSP.cpp and playCommon.cpp where mainly everything is done what you
are requesting.
Hope I could help you,
Jens.
More information about the live-devel
mailing list