[Live-devel] Which class to use?
Ross Finlayson
finlayson at live555.com
Wed Oct 5 12:38:37 PDT 2005
>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.
Ross Finlayson
Live Networks, Inc. (LIVE555.COM)
<http://www.live555.com/>
More information about the live-devel
mailing list