[Live-devel] RTSP Client subclassing questions.

Cristiano Belloni belloni at imavis.com
Fri Jan 18 09:03:52 PST 2008


Cristiano Belloni wrote:
> Ross Finlayson wrote:
>   
>>> Ross Finlayson wrote:
>>>     
>>>       
>>>>>  However, I need some info: the camera I'm contacting does not send normal
>>>>>  video frames, but custom ones. I need to unpack every RTP packet (_in
>>>>>  order_), read the custom headers, reconstruct the frames and decode them
>>>>>  on the fly.
>>>>>    
>>>>>         
>>>>>           
>>>>  Because your 'custom headers' are not RTP-specific, but are instead
>>>>  part of your payload, you should not write any new RTP-specific code
>>>>  for this.  Instead, just have the object that reads from your
>>>>  "RTPSource" (subclass) object do the processing/decoding of these
>>>>  custom frames.
>>>>
>>>>  
>>>>       
>>>>         
>>> Ehm, sorry, I didn't understand your answer. Do you mean I should
>>> subclass RTPSource?
>>>     
>>>       
>> I'm saying that you might not need to write any new (sub)classes at 
>> all.  Can you tell me some more about what your data looks like - 
>> i.e., what video codec are you using, and how is the data different 
>> from the standard?
>>   
>>     
> It's MPEG-4 data, 1440 bytes a packet. At the start of each packet 
> there's a 16 or 6 bytes header that I must read, depending on the fact 
> the packet starts a frame or is a middle/ending packet.
>
> I'd need to analyze the payload of every RTP packet I receive, read the 
> header, accumulate the MPEG-4 data following the header and, as soon as 
> I have an MPEG-4 frame, pass it to a decoder.
>
> Is there something like a function that is called everytime I get an RTP 
> packet, so I can examine its payload?
>
>   
Alternatively, I could parse a whole frame, recognize the headers and 
extract them. Maybe the way to go is to set afterGettingFunc 
<http://www.live555.com/liveMedia/doxygen/html/classFramedSource.html#e39d6c83790473cabce9b4cdb873c50d>  
inside  the RTPSource? But it seems I can't do it without subclassing.

Please note I would like to analyze packets in memory buffers in a 
packet per packet or, if it's not possible, frame - per frame fashion, 
so I don't want to use use pipes and the like (for example, to redirect 
stream to stdout and analyze it in another piped process).

-- 
Belloni Cristiano
Imavis Srl.
www.imavis.com <http://www.imavis.com>
belloni at imavis.com <mailto://belloni@imavis.com>


More information about the live-devel mailing list