<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<STYLE><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></STYLE>
<META name=GENERATOR content="MSHTML 9.00.8112.16440"></HEAD>
<BODY class=hmmessage>
<DIV><FONT face=Arial><SPAN class=989035514-12012012>Make sure that your
firewall allows communications on the network for the specified
port.</SPAN></FONT></DIV>
<DIV> </DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> live-devel-bounces@ns.live555.com
[mailto:live-devel-bounces@ns.live555.com] <B>On Behalf Of </B>GS Net
Player<BR><B>Sent:</B> 12 January 2012 14:12<BR><B>To:</B>
live-devel@ns.live555.com<BR><B>Subject:</B> [Live-devel] RTSP only in Lan - Lan
?!<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr><SPAN id=result_box lang=en><SPAN class=hps>Can</SPAN> <SPAN
class=hps>someone</SPAN> <SPAN class=hps>tell</SPAN> <SPAN class=hps>me</SPAN>
<SPAN class=hps>why my</SPAN> rtsp <SPAN class=hps>code</SPAN> <SPAN
class=hps>only works</SPAN> <SPAN class=hps>in the local network ( Lan - Lan
) </SPAN> <SPAN class=hps>but not on</SPAN> <SPAN class=hps>Windows</SPAN>
<SPAN class=hps>Server 2008 ( hosting ) ?<BR></SPAN></SPAN><SPAN id=result_box
lang=en class=short_text><SPAN class=hps>here's</SPAN> <SPAN class=hps>my</SPAN>
<SPAN class=hps>code:</SPAN></SPAN><BR><BR>#include "liveMedia.hh"<BR>#include
"BasicUsageEnvironment.hh"<BR>#include
"GroupsockHelper.hh"<BR><BR>UsageEnvironment* env;<BR><BR>Boolean const isSSM =
True;<BR><BR>char const* inputFileName =
"udp://@239.255.42.42:8888";<BR>MPEG1or2VideoStreamFramer*
videoSource;<BR>RTPSink* videoSink;<BR><BR>void play(); //
forward<BR><BR>Boolean reuseFirstSource = True;<BR><BR>Boolean iFramesOnly =
False;<BR><BR>static void announceStream(RTSPServer* rtspServer,
ServerMediaSession* sms,<BR>
char const* streamName, char const*
inputFileName); // fwd<BR><BR>int main(int argc, char** argv) {<BR> //
Begin by setting up our usage environment:<BR> TaskScheduler* scheduler =
BasicTaskScheduler::createNew();<BR> env =
BasicUsageEnvironment::createNew(*scheduler);<BR><BR> <BR>
// Create a 'groupsock' for the input multicast group,port:<BR> char
const* inputAddressStr<BR>#ifdef USE_SSM<BR> =
"232.255.42.42";<BR>#else<BR> =
"239.255.42.42";<BR>#endif<BR> struct in_addr inputAddress;<BR>
inputAddress.s_addr = our_inet_addr(inputAddressStr);<BR><BR> Port const
inputPort(8888);<BR> unsigned char const inputTTL = 0; // we're only
reading from this mcast group<BR><BR>#ifdef USE_SSM<BR> char*
sourceAddressStr =
"udp://@239.255.42.42:8888";<BR>
// replace this with the real source address<BR> struct in_addr
sourceFilterAddress;<BR> sourceFilterAddress.s_addr =
our_inet_addr(sourceAddressStr);<BR><BR> Groupsock inputGroupsock(*env,
inputAddress, sourceFilterAddress, inputPort);<BR>#else<BR> Groupsock
inputGroupsock(*env, inputAddress, inputPort, inputTTL);<BR>#endif<BR><BR>
// Then create a liveMedia 'source' object, encapsulating this
groupsock:<BR> FramedSource* source = BasicUDPSource::createNew(*env,
&inputGroupsock);<BR> FramedSource* source2 =
BasicUDPSource::createNew(*env, &inputGroupsock);<BR><BR> char const*
outputAddressStr = "239.255.43.43"; // this could also be
unicast<BR> // Note: You may change "outputAddressStr" to use
a different multicast<BR> // (or unicast address), but do
*not* change it to use the same multicast<BR> // address as
"inputAddressStr".<BR> struct in_addr outputAddress;<BR>
outputAddress.s_addr = our_inet_addr(outputAddressStr);<BR><BR> Port const
outputPort(4444);<BR> unsigned char const outputTTL = 255;<BR><BR>
Groupsock outputGroupsock(*env, outputAddress, outputPort,
outputTTL);<BR><BR> // Create a 'MPEG-4 Video RTP' sink from the RTP
'groupsock':<BR> unsigned const maxPacketSize = 65536; // allow for large
UDP packets<BR> videoSink = SimpleRTPSink::createNew(*env,
&outputGroupsock, 33, 90000, "video", "mp2t",<BR>
1, True, False
/*no 'M' bit*/);<BR>// MediaSink* sink = SimpleRTPSink::createNew(*env,
&outputGroupsock, 33, 90000, "video", "mp2t",<BR>//
1, True, False
/*no 'M' bit*/);<BR><BR> <BR><BR> const
unsigned estimatedSessionBandwidth = 4500; // in kbps; for RTCP b/w
share<BR> const unsigned maxCNAMElen = 100;<BR> unsigned char
CNAME[maxCNAMElen+1];<BR> gethostname((char*)CNAME,
maxCNAMElen);<BR> CNAME[maxCNAMElen] = '\0'; // just in case<BR><BR>
RTCPInstance* rtcp = RTCPInstance::createNew(*env,
&inputGroupsock,<BR>
estimatedSessionBandwidth,
CNAME,<BR>
videoSink, NULL /* we're a server */,
isSSM);<BR> <BR> RTSPServer* rtspServer =
RTSPServer::createNew(*env, 8554);<BR> if (rtspServer == NULL)
{<BR> *env << "Failed to create RTSP server: " <<
env->getResultMsg() << "\n";<BR> exit(1);<BR>
}<BR> ServerMediaSession* sms<BR> =
ServerMediaSession::createNew(*env, "testStream",
inputFileName,<BR> "Session
streamed by \"testMPEG4VideoStreamer\"",<BR>
isSSM);<BR>
sms->addSubsession(PassiveServerMediaSubsession::createNew(*videoSink,
rtcp));<BR> rtspServer->addServerMediaSession(sms);<BR><BR><BR>
char* url = rtspServer->rtspURL(sms);<BR> *env << "Play this
stream using the URL \"" << url << "\"\n";<BR> delete[]
url;<BR><BR><BR> videoSource =
MPEG1or2VideoStreamDiscreteFramer::createNew(*env,
source);<BR> videoSink->startPlaying(*videoSource, NULL,
NULL);<BR><BR> if (rtspServer->setUpTunnelingOverHTTP(80)
|| rtspServer->setUpTunnelingOverHTTP(8000) ||
rtspServer->setUpTunnelingOverHTTP(8080)) {<BR> *env
<< "\n(We use port " << rtspServer->httpServerPortNum() <<
" for optional RTSP-over-HTTP tunneling.)\n";<BR> } else
{<BR> *env << "\n(RTSP-over-HTTP tunneling is not
available.)\n";<BR> }<BR><BR>//
sink->startPlaying(*source2, NULL, NULL);<BR><BR>
env->taskScheduler().doEventLoop(); // does not return<BR><BR> return
0; // only to prevent compiler warning<BR>}<BR><BR>static void
announceStream(RTSPServer* rtspServer, ServerMediaSession*
sms,<BR>
char const* streamName, char const* inputFileName) {<BR> char* url =
rtspServer->rtspURL(sms);<BR> UsageEnvironment& env =
rtspServer->envir();<BR> env << "\n\"" << streamName
<< "\" stream, from the file \""<BR>
<< inputFileName << "\"\n";<BR> env << "Play this stream
using the URL \"" << url << "\"\n";<BR> delete[]
url;<BR>}<BR><BR><PRE>greeting
Igor</PRE><BR></DIV></BODY></HTML>