2

Live555 lib has a nice example testOnDemandRTSPServer.cpp This example just stream "one" given file. I want to stream more than one file. Does Live555 has playlist concept or how to stream more than one file in Live555?

Best Wishes

PS: I try to add more than one subsession, in that case Live555 just stream the last session file...

Ralf
  • 9,405
  • 2
  • 28
  • 46
Novalis
  • 2,265
  • 6
  • 39
  • 63
  • Do you mean stream more than one file consecutively (in the same RTSP session) or do you mean multiple media files to different clients? – Ralf Jun 30 '11 at 14:49
  • @Ralf For now i mean stream more than one file consecutively. Suppose i have videoA, VideoB, VideoC.. I want to stream them consecutively and in a single session if possible... Suppose client request rtsp://xxxxxx/Video and server will stream first VideoA, then VideoB then videoC etc... – Novalis Jun 30 '11 at 15:39

3 Answers3

1

There is one more application that comes with the live555 code. Live555Media server is present inside the source code's mediaServer directory. This does the job. It uses the dynamicRTSP server class. You give it the folder with all your media files and access them as rtsp://ip/filename.

Garrett Hyde
  • 5,409
  • 8
  • 49
  • 55
Swaroop
  • 91
  • 4
0

Recently I had to do similar task and with similar functionality:

Here what you can do for video H264 stream files to play in the row like playlist (of course if they are same resolution, encoding profile,etc)

You would have to modify ByteStreamFileSource::doGetNextFrame method. There is code like feof(fFid)

 if (feof(fFid))
 {
     CloseInputFile(fFid);
     fFid = OpenInputFile(envir(), "test.264");
     //fileName
 } 
else ....

Of course if you still need LGPL compliance you there will be more work to do... You will have to copy/rename this class outside library and do the same with H264VideoFileServerMediaSubsession and modify method createNewStreamSource that it would use you rewritten class of ByteStreamFileSource.

  • could you please describe this solution in more detail? I have attempted to run the change you suggest here and it does not result in the desired behavior – eliba Apr 18 '19 at 17:22
  • @eliba Simple: when file descriptor fFid reahces the end of file, open new preferred file ... – Audrius Gailius Sep 06 '22 at 10:30
0

My 0.02 cents: I'm not sure if that makes sense: how would you ensure that they are all encoded in the same format which is a requirement if you want to stream them in the same session. RTSP describe gets a media session description of the file and this is used to setup the streaming sessions so it is crucial that all files encoded similarly.

RTSP does not make any provision for playlists. Usually playlists are not transferred via RTSP, but say via HTTP. IMO if the playlist resides on the client it would make more sense to await the RTCP bye packet (at the eof) and then to do a SETUP and PLAY for the next file/RTSP URI in the playlist.

If you just want to stream a sequence of files (playlist is on the server) where the RTSP client just initiates one session, of course nothing prevents you from creating a custom file source in the live555 library that does what you want...

Ralf
  • 9,405
  • 2
  • 28
  • 46
  • Well, the assumption : they are all encoded in the same format is true for me... nothing prevents me ofcourse to write custom source file but i just wanted to know if library has such a build in capability...Thanks – Novalis Jun 30 '11 at 16:55
  • Ok, for sure. If you are using live555 it is well worth it joining the mailing list, and response time is usually very good. Just make sure you read the FAQ before posting. – Ralf Jun 30 '11 at 17:04