[Live-devel] streaming multiple videos with multiple streams

Adrian Kovacs A.Kovacs at Noldus.NL
Tue Jun 3 07:16:58 PDT 2014


Problem:
I am working on a direct show filter, which can stream multiple types of video/audio streams. It works well, if I use only one instance. My basic test scenario is to stream a video and view it in VLC. But if I use 4 instances of the filter in same graph I have problems. If I try to open streams in my computer, I can open all four streams, but after a while strange things happen: streams stop to play and I loose my net connection for a while (after I kill my streaming test scenario, my network will be restored in 1 minute). If I try to open the streams on another computer, I can open only 1 or 2 in VLC, 3rd instance can't connect.

The problem happens with more type of streams (H264, MJPEG), so it's not a stream type specific. I use different ports for each stream.
My feeling was that the problem is in Groupsock object creation, because I used here I used the same port for Groupsock objects in each filter instance, but after I changed to different, it's still not ok. (I use 255 Ttl.)

//Groupsock:
struct in_addr destinationAddress = {0};
destinationAddress.s_addr = chooseRandomIPv4SSMAddress(*m_pEnv);
Groupsock* m_pRtcpGS = new Groupsock(*m_pEnv, destinationAddress, port, g_chTtl);
m_pRtcpGS->multicastSendOnly();

//RTCPInstance:
gethostname((char*)szHostName, nMaxSize);
m_pRtcp = RTCPInstance::createNew(*m_pEnv, m_pRtcpGS, g_cnBandwidth, szHostName, m_pVideoSink, NULL, True);

//RTSPServer:
m_pRtspServer = RTSPServer::createNew(*m_pEnv, (Port)(m_nPort), m_pAuthDB);

//ServerMediaSession:
m_pSms = ServerMediaSession::createNew(*m_pEnv, crstrStreamPath.c_str(), "", crstrStreamDescription.c_str(), True /*SSM*/);

//RTPSink (for example MJPEG):
if (m_pRtpGS == NULL)
{
    m_pRtpGS = CreateGroupsock(port); // this port is different than the port is used for m_pRtcpGS
}
OutPacketBuffer::maxSize = g_cnBuffersize;
m_pVideoSink = JPEGVideoRTPSink::createNew(*m_pEnv, m_pRtpGS);
m_pVideoSource = NCRtspMJPEGFramedSource::createNew(*m_pEnv);
m_pVideoSink->startPlaying(*m_pVideoSource, NULL, NULL);


Do you have ide which part can cause the problem, and how can I try to fix it?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140603/15a03061/attachment-0001.html>


More information about the live-devel mailing list