[Live-devel] Which class to use?

Joseph Lazar jlazar at xperts.hu
Mon Oct 10 15:47:36 PDT 2005


Ross Finlayson wrote:

>
>> I would like to develop an application which slices video stream into 
>> GOPs along with audio belonging to the given GOP and later process it 
>> with an other application.
>
> [...]
>
>> Is there an existing class or test program which can handle this 
>> media format I could start with?
>
>
> Yes, I suggest that you start with the "openRTSP" demo application 
> (see <http://www.live555.com/openRTSP/>).  This currently receives 
> data from the RTSP/RTP stream, and writes it into two separate output 
> files - one for video; one for audio.
>
> You will need to modify this code to process video and audio the way 
> you want.  In particular, you will need to modify line 715 of 
> "testProgs/playCommon.cpp" to - instead of creating a "FileSink" for 
> each input stream - create an object of a special "MediaSink" 
> subclass, that you will write:
> - For the video stream, i.e., if
>         strcmp(subsession->mediumName(), "video") == 0
>   create a sink that will examine the header of each input frame 
> (MPEG-4 Video), and thereby gather those frames that make up a single 
> GOP.
> - For the audio stream, create a sink that will gather up the audio 
> (PCM u-law) and process it as appropriate.
> Note that each piece of input data (to the 'sink' class) will have an 
> associated "presentationTime" that you can use.
>
> You will probably find it useful to use the "FileSink" code 
> ("liveMedia/FileSink.cpp") as a model when you write code for your two 
> new classes.
>
I've done what you've suggested. It works fine (I think), though I have 
an other question. I want to synch the audio belonging to one GOP to the 
video and wanted to use the "presentationTime" for this purpose. What I 
can see is as follows: when the program starts the value is fine 
(something like 1128947795, which is a correct UNIX date), then after a 
while it jumps to 348866 (it is incrementing of course). How this can 
be? Where this stamp is comming from, who is generating it (the device 
maybe)? Please help me or give me a WWW pointer where I can read about it.

-- joseph


More information about the live-devel mailing list