Hello everyone!

I would be very grateful if someone could help me out with the issue below, I'm 
new to live555.

I've got nine audio streams that I'm pulling in via ffmpeg and then re-encoding 
them to AAC-LC and pushing to udp://127.0.0.1:port_num?pkt_size=1316 (where 
port_num is replaced by respective port number) The first stream is being 
pushed to port 10000, the second one to 10001, third one to 10002, etc.

Example for first stream:
ffmpeg -i remotestream [...codec options...] -f mpegts 
udp://127.0.0.1:10000?pkt_size=1316

I've modified testOnDemandRTSPServer.cpp as shown below. (taken from 
live555-latest.tar.gz downloaded today - 8 March 2015)
I launch my ffmpeg instances & the rtsp server and connect to it via 
VLC/another rtsp client.

It works, I do hear the audio stream, however the issue is that as soon as one 
client connects, the RTSP server uses 100% of the CPU.
As soon as the client disconnects, the CPU usage falls back to normal. Any idea 
of what could be wrong?

#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"

UsageEnvironment* env;
Boolean reuseFirstSource = False;
Boolean iFramesOnly = False;

int main(int argc, char** argv) {
  TaskScheduler* scheduler = BasicTaskScheduler::createNew();
  env = BasicUsageEnvironment::createNew(*scheduler);

  RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554, NULL);
  if (rtspServer == NULL) {
    *env << "Failed to create RTSP server: " << env->getResultMsg() << "\n";
    exit(1);
  }

  char const* descriptionString
    = "Session streamed by \"MyRTSPServer\"";

   int NUM_STREAMS = 9;
   char const* streams[] = 
{"stream1","stream2","stream3","stream4","stream5","stream6","stream7","stream8","stream9"};
   int port = 10000;

  for(int i=0;i<NUM_STREAMS;i++)
  {
    const char* streamName = streams[i];
    const char* inputAddressStr = "127.0.0.1";
    portNumBits inputPortNum = port; port++;
    Boolean const inputStreamIsRawUDP = True;
    ServerMediaSession* sms = ServerMediaSession::createNew(*env, streamName, 
streamName,descriptionString);
    sms->addSubsession(MPEG2TransportUDPServerMediaSubsession::createNew(*env, 
inputAddressStr, inputPortNum, inputStreamIsRawUDP));
    rtspServer->addServerMediaSession(sms);

    char* url = rtspServer->rtspURL(sms);
    *env << "\n\"" << streamName << "\" stream, from a UDP Transport Stream 
input source \n\t(";
    if (inputAddressStr != NULL) {
      *env << "IP multicast address " << inputAddressStr << ",";
    } else {
      *env << "unicast;";
    }
    *env << " port " << inputPortNum << ")\n";
    *env << "Play this stream using the URL \"" << url << "\"\n";
    delete[] url;
  }

  env->taskScheduler().doEventLoop(); // does not return

  return 0; // only to prevent compiler warning
}


Thanks!
Shaan



Shaan Nobee

- Corporate Office
Tel: +2302037117  |  Mob: +23052518816  |  Fax: +2302116996
[email protected]<mailto:[email protected]>
www.mauritiustelecom.com<http://www.mauritiustelecom.com/>     |     
www.orange.mu<http://www.orange.mu/>     |     [Orange on Facebook] 
<http://www.facebook.com/orangemauritius?ref=hl>      |     [Orange on Twitter] 
<http://https//twitter.com/OrangeMauritius>

[Mauritius Telecom]<http://www.mauritiustelecom.com/>          [Orange 
Mauritius] <http://www.orange.mu/>
This message and its attachments may contain confidential or privileged 
information that may be protected by law; they should not be distributed, used 
or copied without authorisation. If you have received this email in error, 
please notify the sender and delete this message and its attachments. As emails 
may be altered, Mauritius Telecom - Orange is not liable for messages that have 
been modified, changed or falsified.
_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to