[Live-devel] Streaming multiphe consecutive MPEG-4 files (.m4e)

Ross Finlayson finlayson at live555.com
Fri Mar 11 14:01:11 PST 2011


>Hello, i am working in a project with the live555 library and our target
>is to stablish a rtsp channel with a player that request the video clips
>asocciated to a playlist.
>What i want to do is at the very beginning of the communication to process
>this playlist which includes all the files to be played and include then
>in the structures of the class ByteStreamMultiFileSource to be played all
>consecutively in one shot without needing any extra interaction.
>
>Can anyone help to me where to implement this code so that reading the
>file, the videos to play are inserted in the object of this class and they
>start to be played in order from the first one?

It wasn't totally clear from your question, but I'm assuming that 
you're asking how to implement a RTSP *server* that reads from 
multiple files, while streaming to clients as if the data came from a 
single source.

To do this, you will need to write your own "ServerMediaSubsession" 
subclass - similar to the existing 
"MPEG4VideoFileServerMediaSubsession" class - that implements the 
"createNewStreamSource()" virtual function by creating a 
"ByteStreamMultiFileSource" instead of a "ByteStreamFileSource".

To create a "ByteStreamMultiFileSource", you call 
"ByteStreamMultiFileSource::createNew()", passing it a parameter 
"char const** fileNameArray".  (See 
"liveMedia/include/ByteStreamMultiFileSource.hh")  The 
"fileNameArray" parameter is a pointer to an array of file names, 
ending with NULL.

For example, if you have a playlist 
"filename1","filename2","filename3", you'd create "fileNameArray" as 
follows:

	char const** fileNameArray = new char const*[4];
	fileNameArray[0] = "filename1";
	fileNameArray[1] = "filename2";
	fileNameArray[2] = "filename3";
	fileNameArray[3] = NULL;

-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list