[Live-devel] how to send RTX header extension?

Yedidia Amit amit.yedidia at elbitsystems.com
Tue Nov 3 09:10:12 PST 2009


1. not really, but you can use it for that purpose (like I did)
2. I am adding few template for function of MyVideoRTPSink which is
derived from H264videoRTPSink but with extension support
3. make sure that your extension header is according to the standard 
4. make sure that you are working with new VLC version (0.9 and up)
 
MyVideoRTPSink::specialHeaderSize() {
    //return the extension header size
}
 
Boolean MyVideoRTPSink::continuePlaying() {
 // First, check whether we have a 'fragmenter' class set up yet.
 // If not, create it now:
 if (fOurFragmenter == NULL) {
  fOurFragmenter = new H264FUAFragmenter(envir(), fSource,
OutPacketBuffer::maxSize,
   ourMaxPacketSize() - 12/*RTP hdr size*/ -
MY_MAX_EXTENSION_SIZE/*youre header extension size*/);
  fSource = fOurFragmenter;
 }
 
 // Then call the parent class's implementation:
 return MultiFramedRTPSink::continuePlaying();
}
 
 
/**
 * do two things
 * 1. exactly what H264videoRTPSink
 * 2. adding extension 
 */
void MyVideoRTPSink::doSpecialFrameHandling(unsigned
fragmentationOffset, unsigned char* frameStart, unsigned
numBytesInFrame, struct timeval frameTimestamp, unsigned
numRemainingBytes){
 
 // Set the RTP 'M' (marker) bit iff
 // 1/ The most recently delivered fragment was the end of
 //    (or the only fragment of) an NAL unit, and
 // 2/ This NAL unit was the last NAL unit of an 'access unit' (i.e.
video frame).
 if (fOurFragmenter != NULL) {
  H264VideoStreamFramer* framerSource
   = (H264VideoStreamFramer*)(fOurFragmenter->inputSource());
  // This relies on our fragmenter's source being a
"MPEG4VideoStreamFramer".
  if (fOurFragmenter->lastFragmentCompletedNALUnit()
   && framerSource != NULL &&
framerSource->currentNALUnitEndsAccessUnit()) {
    setMarkerBit();
  }
 
 }
 
 setTimestamp(frameTimestamp);
 
 //adding the telemetry;
  if (fOurFragmenter != NULL) {
  DveH264VideoStreamDiscreteFramer* framerSource
   = (DveH264VideoStreamDiscreteFramer*)(fOurFragmenter->inputSource());
  
   
   
  if (/* you want to ad the extension now){
    unsigned char*  ptrExt = /* pointer to your extension structure*/;
    int size = /*size of your extension structure*/

   setSpecialHeaderBytes(ptrExt ,size);
   setExtensionBit();
  }
 }
  
 

________________________________

From: live-devel-bounces at ns.live555.com
[mailto:live-devel-bounces at ns.live555.com] On Behalf Of Tsahi Etziony
Sent: Tuesday, November 03, 2009 5:20 PM
To: live-devel at ns.live555.com
Subject: [Live-devel] how to send RTX header extension?


I am using the wis-streamer to send h.264 frames over rtp/rtsp, and
testing it by watching the stream with VLC player.
I wanted to add RTP header extension to the RTP packets, and I have some
problems.
 
I have  RTPSink class that inherits from the MultiFramedRTPSink class,
and I implemented the following two virtual functions:
-          doSpecialFrameHandling() - it adds words to the special
header (which I understood it is the RTP header extension), and then
calls the original doSpecialFrameHandling() function.
-          specialHeaderSize() - it returns the size of the special
header in 32bit words.
 
the first problem I have is that I didn't find any section of the code
that turns on the 'header extension exists' bit in the RTP header. I
added it manually in buildAndSendPacket() function.
 
The second problem I have is that now that the packets are sent with the
extension (according to a network sniffer), the VLC player displays bad
video. 
 
I have a few questions:
1.       is the special header equivalent to the header extension? 
  
2.       Where is the 'header extension exists' bit in the RTP header
being turned on?
3.       What did I forget? What am I doing wrong?
 
Thanks
 

The information in this e-mail transmission contains proprietary and business 
sensitive information.  Unauthorized interception of this e-mail may constitute 
a violation of law. If you are not the intended recipient, you are hereby 
notified that any review, dissemination, distribution or duplication of this 
communication is strictly prohibited. You are also asked to contact the sender 
by reply email and immediately destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20091103/a6ffa693/attachment-0001.html>


More information about the live-devel mailing list