コード例 #1
0
ファイル: MediaRtspServer.cs プロジェクト: okankilic/LisconVT
        public void Start()
        {
            RtspSource rtspSrc = new RtspSource("Zeta", "rtsp://rtsp-v3-spbtv.msk.spbtv.com:554/spbtv_v3_1/332_110.sdp", RtspClient.ClientProtocolType.Tcp);

            _server.TryAddMedia(rtspSrc);
            _server.Start();
        }
コード例 #2
0
        private void btnServerCreate_Click(object sender, EventArgs e)
        {
            string ipAddress = GetLocalIPAddress();

            try
            {
                _server = new RtspServer(IPAddress.Parse(ipAddress), 554);

                #region  Create media source
                //MJPEGMedia source1 = new MJPEGMedia("myLocalStream", @"C:/VTT/Video/HIKARI.mp4");

                RtspSource source2 = new RtspSource("myStream", "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov");

                //RFC2435Media source3 = new RFC2435Media("streamPics", @"C:\VTT\ImagesTest\") { Loop = true };

                #endregion

                //Add media source to server
                //_server.TryAddMedia(source1);
                _server.TryAddMedia(source2);
                //_server.TryAddMedia(source3);
                _server.Start();

                txbServerStatus.Text = "Server on";

                txbConnMax.Text = _server.MaximumConnections.ToString();
            }
            catch (Exception ex)
            {
                txbServerStatus.Text = ex.Message;
            }
        }
コード例 #3
0
ファイル: MyRtspServer.cs プロジェクト: Nokecy/RTMSTest
        public static void Main()
        {
            //Create the server optionally specifying the port to listen on
            using (RtspServer server = new RtspServer(IPAddress.Any, 554))
            {
                server.Logger = new RtspServerConsoleLogger();

                //Create a stream which will be exposed under the name Uri rtsp://localhost/live/RtspSourceTest
                //From the RtspSource rtsp://1.2.3.4/mpeg4/media.amp
                RtspSource source = new RtspSource("RtspSourceTest", "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov");

                //If the stream had a username and password
                //source.Client.Credential = new System.Net.NetworkCredential("user", "password");

                //If you wanted to password protect the stream
                //source.RtspCredential = new System.Net.NetworkCredential("username", "password");

                //Add the stream to the server
                server.TryAddMedia(source);

                //server.TryAddRequestHandler(RtspMethod.OPTIONS,)

                //Start the server and underlying streams
                server.Start();

                Console.WriteLine("Waiting for source...");

                while (source.Ready == false)
                {
                    Thread.Sleep(10);
                }

                Console.WriteLine("Source Ready...");

                Console.ReadKey();
                server.Stop();
            }
        }